WO2022077490A1 - Intra prediction method, encoder, decoder, and storage medium - Google Patents

Intra prediction method, encoder, decoder, and storage medium Download PDF

Info

Publication number
WO2022077490A1
WO2022077490A1 PCT/CN2020/121668 CN2020121668W WO2022077490A1 WO 2022077490 A1 WO2022077490 A1 WO 2022077490A1 CN 2020121668 W CN2020121668 W CN 2020121668W WO 2022077490 A1 WO2022077490 A1 WO 2022077490A1
Authority
WO
WIPO (PCT)
Prior art keywords
prediction
intra
filtering
block
reference pixel
Prior art date
Application number
PCT/CN2020/121668
Other languages
French (fr)
Chinese (zh)
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 CN202080106028.7A priority Critical patent/CN116325727A/en
Priority to CN202310996326.3A priority patent/CN116980596A/en
Priority to PCT/CN2020/121668 priority patent/WO2022077490A1/en
Priority to MX2023000279A priority patent/MX2023000279A/en
Publication of WO2022077490A1 publication Critical patent/WO2022077490A1/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/117Filters, e.g. for pre-processing or post-processing
    • 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/597Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding specially adapted for multi-view video sequence encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop

Definitions

  • the embodiments of the present application relate to video coding technologies, and relate to, but are not limited to, an intra-frame prediction method, an encoder, a decoder, and a storage medium.
  • Intra-frame prediction may perform an intra-frame prediction process separately for each coding unit to calculate a prediction block.
  • intra-frame prediction usually uses the respective angle mode and non-angle mode to predict the current block to obtain the predicted block, and then selects the optimal prediction of the current block according to the rate-distortion cost information calculated from the predicted block and the original block. mode, and then perform intra prediction based on the prediction mode.
  • the current intra-frame angle prediction does not use all reference pixels, and it is easy to ignore the correlation between some pixels and the current block.
  • the intra-frame prediction filtering technology improves the pixel prediction accuracy through point-to-point filtering, which can effectively enhance the spatial correlation. Therefore, the intra-frame prediction filtering technology is adopted to improve the pixel prediction accuracy through point-to-point filtering, which can effectively enhance the spatial correlation, thereby improving the intra-frame prediction accuracy.
  • the embodiments of the present application provide an intra-frame prediction method, an encoder, a decoder, and a storage medium, which can smooth the prediction process of processed image blocks and improve encoding and decoding efficiency.
  • an embodiment of the present application provides an intra-frame prediction method, which is applied to an encoder, and the method includes:
  • intra-frame prediction filtering Perform intra-frame prediction filtering and intra-frame prediction smoothing filtering on the initial prediction block respectively, to obtain a first-type prediction value and a second-type prediction value; wherein, the intra-frame prediction smoothing filtering adopts at least two adjacent reference values A process of filtering the current block for multiple adjacent reference pixels in each adjacent reference pixel set in the pixel set;
  • the first-type predicted value and the second-type predicted value respectively, perform rate-distortion cost calculation with the original pixel value of the current block, and determine the current prediction mode corresponding to the optimal rate-distortion cost;
  • the index information of the current prediction mode and the filter identifier are written into the code stream, where the filter identifier represents an identifier corresponding to intra-frame prediction filtering and/or intra-frame prediction smoothing filtering.
  • an embodiment of the present application provides an intra-frame prediction method, which is applied to a decoder, and the method includes:
  • the filtering flag indicates that the intra-frame prediction filtering permission flag is valid and the intra-frame prediction smoothing filtering permission flag is valid, at least obtain the current prediction mode and the intra-frame prediction filtering use flag from the code stream;
  • intra-frame prediction filtering use flag When the intra-frame prediction filtering use flag is invalid and a valid intra-frame prediction smoothing filter use flag is obtained from the code stream, based on the current prediction mode, perform intra-frame prediction smoothing filtering processing on the current block to obtain the first a predicted value.
  • an encoder including:
  • the first determining part is configured to traverse the intra prediction mode, and determine the initial prediction value of the initial prediction block corresponding to the current block;
  • the first filtering part is configured to perform intra-frame prediction filtering and intra-frame prediction smoothing filtering respectively on the initial prediction block to obtain a first-type prediction value and a second-type prediction value; wherein, the intra-frame prediction smoothing filtering process A process of filtering the current block for using a plurality of adjacent reference pixels in each adjacent reference pixel set in at least two adjacent reference pixel sets;
  • the first determining part is further configured to use the initial prediction value, the first type prediction value and the second type prediction value to calculate the rate-distortion cost with the original pixel value of the current block, respectively, and determine the corresponding optimal rate-distortion cost.
  • a first prediction part configured to use the current prediction mode to perform intra prediction on the current block
  • the writing part is configured to write the index information of the current prediction mode and the filtering identification into the code stream, wherein the filtering identification represents the identification corresponding to intra-frame prediction filtering and/or intra-frame prediction smoothing filtering.
  • an embodiment of the present application provides a decoder, including:
  • the parsing part is configured to obtain the code stream, parse the header information of the code stream, and obtain the filtering identifier; and when the filtering identifier is an indication that the intra-frame prediction filtering permission flag is valid, and the intra-frame prediction smoothing filtering permission flag is valid, Obtain at least the current prediction mode and intra-frame prediction filtering use identifier from the code stream;
  • the second prediction part is configured to, based on the current prediction mode, frame the current block when the intra-frame prediction filtering use flag is invalid and a valid intra-frame prediction smoothing filter use flag is obtained from the code stream
  • the intra-prediction smoothing filtering process is performed to obtain the first predicted value.
  • an encoder including:
  • the first memory stores a computer program executable on a first processor, which when executed by the first processor implements the intra prediction method of the encoder.
  • an embodiment of the present application also provides a decoder, including:
  • the second memory stores a computer program executable on a second processor, which when executed by the second processor implements the intra prediction method of the decoder.
  • an embodiment of the present application provides a storage medium, including:
  • a computer program is stored thereon, and when the computer program is executed by the first processor, the intra-frame prediction method of the encoder is realized; or, when the computer program is executed by the second processor, the intra-frame prediction method of the decoder is realized. method of prediction.
  • Embodiments of the present application provide an intra-frame prediction method, an encoder, a decoder, and a storage medium.
  • intra-frame prediction filtering in the encoder, it is possible to use at least two adjacent reference pixel sets in each adjacent reference pixel set. The process of filtering the current block of a neighboring reference pixel.
  • Intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving coding efficiency. .
  • 1A-1C are exemplary distribution diagrams of components in different color formats provided by the embodiments of the present application.
  • FIG. 2 is a schematic diagram of the division of an exemplary coding unit provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an exemplary prediction mode provided by an embodiment of the present application.
  • 4A-4C are schematic diagrams of three filtering situations of exemplary intra-frame prediction filtering provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of the composition and structure of an exemplary network architecture for video encoding and decoding provided by an embodiment of the present application
  • FIG. 6 is a structural diagram of an exemplary video coding system provided by an embodiment of the present application.
  • FIG. 7 is a structural diagram of an exemplary video decoding system provided by an embodiment of the present application.
  • FIG. 8 is a flowchart 1 of an intra-frame prediction method provided by an embodiment of the present application.
  • FIGS. 9A-9C are schematic diagrams of exemplary target reference pixels provided by embodiments of the present application.
  • FIG. 10 is a second flowchart of an intra-frame prediction method provided by an embodiment of the present application.
  • FIG. 11 is a flowchart of an intra-frame prediction method further provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram 1 of an encoder according to an embodiment of the present application.
  • FIG. 13 is a second schematic structural diagram of an encoder according to an embodiment of the application.
  • FIG. 14 is a schematic structural diagram 1 of a decoder according to an embodiment of the present application.
  • FIG. 15 is a second schematic structural diagram of a decoder according to an embodiment of the present application.
  • a first image component, a second image component and a third image component are generally used to represent the current block (Coding Block, CB); wherein, the three image components are a luminance component and a blue chrominance component respectively. and a red chrominance component, specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V; in this way, the video image can use the YCbCr format Representation can also be represented in YUV format.
  • YCbCr YUV
  • YUV ratio is generally measured as 4:2:0, 4:2:2 or 4:4:4
  • Y represents brightness ( Luma)
  • Cb(U) represents blue chromaticity
  • Cr(V) represents red chromaticity
  • U and V represent chromaticity (Chroma) to describe color and saturation.
  • 1A to 1C show the distribution diagrams of each component in different color formats, wherein white is the Y component, and black and gray are the UV components.
  • 4:2:0 means that every 4 pixels has 4 luminance components and 2 chrominance components (YYYYCbCr)
  • 4:2:2 means that every 4 A pixel has 4 luminance components, 4 chrominance components (YYYYCbCrCbCr)
  • 4:4:4 represents a full pixel display (YYYYCbCrCbCrCbCrCbCr).
  • 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 the video coding and decoding technology can eliminate the spatial redundancy between adjacent pixels.
  • Inter-frame prediction can refer to the image information of different frames, and use motion estimation to search for the motion vector information that best matches the current divided block to eliminate temporal redundancy; transformation converts the predicted image block to the frequency domain, redistributes the energy, and combines quantization The information that is not sensitive to the human eye can be removed to eliminate visual redundancy; entropy coding can eliminate character redundancy according to the current context model and the probability information of the binary code stream.
  • the encoder first reads the image information, and divides the image into several coding tree units (Coding Tree Units, CTUs), and a coding tree unit can be further divided into several coding units ( Coding Unit, CU), these coding units can be rectangular blocks or square blocks, and the specific relationship can be referred to as shown in FIG. 2 .
  • CTUs Coding Tree Units
  • CU Coding Unit
  • the current coding unit cannot refer to the information of different frame images, and can only use the adjacent coding units of the same frame image as reference information for prediction, that is, according to most of the current left-to-right, top-to-bottom
  • the current coding unit can refer to the upper left coding unit, the upper coding unit and the left coding unit are used as reference information to predict the current coding unit, and the current coding unit is used as the reference information of the next coding unit. image for prediction.
  • the input digital video is in color format, that is, the input source of the current mainstream digital video encoder is YUV 4:2:0 format, that is, every 4 pixels of the image consists of 4 Y components and 2 UV components.
  • the Y component and UV component will be encoded separately, and the encoding tools and technologies used are slightly different.
  • the decoding end will also decode according to different formats.
  • the current block is mainly predicted with reference to the image information of adjacent blocks of the current frame, the residual information is obtained by calculating the residual between the predicted block and the original image block, and then the process of transformation and quantization is performed.
  • the residual information is transmitted to the decoding end.
  • the decoding end receives and parses the code stream, the residual information is obtained through inverse transformation and inverse quantization, and the reconstructed image block is obtained by superimposing the residual information on the predicted image block predicted by the decoding end.
  • intra prediction usually uses the respective angle mode and non-angle mode to predict the current coding block to obtain the prediction block, and selects the optimal prediction mode for the current coding unit according to the rate-distortion information calculated from the prediction block and the original block. , and then transmit the prediction mode to the decoding end via the code stream.
  • the decoding end parses the prediction mode, predicts the prediction image of the current decoding block, and superimposes the residual pixels transmitted by the code stream to obtain the reconstructed image.
  • the H.264/AVC standard has only 8 angle prediction modes and 1 non-angle prediction mode; H.265/HEVC is extended to 33 angle prediction modes and 2 non-angle prediction modes; and the latest general video coding standard H .266/VVC adopts 67 prediction modes, among which 2 non-angle prediction modes are reserved, and the angle mode is expanded from 33 kinds of H.265 to 65 kinds.
  • the intra-frame prediction will be more accurate, and it will be more in line with the needs of the current society for the development of high-definition and ultra-high-definition video.
  • the domestic digital audio and video coding standard 3 (Audio Video coding Standard, AVS3) also continues to expand the angle mode and non-angle mode.
  • AVS3 Analog Video coding Standard
  • IPF Intra Prediction Filter
  • the intra prediction filtering technology points out that not all reference pixels are used in the current intra-frame angle prediction, and it is easy to ignore some pixels and
  • the correlation between the current coding units, the intra-frame prediction filtering technology improves the pixel prediction accuracy through point-to-point filtering, which can effectively enhance the spatial correlation, thereby improving the intra-frame prediction accuracy.
  • the IPF technology takes the prediction mode from upper right to lower left in AVS3 as an example, as shown in FIG. 3 .
  • the direction of the prediction mode is from upper right to lower left, and the generated prediction value of the current coding unit mainly uses the reference pixels of the adjacent blocks in the upper MRB row, that is, the prediction pixels of the current coding unit do not refer to the reconstructed pixels of the adjacent blocks on the left.
  • the current coding unit and the left reconstruction block are in a spatially adjacent relationship. If only the upper MRB pixels are referenced instead of the left URB pixels, the spatial correlation is likely to be lost, resulting in poor prediction effect.
  • the intra-frame prediction filter technology is a filtering method applied to all prediction modes of intra-frame prediction to improve the accuracy of intra-frame prediction.
  • IPF is mainly realized through the following processes:
  • the intra-frame prediction filtering technology judges the current prediction mode of the coding unit and divides it into a horizontal angle prediction mode, a vertical angle prediction mode and a non-angle prediction mode;
  • IPF technology uses different filters to filter input pixels
  • the IPF technology uses different filter coefficients to filter the input pixels
  • the input pixels of the IPF technology are the predicted pixels obtained in each prediction mode, and the output pixels are the final predicted pixels after IPF filtering.
  • the IPF technology has an allowable flag bit ipf_enable_flag (intra-frame prediction filtering permission flag), which is an exemplary, binary variable.
  • a value of '1' indicates that intra-frame prediction filtering can be used; a value of '0' indicates that intra-frame prediction filtering should not be used.
  • the IPF technology also uses the flag ipf_flag (intra-frame prediction filtering use flag), which is an exemplary, binary variable.
  • a value of '1' indicates that intra-frame prediction filtering should be used; a value of '0' indicates that intra-frame prediction filtering should not be used.
  • Predictive filtering if the flag bit ipf_flag does not exist in the code stream, the default value is 0.
  • the IPF technology classifies prediction modes 0, 1 and 2 as non-angle prediction modes, and uses the first three-tap filter to filter the prediction pixels; Mode 50 is classified as a vertical angle-like prediction mode, and the predicted pixels are filtered using the first two-tap filter; The second two-tap filter filters the predicted pixels. in,
  • P'(x, y) is the final prediction value of the pixel located at the position (x, y) of the current chrominance prediction block
  • f(x) and f(y) are the horizontal filtering of the reconstructed pixels with reference to the adjacent blocks on the left, respectively.
  • the coefficient and the vertical filter coefficient of the reconstructed pixel of the adjacent block on the reference upper side, P(-1,y) and P(x,-1) are the reconstructed pixels on the left side of row y and the reconstructed pixels on the upper side of column x, respectively
  • P(x,y) is the original predicted pixel value in the current chrominance component prediction block.
  • the values of x and y do not exceed the range of the width and height of the current coding unit.
  • the values of the above-mentioned horizontal filter coefficients and vertical filter coefficients are related to the size of the current coding unit and the distances from the predicted pixels in the current prediction block to the left reconstructed pixels and the top reconstructed pixels.
  • the above-mentioned horizontal filter coefficients may be divided into different filter coefficient groups according to the size of the current coding unit.
  • Table 1 presents the filter coefficients of the intra-frame prediction filtering technique.
  • FIGS. 4A to 4C show schematic diagrams of three filtering situations of intra-frame prediction filtering, respectively only referring to the upper reference pixels to filter the prediction value in the current coding unit (that is, the upper two-tap filtering in FIG. 4A ); Only the left reference pixel is referenced to filter the measurements in the current coding unit pre-filter (ie, the left two-tap filtering of FIG. 4B ); and both the upper and left reference pixels are referenced to the prediction in the current coding unit block values are filtered (ie, three-tap filtering on the upper and left sides of Figure 4C).
  • the IPF technology acts on the intra-frame prediction part of the video coding hybrid framework, and is specifically applied to all prediction modes of intra-frame prediction, acting on both the encoding end and the decoding end.
  • FIG. 5 is a schematic diagram of the composition and structure of the network architecture for video encoding and decoding according to an embodiment of the present application, as shown in FIG. 5 .
  • the network architecture includes one or more electronic devices 12 to 1N and a communication network 01 , wherein the electronic devices 12 to 1N can perform video interaction through the communication network 01 .
  • the electronic device can be various types of devices with video codec functions, for example, the electronic device can include mobile phones, tablet computers, personal computers, personal digital assistants, navigators, digital phones, video phones, Televisions, sensing devices, servers, etc., are not limited in the embodiments of the present application.
  • the intra-frame prediction apparatus in the embodiment of the present application may be the above-mentioned electronic device.
  • the electronic device in the embodiments of the present application has a video encoding and decoding function, and generally includes a video encoder (ie, encoder) and a video decoder (ie, decoder).
  • a video encoder ie, encoder
  • a video decoder ie, decoder
  • the video coding system 11 includes:
  • CTU Coding Tree Unit
  • inter prediction unit 115 is used to perform inter prediction encoding of the received video reconstruction block relative to one or more blocks in one or more reference frames to provide temporal Prediction information; where, motion estimation is the process of generating a motion vector that can estimate the motion of the video reconstruction block, and then motion compensation is performed based on the motion vector determined by motion estimation; After the mode, the inter prediction unit 115 is also used to provide the selected inter prediction data to the encoding unit 119, and also send the calculated motion vector data to the encoding unit 119; in addition, the inverse quantization unit 116 and the inverse The transform unit 117 is used for the reconstruction of the video reconstruction block, reconstructing the residual block in the pixel domain, the reconstructed residual block is passed through the loop filtering unit 118 to remove the blocking artifacts, and then, the reconstructed residual block is A predictive block added to the frame of the decoded image buffer unit 110 to generate a reconstructed video reconstruction block; the encoding unit 119 is used to encode
  • the decoded image buffer unit 110 is used for storing reconstructed video reconstruction blocks for prediction reference. As the video image encoding proceeds, new reconstructed video reconstruction blocks are continuously generated, and these reconstructed video reconstruction blocks are all stored in the decoded image buffer unit 110 .
  • FIG. 7 is a schematic structural diagram of a video encoding system according to an embodiment of the present application.
  • the video encoding system 12 includes:
  • the intra-frame prediction first traverses all prediction modes, calculates the predicted pixels under each intra-frame prediction mode, and calculates the rate-distortion cost according to the original pixels;
  • this process opens the IPF technology, first calculates the predicted pixels under each intra-frame prediction mode, and obtains the prediction block of the current coding unit;
  • the IPF current coding unit identification position is no, indicating that the IPF technology is not used, and is also transmitted to the decoding end through the code stream; if the rate-distortion in e) is smaller, then the prediction mode index code recorded in e) is used as the current code.
  • the optimal prediction mode of the unit is transmitted to the decoding end through the code stream, and the current IPF coding unit identification position is true, indicating that the IPF technology is used, and is also transmitted to the decoding end
  • the predicted value is superimposed with the residual information after operations such as transformation and quantization to obtain the reconstructed block of the current coding unit as the reference information of the subsequent coding unit.
  • the decoding end obtains the code stream and parses to obtain the digital video sequence information, and parses to obtain the IPF permission flag of the current video sequence, the coding mode of the current decoding unit is the intra-frame prediction coding mode, and the IPF usage flag of the current decoding unit.
  • the reconstructed block of the current decoding unit is obtained by superimposing the restored residual information of the prediction block, and output after post-processing.
  • the intra-frame prediction filtering technology can effectively improve the coding efficiency of intra-frame prediction, greatly enhance the spatial correlation of intra-frame prediction, and solve the problem of ignoring unused reference pixels in the process of intra-frame prediction. Impact.
  • the intra-frame prediction filtering technology and the current intra-frame prediction mode cannot solve similar problems well, and pixel-by-pixel filtering based on reference pixels can improve the correlation between the prediction block and the reference block.
  • it cannot solve the smoothing problem inside the prediction block. That is to say, a prediction block calculated according to a single prediction mode usually shows a better prediction effect in an image with a clearer texture, and therefore the residual error will be smaller and smaller, and the coding efficiency will be improved.
  • over-sharpened prediction may lead to increased and larger residual errors, poor prediction effect and reduced coding efficiency.
  • the present technology is implemented on the prediction block when performing intra-frame prediction, and for some image blocks that need smoothing processing, the present application proposes an intra-frame prediction method based on the smoothing-processing intra-frame prediction filtering enhancement technology.
  • An intra-frame prediction method provided in this embodiment of the present application mainly acts on the intra-frame prediction unit 114 of the video coding system 11 and the intra-frame prediction unit 123 of the video decoding system 12;
  • the encoding system 11 can obtain a better prediction effect through the intra-frame prediction method provided in the embodiment of the present application, and correspondingly, at the decoding end, the video decoding and restoration quality can also be improved.
  • An embodiment of the present application provides an intra-frame prediction method, which is applied to a video encoding device, that is, an encoder.
  • the functions implemented by the method can be implemented by the processor in the video encoding device calling program codes, and of course the program codes can be stored in a computer storage medium.
  • the video encoding device includes at least a processor and a storage medium.
  • the current coding unit and the current decoding unit are both represented by the current block.
  • FIG. 8 is a schematic flowchart of an implementation of an intra-frame prediction method according to an embodiment of the present application. As shown in FIG. 8 , the method includes:
  • an intra-frame prediction smoothing filtering technology (Intra Prediction Smooth, IPS) is proposed, and on the basis of IPF, the IPS technology can be superimposed to realize intra-frame prediction. That is, when both IPF and IPS are allowed, the intra-frame prediction process on the encoder side is performed.
  • IPS Intra Prediction Smooth
  • a video image may be divided into multiple image blocks, and each image block to be encoded currently may be called an encoding block, wherein each encoding block may include a first image component, a second image component, and a first image component. Three image components; and the current block is the coding block in the video image currently to be predicted for the first image component, the second image component or the third image component.
  • the current block performs the first image component prediction, and the first image component is a luminance component, that is, the image component to be predicted is a luminance component, then the current block may also be called a luminance block; or, it is assumed that the current block performs the second image component prediction prediction, and the second image component is a chrominance component, that is, the image component to be predicted is a chrominance component, then the current block may also be called a chrominance block.
  • the encoder determines the to-be-predicted image component of the current block; based on the parameters of the current block, various prediction modes are used to predict and encode the to-be-predicted image component to obtain an initial predicted value, and then calculate various predictions based on the initial predicted value.
  • the rate-distortion cost corresponding to each prediction mode in the mode select the minimum rate-distortion cost (ie, the first minimum rate-distortion cost) from the multiple calculated rate-distortion costs, and determine the minimum rate-distortion cost as the optimal rate-distortion cost cost, the prediction mode corresponding to the optimal rate-distortion cost is determined as the prediction mode of the current block.
  • the encoder after determining that the encoder traverses all intra-frame prediction modes, determines the initial prediction value of the initial prediction block corresponding to the current block, and then uses the IPF and IPS technologies to filter the current block, the first block is obtained.
  • the first-class predicted value and the second-class predicted value, the initial predicted value, the first-class predicted value and the second-class predicted value are used to calculate the rate-distortion cost with the original pixel value of the current block respectively, and the three corresponding minimum values are determined.
  • the prediction mode corresponding to changing the optimal rate-distortion cost is the current prediction mode.
  • intra-frame prediction is performed on the current block to complete the prediction of the image component to be predicted.
  • intra prediction smoothing filtering is a process of filtering the current block by using multiple adjacent reference pixels in each adjacent reference pixel set in at least two adjacent reference pixel sets.
  • Intra-frame prediction filtering is a process of filtering the current block by using one adjacent reference pixel in each adjacent reference pixel set in at least two adjacent reference pixel sets.
  • Intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving coding efficiency. .
  • the encoder adopts IPF and IPS technology, and after filtering the current block, the process of obtaining the first type of prediction value and the second type of prediction value: one is to obtain the initial prediction block corresponding to the current block.
  • the initial prediction block is processed by IPF and IPS respectively; the other is that the encoder traverses all intra prediction modes again, and only calculates the initial prediction block in each intra prediction mode when IPF is turned on. , and then perform IPF filtering on the initial prediction block to determine the first type of prediction value.
  • the encoder traverses all intra-frame prediction modes again, and only calculates the initial prediction block in each intra-frame prediction mode when IPS is turned on, and then performs IPS filtering on the initial prediction block to determine the second type of prediction value.
  • the application examples are not limited.
  • the encoder performs intra-frame prediction filtering and intra-frame prediction smoothing filtering on the initial prediction block respectively, and the process of obtaining the first type prediction value and the second type prediction value may be: The left adjacent reference pixel point and the upper adjacent reference pixel point of each pixel in the prediction block, perform intra-frame prediction filtering on each pixel of the initial prediction block to obtain the first type of prediction value; and the encoder is based on the initial prediction value. According to the preset horizontal distance and the preset vertical distance corresponding to each pixel in the prediction block, the initial prediction block is subjected to intra-frame prediction smoothing filtering processing to obtain the second type of prediction value.
  • the encoder performs IPF filtering on the prediction block of the current block, selects the corresponding filter according to the currently traversed prediction mode, and selects the corresponding filter coefficient group according to the size of the current block.
  • Table 1 after the filter coefficient is determined, the prediction block is filtered based on the filter coefficient to obtain the rate-distortion cost of each prediction mode, and the smallest one is the second minimum rate-distortion cost.
  • the encoder may determine, based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the initial prediction block, at least two phases corresponding to each pixel. At least two adjacent reference block ranges of the adjacent reference pixel set; from the at least two adjacent reference pixel sets, correspondingly determine at least two target reference pixel sets belonging to the at least two adjacent reference block ranges; wherein, each The target reference pixel sets include at least one target reference pixel; based on the at least two target reference pixel sets, intra-frame prediction smoothing filtering is performed on each pixel to obtain a second-type prediction value.
  • the process of the encoder correspondingly determining at least two target reference pixel sets belonging to the at least two adjacent reference pixel sets from the at least two adjacent reference pixel sets may be:
  • Manner 1 The encoder determines, from at least two adjacent reference pixel sets, pixels at two boundary pixel positions of each adjacent reference block range as a target reference pixel set, thereby determining at least two target reference pixel sets.
  • Mode 2 The encoder determines, from at least two adjacent reference pixel sets, M pixels at any pixel position within the range of each adjacent reference block as a target reference pixel set, thereby determining at least two target reference pixel sets , where M is greater than 0 and does not exceed the maximum number of pixels in the corresponding adjacent reference pixel set.
  • the at least two adjacent reference pixel sets include: a left adjacent reference pixel set and an upper adjacent reference pixel set;
  • the at least two adjacent reference block ranges include: a left adjacent reference pixel set A pixel range and an upper adjacent reference pixel range;
  • the at least two target reference pixel sets include: a left target adjacent reference pixel set and an upper target adjacent reference pixel set.
  • the at least two adjacent reference pixel sets include: when the left adjacent reference pixel set and the upper adjacent reference pixel set, the encoder determines the preset horizontal distance and the preset vertical distance corresponding to the current pixel to The current pixel of the current block is used as the reference, and the preset horizontal distance is moved left and right to obtain the first horizontal pixel position and the second horizontal pixel position; and the preset vertical distance is moved up and down respectively to obtain the first vertical pixel position and the second vertical pixel position. pixel location. Based on the first horizontal pixel position and the second horizontal pixel position, it is mapped to the upper adjacent reference pixel set, and the first boundary limit and the second boundary limit of the pixel position are determined.
  • the pixel position between is the upper adjacent reference pixel range corresponding to the current pixel corresponding to the upper adjacent reference pixel set. Based on the first vertical pixel position and the second vertical pixel position, it is mapped to the left adjacent reference pixel set. , the third boundary limit and the fourth boundary limit of the pixel position are determined, and the pixel position between the third boundary limit and the fourth boundary limit is the left adjacent reference pixel set corresponding to the current pixel corresponding to the left adjacent pixel set Reference pixel range, so that at least two adjacent reference block ranges are obtained. For each adjacent reference pixel set, the encoder may select at least one adjacent reference pixel (ie, the target reference pixel set) from the reference pixels included in the corresponding adjacent reference pixel range for performing intra prediction, thereby At least two target reference pixel sets are selected.
  • the encoder may select at least one adjacent reference pixel (ie, the target reference pixel set) from the reference pixels included in the corresponding adjacent reference pixel range for performing intra prediction, thereby At least two target reference pixel sets are
  • the encoder does this for each pixel of the current block, so as to complete the processing of the current block, and for the current pixel, the encoder selects a target reference pixel set for an adjacent reference pixel set
  • the number of reference pixels can be one or more, which is determined based on the position of the current pixel in the current block.
  • the encoder can select the reference pixel value corresponding to the boundary position of each adjacent reference pixel range to form the target reference pixel set, or can select any M reference pixels from each adjacent reference pixel range to form the target reference pixel.
  • the corresponding determined number of M reference pixels may be different or may be the same, which is not limited in this embodiment of the present application.
  • the target reference pixel set corresponding to the upper adjacent reference pixel set may be UPNum
  • the target reference pixel set corresponding to the left adjacent reference pixel set may be LFNum
  • UPNum and LFNum may be the same or different.
  • the preset horizontal distance is less than or equal to the width of the initial prediction block; the preset vertical distance is less than or equal to the height of the initial prediction block.
  • the preset horizontal distance and the preset vertical distance corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are different from those of other types except n rows and m columns of the initial prediction block.
  • the preset horizontal distance and the preset vertical distance corresponding to the pixels are different; n and m are natural numbers; the preset horizontal distance and the preset vertical distance corresponding to each pixel in the first type of pixels are at least partially the same, or both are different; other The preset horizontal distance and the preset vertical distance corresponding to each pixel in the class of pixels are at least partially the same, or both are different.
  • the preset horizontal distance and the preset vertical distance are equal, and the specific values can be set in the encoder and decoder according to the actual situation, or can be preset in the encoder and decoder according to the size of the current prediction block.
  • the embodiments of the present application are not limited.
  • the n rows and m columns of the initial prediction block may be the first n rows and the first m columns, or may be in other forms, which are not limited in the embodiments of the present application.
  • the above-mentioned IPS technology may have different filtering processes for the first n rows and the first m columns of the initial prediction block.
  • the first n rows and the first m columns may use the reference pixels corresponding to the first positional relationship
  • other non-first n rows and m columns may use the reference pixels corresponding to the first positional relationship.
  • the reference pixels corresponding to the second positional relationship may be used for the filtering of the predicted pixels of the row and the first m columns.
  • the first three rows and the first three columns use the same HD and VD, which is 1, while the first three rows and the first three columns use the same HD and VD, which is 2.
  • n and m do not exceed the size of the current block, and n and m may be the same or different, which are not limited in this embodiment of the present application.
  • the encoder may determine filter coefficients according to the principle mechanism of IPF; based on at least two target reference pixel sets and filter coefficients, perform intra-frame prediction smoothing filtering on each pixel to obtain the second type Predictive value.
  • the filter coefficients corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are different from the filter coefficients corresponding to other types of pixels except n rows and m columns of the initial prediction block; n and m are natural numbers;
  • the filter coefficients corresponding to each pixel in one type of pixels are at least partially the same, or all different; the filter coefficients corresponding to each pixel in other types of pixels are at least partially the same, or all different.
  • the IPS technology may have multiple different filter coefficients, for example, the coefficients used by the current predicted pixel in the first n rows and the first m columns are different from the filter coefficients used in the non-first n rows and non-first m columns, etc. , and the filter coefficients corresponding to each pixel in the first n rows and the first m columns may also be the same, partly the same, or all different; the filter coefficients corresponding to each pixel in the non-first n rows and non-first m columns It can also be the same, partially the same, or all different.
  • the encoder may determine a weight coefficient; based on at least two target reference pixel sets and the weight coefficient, weighted summation is performed on each pixel to complete intra-frame prediction After smoothing and filtering, the second type of predicted value is obtained.
  • the IPS technology can have multiple different weight coefficients, such as the coefficients used by the current predicted pixel in the first n rows and the first m columns are different from the weight coefficients used in the non-first n rows and non-first m columns, etc., and,
  • the weight coefficients corresponding to each pixel in the first n rows and the first m columns can also be the same, partially the same, or different; the weight coefficients corresponding to each pixel in the non-first n rows and non-first m columns are also Can be the same, partially the same, or all different.
  • the encoder uses the position of the current predicted pixel as a reference, and uses the horizontal distance HD and vertical distance VD as offsets to obtain UPNum reconstruction reference pixels adjacent to the upper side and LFNum reconstruction reference pixels on the left side, and obtain The reference pixel and the current predicted pixel are filtered, or the weighted summation can be used to obtain the accurate predicted pixel as the final predicted pixel of the current position in the predicted block.
  • a is the current pixel
  • b and c are the adjacent reference pixel ranges
  • the encoder obtains 4 reference pixels and predicted pixels.
  • a 5-tap filter or weighting is formed to obtain the accurately corrected predicted pixel value.
  • the coefficients of the first two rows and the first two columns of the four reference pixels can be set to be 10.
  • the weighting coefficient of the predicted pixels is 216, and the sum needs to be divided by 256 or shifted to the right by 8 bits, and the VD and HD of the first two rows and columns can be set to 1; set 4 reference pixels not the first two rows
  • the weighting coefficients of the first two columns and the non-corrected ones are both 13, and the uncorrected predicted pixel coefficient is 204, and the sum needs to be divided by 256 or shifted to the right by 8 bits.
  • a schematic diagram of 4 target reference pixels with a distance of 1 a is the current pixel, b and c are the adjacent reference pixel ranges, and the encoder obtains 4 reference pixels and predicted pixels to form a 5-tap Filter or weight to obtain the accurately corrected predicted pixel value.
  • the weighting coefficient of the 4 reference pixels can be set to be 7, and the weighting coefficient of the imprecisely corrected predicted pixel is 228. The sum of Divide by 256 or shift right by 8 bits.
  • a is the current pixel
  • b and c are the adjacent reference pixel ranges
  • the encoder obtains two reference pixels and predicted pixels to form a 3-tap Filter or weight to obtain the accurately corrected predicted pixel value.
  • the weighting coefficient of the two reference pixels can be set to be 14, and the weighting coefficient of the uncorrected predicted pixel is 228. The sum of Divide by 256 or shift right by 8 bits.
  • the predicted pixels obtained by the encoder performing the IPS technology may be different from other cases, for example, the second type of prediction of the predicted pixels used by the IPS is obtained by using 4-tap different filter coefficients or different filter coefficients of other taps. value etc.
  • the encoder uses IPS technology to filter the current block
  • the reconstructed reference pixels need to be acquired, that is, the coordinates of the reference pixels in the target reference pixel set exceed the upper adjacent reference pixel set or the left side
  • the size range of the adjacent reference pixel set can also be filled with the adjacent reference pixel set of the current block, and then the target reference pixel set is selected.
  • the encoder uses the leftmost reference pixel in the upper adjacent reference pixel set to pad to the left until the upper phase is determined. until the first boundary of the range of adjacent reference blocks, and/or, using the rightmost reference pixel in the set of adjacent reference pixels on the upper side to fill to the right, until the second boundary of the range of adjacent reference blocks on the upper side is determined.
  • the preset vertical distance is less than or equal to the height of the initial prediction block
  • the lowermost reference pixel in the set of adjacent reference pixels on the left side is used to fill down until the third boundary limit of the range of the adjacent reference block on the left side is determined. and/or, the uppermost reference pixel in the set of adjacent reference pixels on the left side is used to fill upwards until the fourth boundary limit of the range of the adjacent reference block on the left side is determined.
  • the encoder fills the leftmost reconstruction reference pixel with the uppermost adjacent reconstructed pixel to the left until the required range is satisfied, and uses the rightmost reconstruction reference pixel of the upper adjacent reconstruction pixel to fill to the right until the requirement is met.
  • the requested range use the reconstructed reference pixel on the uppermost side of the adjacent reconstructed pixels on the left to fill up until the required range is satisfied, and use the adjacent reconstructed pixels on the left to fill down until the required range is satisfied.
  • the above filling process can also be replaced by a conditional judgment method, and the pixels beyond the range can directly request the pixels at the most boundary, etc., which are not limited in this embodiment of the present application.
  • the encoder performs IPS filtering on the prediction block of the current block, selects the corresponding filter according to the currently traversed prediction mode, determines the filter coefficient, and filters the prediction block based on the filter coefficient to obtain each filter coefficient.
  • the rate-distortion cost of a prediction mode, and the smallest one is selected to be the third smallest rate-distortion cost.
  • the encoder after the encoder obtains the predicted value of the first type and the predicted value of the second type, the encoder adopts the initial predicted value, the predicted value of the first type and the predicted value of the second type, which are respectively the same as the current predicted value.
  • the original pixel value of the block is subjected to rate-distortion cost calculation, and the first minimum rate-distortion cost corresponding to the initial prediction value, the second minimum rate-distortion cost corresponding to the first type of prediction value, and the first minimum rate-distortion cost corresponding to the second type of prediction value are determined.
  • Three minimum rate-distortion costs determine the minimum optimal rate-distortion cost from the first minimum rate-distortion cost, the second minimum rate-distortion cost and the third minimum rate-distortion cost; take the prediction mode corresponding to the obtained optimal rate-distortion cost as Current forecast mode.
  • the encoder can use the current prediction mode to perform intra-frame prediction on the current block, and write the index information of the current prediction mode and the filter flag into the code stream, where the filter flag represents intra-frame prediction filtering and/or intra-frame prediction Predictive smoothing filter corresponding flag.
  • the filtering flags include: an intra-frame prediction filtering permission flag, an intra-frame prediction filtering use flag, an intra-frame prediction smoothing filtering permission flag, and an intra-frame prediction smoothing filtering use flag.
  • the encoder determines that the intra-frame prediction filtering permission flag is valid, and the intra-frame prediction smoothing filtering permission flag is valid, and sets the intra-frame prediction filtering permission flag to be valid. Allows markers and intra-frame prediction smoothing filtering to allow markers to be written into the stream;
  • the transmission of the intra-frame prediction filtering use flag and the intra-frame prediction smoothing filter use flag follows one of the following transmission modes to the decoder:
  • the optimal rate-distortion cost is the second minimum rate-distortion cost, determine that the intra-frame prediction filtering use flag is valid, and write the intra-frame prediction filtering use flag into the code stream;
  • the optimal rate-distortion cost is the third minimum rate-distortion cost
  • the optimal rate-distortion cost is the first minimum rate-distortion cost
  • a binary number may be used to indicate whether it is valid, for example, 1 indicates valid, 0 indicates invalid, or 0 indicates valid, 1 indicates invalid, etc.
  • the specific setting method and setting value are not limited in this embodiment of the present application.
  • the encoder implements the process of filtering the current block by using one adjacent reference pixel in each adjacent reference pixel set in at least two adjacent reference pixel sets by using intra-frame prediction filtering.
  • Intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving coding efficiency. .
  • the filtering identifiers of the s are the same identifier, or use one-to-one corresponding identifiers.
  • the IPS technology is applicable to each encoding channel, wherein the luminance component and the chrominance component respectively use independent identification bits to indicate whether the IPS technology is used or not.
  • the encoder when the encoder uses one filter flag for three coding channels, it can save bits and data amount of transmitted flag bits, and reduce the computational complexity.
  • the encoder may first determine the current block to see if it meets the conditions for IPS processing.
  • the intra-frame prediction method proposed in this application is adopted. in,
  • the initial prediction block is divided to obtain prediction sub-blocks that meet the prediction area threshold range; the intra-frame prediction processing flow is implemented for the prediction sub-block.
  • the range of the predicted area threshold can be no less than 4 ⁇ 4 or 8 ⁇ 8, and no more than 64 ⁇ 64 or 32 ⁇ 32, and the detailed value can be set according to the actual situation. If the area is too small, IPS processing can not be performed, but if the area is too large, it can be divided to meet the conditions for using IPS before processing.
  • the encoder limits the use range of the IPS, and does not use the IPS technology for the unit with a small prediction block area, so as to reduce the transmission identification bits and reduce the computational complexity.
  • the encoder after determining the initial prediction value of the initial prediction block corresponding to the current block, the encoder adopts the current prediction mode, and before performing intra prediction on the current block, the encoder may Type, the prediction mode set is determined, and the prediction mode set is the prediction mode that enables the intra-frame prediction smoothing filtering technology; for the initial prediction value, the initial sub-prediction value predicted by the prediction mode set is used to perform intra-frame prediction smoothing filtering.
  • the second type of prediction value; the initial prediction value and the second type of prediction value are used to calculate the rate-distortion cost with the original pixel value of the current block respectively, and the current prediction mode corresponding to the optimal rate-distortion cost is determined.
  • the encoder limits the scope of use of the IPS, filters the prediction modes of the current block, and only uses the IPS technology for part of the prediction modes, so as to reduce transmission flag bits and reduce computational complexity.
  • the manner in which the encoder obtains the predicted value of the first type and the predicted value of the second type may further include:
  • the encoder After traversing the intra-frame prediction mode and determining the initial prediction value of the initial prediction block corresponding to the current block, the encoder uses the initial prediction value, the first-type prediction value and the second-type prediction value to compare with the original pixel value of the current block respectively. Calculate the rate-distortion cost. Before determining the current prediction mode corresponding to the optimal rate-distortion cost, perform intra-frame prediction filtering on the initial prediction block to obtain the first type of prediction value; traverse the intra-frame prediction mode and use intra-frame prediction smoothing filtering. Perform prediction estimation on the current block to obtain the second type of prediction value.
  • the encoder can traverse the intra prediction mode again, and based on the preset horizontal distance and preset vertical distance corresponding to each pixel in the current block, perform intra prediction smoothing filtering processing on the current block to obtain the second type of prediction value; without filtering the initial predicted value.
  • the implementation principle of the filter processing performed on the current block by the encoder is the same as the principle of filtering the initial prediction block in the foregoing embodiment, and details are not described herein again.
  • the encoder obtains coding information, including intra-frame prediction filtering (IPF) allowable identification bits and the allowable identification bits of this technical solution (IPS), etc., and after obtaining the image information, the image is divided into several CTUs, and further divided into several CTUs.
  • IPF intra-frame prediction filtering
  • IPS technical solution
  • the IPF allowable flag bit and the IPS allowable flag bit are both '1', perform all the following steps; if the IPF allowable flag bit is '1' and the IPS allowable flag bit is '0', Then only a), b), c), d), e), and h) are executed; if the IPF allowable flag is '0' and the IPS allowable flag is '1', only a), b), f), g), and h); if both the IPF allow flag and the IPS allow flag are '0', only a), b) and h) are performed. If the above-mentioned IPF or IPS allows the flag bit to be '0', then the coding end defaults to the use flag bit of the corresponding technology of all coding blocks to be '0':
  • the current coding unit traverses all intra-frame prediction modes, calculates the prediction block under each prediction mode, and calculates the rate-distortion cost information of the current prediction mode according to the original pixel block;
  • this process uses IPF technology, first calculates the predicted pixels under each intra-frame prediction mode, and obtains the prediction block of the current coding unit;
  • this process uses IPS technology, calculates the predicted pixels under each intra-frame prediction mode, and calculates the predicted pixel process using IPS technology, which can be added for several tap interpolation filters.
  • IPS technology calculates the predicted pixels under each intra-frame prediction mode, and calculates the predicted pixel process using IPS technology, which can be added for several tap interpolation filters.
  • Several reference pixels are used as new interpolation filters to predict the predicted pixels of the process.
  • the above-mentioned several tap interpolation filters can be 8 tap filters, and the above-mentioned several reference pixels can be 4.
  • the above-mentioned several reference pixels are obtained.
  • the process is as follows: taking the position of each predicted pixel as a reference, and taking the horizontal distance HD and vertical distance VD as offsets, obtain UPNum reconstruction reference pixels adjacent to the upper side and LFNum reconstruction reference pixels on the left side.
  • the above HD and VD can be 0, 1, 2, 3, ..., N, etc., and N does not exceed the width or height of the current block.
  • the above UPNum and LFNum can be 0, 1, 2, 3, ..., M, etc., and M does not exceed the number of adjacent reconstruction reference pixels on the upper side of the current block and the number of adjacent reconstruction reference pixels on the left side;
  • the IPF allows the identification bit to be '0' and the IPS allows the identification bit to be '0', then transmit the prediction mode index recorded in b) to the decoding end through the code stream; if the IPF allows the identification bit to be '1' and If the IPS allows the flag bit to be '0', compare the minimum cost value recorded in b) with the minimum cost value recorded in e), and if the rate-distortion cost in b) is smaller, compare the prediction recorded in b)
  • the mode index coding is used as the optimal prediction mode of the current coding unit and is transmitted to the decoding end through the code stream, and the IPF current coding unit identification position is '0', indicating that the IPF technology is not used, and is also transmitted to the decoding end through the code stream; if e) in The rate distortion is smaller, then the prediction mode index code recorded in e) is transmitted to the decoding end as the optimal prediction mode of the current coding unit through the code stream, and the IPF current
  • the code stream is transmitted to the decoding end, and the IPF usage flag position of the current coding unit is '0' and the IPS usage flag position is '1', indicating that the IPF technology is not used but the IPS technology is used, and is also transmitted to the decoding end through the code stream.
  • the encoder superimposes the predicted block and the inversely transformed and inversely quantized residuals to obtain a reconstructed coding unit block, which is used as a prediction reference block for the next coding block.
  • An embodiment of the present application provides an intra-frame prediction method, as shown in FIG. 10 , including:
  • S202 Perform intra-frame prediction smoothing filtering processing on the initial prediction block respectively, to obtain a second type of prediction value; wherein, the intra-frame prediction smoothing filtering is performed by using the multi-dimensional data in each adjacent reference pixel set in at least two adjacent reference pixel sets. The process of filtering the current block with adjacent reference pixels.
  • S205 Write the index information of the current prediction mode and the filter flag into the code stream, where the filter flag represents the flag corresponding to the intra-frame prediction smoothing filter.
  • the encoder can only determine whether to perform IPS, and it is not dependent on the implementation of the IPF technology, so that the intra-frame prediction smoothing filtering permission flag is valid.
  • the encoder may only perform IPS, so that when the IPS technology is enabled, the encoder performs intra-frame prediction smoothing filtering on the initial prediction blocks respectively to obtain the second type of prediction value, and the encoder only needs to use the initial prediction block.
  • the predicted value and the second type of predicted value are respectively calculated with the original pixel value of the current block to calculate the rate-distortion cost, and the current prediction mode corresponding to the optimal rate-distortion cost can be determined.
  • the detailed filtering processing method is consistent with the implementation of the foregoing embodiment, and is not repeated here.
  • the filtering flag includes: an intra-frame prediction smoothing filtering permission flag and an intra-frame prediction smoothing filtering use flag.
  • the encoder writes the index information of the current prediction mode into the code stream; determines that the intra-frame prediction smoothing filtering permission flag is valid, and writes the intra-frame prediction smoothing filtering permission flag into the code stream.
  • Intra-frame prediction smoothing filtering uses one of the following transmission modes:
  • the optimal rate-distortion cost is the third minimum rate-distortion cost, it is determined that the intra-frame prediction smoothing filtering use flag is valid, and the intra-frame prediction smoothing filtering use flag is written into the code stream.
  • the optimal rate-distortion cost is the first minimum rate-distortion cost, it is determined that the intra-frame prediction smoothing filtering use flag is invalid, and the intra-frame prediction smoothing filtering use flag is written into the code stream.
  • the encoder obtains coding information, including intra-frame prediction filtering (IPF) allowable identification bits and the allowable identification bits of this technical solution (IPS), etc., and after obtaining the image information, the image is divided into several CTUs, and further divided into several CTUs.
  • IPF intra-frame prediction filtering
  • IPS technical solution
  • the IPF allowable flag bit and the IPS allowable flag bit are both '1', perform all the following steps; if the IPF allowable flag bit is '1' and the IPS allowable flag bit is '0', Then only execute a), b), c), d), e), and i); if the IPF allow flag bit is '0' and the IPS allow flag bit is '1', then only execute a), b), f), g), h), and i); if both the IPF allow flag and the IPS allow flag are '0', only execute a), b) and i). If the above-mentioned IPF or IPS allows the flag bit to be '0', then the coding end defaults to the use flag bit of the corresponding technology of all coding blocks to be '0':
  • the current coding unit traverses all intra-frame prediction modes, calculates the prediction block under each prediction mode, and calculates the rate-distortion cost information of the current prediction mode according to the original pixel block;
  • this process uses IPF technology, first calculates the predicted pixels under each intra-frame prediction mode, and obtains the prediction block of the current coding unit;
  • this process uses IPS technology, first calculates the predicted pixels in each intra-frame prediction mode, and obtains the prediction block of the current coding unit.
  • the interpolation filter for calculating intra-frame predicted pixels in this process may be different from steps a) and c), and a stronger filter can be used to obtain smoother predicted pixels.
  • the specific implementation can be an 8-tap interpolation filter for the angle prediction mode, Exemplarily, the filter coefficients may be shown in the following 4 groups, and each group may include 32 types of 8-tap filter coefficients.
  • the prediction block of the current coding unit is accurately corrected for the predicted pixels, and the accurate correction process can be based on the position where the current predicted pixels are located, and the horizontal distance HD and the vertical distance VD are used as offsets to obtain the adjacent UPNum on the upper side.
  • Reconstruction reference pixels and LFNum reconstruction reference pixels on the left filter the obtained reference pixels and the current prediction pixel, or perform weighted summation to obtain the accurate prediction pixel as the final prediction pixel at the current position in the prediction block.
  • the above HD and VD can be 0, 1, 2, 3, ..., N, etc., and N does not exceed the width or height of the current block.
  • the above UPNum and LFNum can be 0, 1, 2, 3, ..., M, etc., and M does not exceed the number of adjacent reconstruction reference pixels on the upper side of the current block and the number of adjacent reconstruction reference pixels on the left side;
  • the IPF allows the identification bit to be '0' and the IPS allows the identification bit to be '0', then transmit the prediction mode index recorded in b) to the decoding end through the code stream; if the IPF allows the identification bit to be '1' and If the IPS allows the flag bit to be '0', compare the minimum cost value recorded in b) with the minimum cost value recorded in e), and if the rate-distortion cost in b) is smaller, compare the prediction recorded in b)
  • the mode index coding is used as the optimal prediction mode of the current coding unit and is transmitted to the decoding end through the code stream, and the IPF current coding unit identification position is '0', indicating that the IPF technology is not used, and is also transmitted to the decoding end through the code stream; if e) in The rate distortion is smaller, then the prediction mode index code recorded in e) is transmitted to the decoding end as the optimal prediction mode of the current coding unit through the code stream, and the IPF current
  • the stream is transmitted to the decoding end, and the IPF use identification position of the current coding unit is '0' and the IPS use identification position is '1', indicating that the IPF technology is not used but the IPS technology is used, and is also transmitted to the decoding end through the code stream.
  • the encoder superimposes the prediction block and the inversely transformed and inversely quantized residuals to obtain a reconstructed coding unit block, which is used as a prediction reference block for the next coding unit.
  • the encoder adopts intra-frame prediction smoothing filtering technology, which strengthens the spatial correlation of intra-frame prediction, and multiple reference pixels in a neighboring reference pixel set are smoothed and filtered, avoiding the possibility of over-sharp prediction. It will cause the residual error to increase and become larger, the prediction effect is not good, and the coding efficiency is improved.
  • An embodiment of the present application provides an intra-frame prediction method, which is applied to a video decoding device, that is, a decoder.
  • the functions implemented by the method can be implemented by the processor in the video decoding device calling program codes, and of course the program codes can be stored in a computer storage medium.
  • the video encoding device includes at least a processor and a storage medium.
  • FIG. 11 is a schematic flowchart of an implementation of an intra-frame prediction method according to an embodiment of the present application. As shown in FIG. 11 , the method includes:
  • the decoder can parse from the header information of the code stream to determine whether the IPF and IPS processing is performed. That is, the intra-frame prediction filtering permission flag in the filtering flags, and/or the intra-frame prediction smoothing filtering permission flag can be parsed out.
  • the filtering flags are indicative of the Intra prediction filtering permission flag being valid, and the intra prediction smoothing filtering permission flag being valid.
  • the decoder can obtain at least the current prediction mode and the intra-frame prediction filtering use flag from the code stream.
  • the intra-frame prediction filtering use flag is invalid, and the valid intra-frame prediction smoothing filter use flag is obtained from the code stream
  • identifying that is, when the current block adopts the current prediction mode determined by the IPS technology, based on the current prediction mode, perform intra-frame prediction smoothing filtering on the current block to obtain the first prediction value, and then based on the first prediction value.
  • the predicted value goes through the subsequent decoding process.
  • the current prediction mode is obtained from the code stream; based on the current prediction mode, intra prediction filtering is performed on the current block to obtain the second prediction value.
  • the decoder performs intra-frame prediction smoothing filtering processing on the current block based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the current block to obtain the first predicted value.
  • At least two adjacent sets of at least two adjacent reference pixels corresponding to each pixel are determined based on a preset horizontal distance and a preset vertical distance corresponding to each pixel in the current block reference block range;
  • each target reference pixel set includes at least one target reference pixel
  • intra-frame prediction smoothing filtering is performed on each pixel to obtain a first predicted value.
  • the decoder correspondingly determines, from the at least two adjacent reference pixel sets, at least two target reference pixel sets belonging to the range of the at least two adjacent reference blocks, including the following manners :
  • Manner 1 From the at least two adjacent reference pixel sets, determine the pixels at the two boundary pixel positions of each adjacent reference block range as a target reference pixel set, so as to determine the at least two target reference pixels gather.
  • Mode 2 From the at least two adjacent reference pixel sets, determine M pixels at any pixel position within the range of each adjacent reference block as a target reference pixel set, so as to determine the at least two target reference pixel sets. A set of pixels, where M is greater than 0 and does not exceed the maximum number of pixels in the corresponding adjacent reference pixel set.
  • the at least two adjacent reference pixel sets include: a left adjacent reference pixel set and an upper adjacent reference pixel set;
  • the at least two adjacent reference block ranges include: a left adjacent reference pixel range and an upper adjacent reference pixel range;
  • the at least two target reference pixel sets include: a left target adjacent reference pixel set and an upper target adjacent reference pixel set.
  • the preset horizontal distance is less than or equal to the width of the initial prediction block; the preset vertical distance is less than or equal to the height of the initial prediction block;
  • the preset horizontal distance and the preset vertical distance corresponding to each pixel in the first type of pixels are at least partially the same, or both are different;
  • the preset horizontal distance and the preset vertical distance corresponding to each pixel in the other types of pixels are at least partially the same, or both are different.
  • performing an intra-frame prediction smoothing filtering process on each pixel based on at least two target reference pixel sets to obtain a second type of prediction value including: a decoder determining a filter coefficient; and based on at least two The target refers to the set of pixels and filter coefficients, and performs intra-frame prediction smoothing filtering processing on each pixel to obtain the second type of prediction value.
  • the filter coefficients corresponding to the first type of pixels at the positions of n rows and m columns in the initial prediction block are different from the filter coefficients corresponding to other types of pixels except for n rows and m columns in the initial prediction block; n and m are natural numbers;
  • the filter coefficients corresponding to each pixel in the first type of pixels are at least partially the same, or all different;
  • the filter coefficients corresponding to each pixel in the other types of pixels are at least partially the same, or all different.
  • the leftmost reference pixel in the upper adjacent reference pixel set is used to pad to the left until the upper adjacent reference is determined until the first boundary of the block range, and/or, using the rightmost reference pixel in the upper adjacent reference pixel set to fill to the right, until the second boundary of the upper adjacent reference block range is determined;
  • the lowermost reference pixel in the set of adjacent reference pixels on the left side is used to fill down until the third boundary limit of the range of the adjacent reference block on the left side is determined, And/or, the uppermost reference pixel in the set of adjacent reference pixels on the left side is used to fill upwards until the fourth boundary limit of the range of the adjacent reference block on the left side is determined.
  • the decoder obtains the code stream, and parses the code stream to obtain the IPF permission flag and the IPS permission flag of the current video sequence.
  • the allowable flag bit of the IPF and the allowable flag bit of the IPS are both '1', perform all the following steps; if the allowable flag bit of the IPF is '1' and the allowable flag bit of the IPS is ' 0', only perform steps a), b), c), d) and g); if the allowable flag bit of IPF is '0' and the allowable flag bit of IPS is '1', then only a), b ), e), f) and g) steps; if the allowable identification bit of IPF and the allowable identification bit of IPS are both '0', then only steps a), b) and g) are performed. If the above-mentioned IPF or IPS allows the flag bit to be '0', the decoding end defaults to the use flag bit of the corresponding technology of all decoding blocks to be '0':
  • step f obtain the use identification bit of IPF, if the use identification bit of IPF is '1', then skip the remaining process of this step and skip step f); if the use identification bit of IPF is '0', then parse and obtain IPS usage flag. If the use flag bit of IPS is '0', then no additional operation is performed on the current prediction block, and step f) is skipped; if the use flag bit of IPS is '1', then f) is executed;
  • the prediction block of the current coding unit is accurately corrected for the predicted pixels.
  • the accurate correction process can be based on the position where the current predicted pixels are located, and the horizontal distance HD and the vertical distance VD are used as offsets to obtain the adjacent UPNum on the upper side.
  • Reconstruction reference pixels and LFNum reconstruction reference pixels on the left filter the obtained reference pixels and the current prediction pixel, or perform weighted summation to obtain the accurate prediction pixel as the final prediction pixel at the current position in the prediction block.
  • the above HD and VD can be 0, 1, 2, 3, ..., N, etc., and N does not exceed the width or height of the current block.
  • the above UPNum and LFNum can be 0, 1, 2, 3, ..., M, etc., and M does not exceed the number of adjacent reconstruction reference pixels on the upper side of the current block and the number of adjacent reconstruction reference pixels on the left side;
  • step g) superimposing the residual information restored in step a) of the prediction block to obtain the reconstructed block of the current decoding unit, which is output after post-processing.
  • the implementation on the decoder side may also adopt the following implementation manners, which are not limited in this embodiment of the present application. As follows:
  • the decoder obtains the code stream, and parses the code stream to obtain the IPF allowable flag bit and the IPS allowable flag bit of the current video sequence.
  • the allowable flag bit of the IPF and the allowable flag bit of the IPS are both '1', perform all the following steps; if the allowable flag bit of the IPF is '1' and the allowable flag bit of the IPS is ' 0', then only execute steps a), b), and d); if the allowable identification bit of IPF is '0' and the allowable identification bit of IPS is '1', then only steps a), c) and d) are executed ; If the allowable identification bit of IPF and the allowable identification bit of IPS are both '0', then only steps a) and d) are performed. If the above-mentioned IPF or IPS allows the flag bit to be '0', the decoding end defaults to the use flag bit of the corresponding technology of all decoding blocks to be '0':
  • the process can use an interpolation filter that is different from the generation of predicted pixels in steps d) and e), and can use an 8-tap interpolation filter plus use the location of each predicted pixel.
  • interpolation filters for generating predicted pixels, and the specific process of obtaining the above-mentioned several reconstructed reference pixels is: taking the horizontal distance HD and the vertical distance VD as offsets, obtaining the adjacent UPNum on the upper side. Reconstructed reference pixels and left LFNum reconstructed reference pixels.
  • the above HD and VD can be 0, 1, 2, 3, ..., N, etc., and N does not exceed the width or height of the current block.
  • the above UPNum and LFNum can be 0, 1, 2, 3, ..., M, etc., and M does not exceed the number of adjacent reconstruction reference pixels on the upper side of the current block and the number of adjacent reconstruction reference pixels on the left side;
  • step g) superimposing the residual information restored in step a) of the prediction block to obtain the reconstructed block of the current decoding unit, which is output after post-processing.
  • the decoder implements the process of filtering the current block by using one adjacent reference pixel in each adjacent reference pixel set in at least two adjacent reference pixel sets by using intra-frame prediction filtering.
  • intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother and the prediction for blurred images will be more accurate, thereby improving decoding efficiency.
  • an encoder 1 including:
  • the first determination part 10 is configured to traverse the intra prediction mode, and determine the initial prediction value of the initial prediction block corresponding to the current block;
  • the first filtering part 11 is configured to perform intra-frame prediction filtering and intra-frame prediction smoothing filtering respectively on the initial prediction block to obtain a first-type prediction value and a second-type prediction value; wherein, the intra-frame prediction smoothing Filtering is a process of filtering the current block by using a plurality of adjacent reference pixels in each adjacent reference pixel set in at least two adjacent reference pixel sets;
  • the first determining part 10 is further configured to use the initial prediction value, the first type prediction value and the second type prediction value to calculate the rate-distortion cost with the original pixel value of the current block, respectively, to determine the optimal rate-distortion cost. the corresponding current prediction mode;
  • a first prediction part 12 configured to use the current prediction mode to perform intra-frame prediction on the current block
  • the writing part 13 is configured to write the index information of the current prediction mode and the filter flag into the code stream, wherein the filter flag represents the flag corresponding to intra-frame prediction filtering and/or intra-frame prediction smoothing filtering.
  • the first filtering part 11 is further configured to, based on the adjacent reference pixels on the left and the adjacent reference pixels on the upper side of each pixel in the initial prediction block, filter Perform intra-frame prediction filtering on each pixel of the initial prediction block to obtain the first type of prediction value; and based on the preset horizontal distance and preset vertical distance corresponding to each pixel in the initial prediction block, determine the The initial prediction block is subjected to intra-frame prediction smoothing filtering to obtain the second type of prediction value.
  • the first filtering part 11 is further configured to, based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the initial prediction block, determine the at least two adjacent reference block ranges of at least two adjacent reference pixel sets corresponding to each pixel; from the at least two adjacent reference pixel sets, correspondingly determined to belong to the at least two adjacent reference pixel sets At least two target reference pixel sets within the block range; wherein, each target reference pixel set includes at least one target reference pixel; based on the at least two target reference pixel sets, intra prediction smoothing is performed on each pixel filtering to obtain the predicted value of the second type.
  • the first filtering part 11 is further configured to determine, from the at least two adjacent reference pixel sets, pixels at two boundary pixel positions of each adjacent reference block range is one target reference pixel set, thereby determining the at least two target reference pixel sets.
  • the first filtering part 11 is further configured to determine, from the at least two adjacent reference pixel sets, M arbitrary pixel positions within the range of each adjacent reference block The pixel is one target reference pixel set, so that the at least two target reference pixel sets are determined, wherein M is greater than 0 and does not exceed the maximum number of pixels of the corresponding adjacent reference pixel sets.
  • the at least two adjacent reference pixel sets include: a left adjacent reference pixel set and an upper adjacent reference pixel set;
  • the at least two adjacent reference block ranges include: a left adjacent reference pixel range and an upper adjacent reference pixel range;
  • the at least two target reference pixel sets include: a left target adjacent reference pixel set and an upper target adjacent reference pixel set.
  • the preset horizontal distance is less than or equal to the width of the initial prediction block; the preset vertical distance is less than or equal to the height of the initial prediction block;
  • the preset horizontal distance and the preset vertical distance corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are the same as those corresponding to other types of pixels except n rows and m columns of the initial prediction block.
  • the preset horizontal distance is different from the preset vertical distance; n and m are natural numbers;
  • the preset horizontal distance corresponding to each pixel in the first type of pixels is at least partially the same as the preset vertical distance, or both are different;
  • the preset horizontal distance and the preset vertical distance corresponding to each of the other types of pixels are at least partially the same, or both are different.
  • the first filtering part 11 is further configured to determine a filter coefficient; based on the at least two target reference pixel sets and the filter coefficient, perform intra-frame filtering on each pixel A prediction smoothing filtering process is performed to obtain the second type of prediction value.
  • the filter coefficients corresponding to the first type of pixels in the positions of n rows and m columns of the initial prediction block are corresponding to other types of pixels except for n rows and m columns of the initial prediction block.
  • Different filter coefficients; n and m are natural numbers;
  • the filter coefficients corresponding to each pixel in the first type of pixels are at least partially the same, or all different;
  • the filter coefficients corresponding to each pixel in the other types of pixels are at least partially the same, or all different.
  • the first determining part 10 is further configured to use the initial prediction value, the first type prediction value and the second type prediction value to perform rate-distortion costing on the original pixel values of the current block, respectively.
  • the filtering flags include: intra-frame prediction filtering permission flags, intra-frame prediction filtering use flags, intra-frame prediction smoothing filtering permission flags, and intra-frame prediction smoothing filtering use flags;
  • the writing part 13 is further configured to write the index information of the current prediction mode into the code stream; determine that the intra-frame prediction filtering permission flag is valid, and the intra-frame prediction smoothing filtering permission flag is valid, and writing the intra-frame prediction filtering permission flag and the intra-frame prediction smoothing filtering permission flag into the code stream;
  • the optimal rate-distortion cost is the second minimum rate-distortion cost, determining that the intra-frame prediction filtering use flag is valid, and writing the intra-frame prediction filtering use flag into the code stream;
  • the optimal rate-distortion cost is the third minimum rate-distortion cost
  • the prediction filtering uses the flag and the intra-frame prediction smoothing filtering uses the flag to write the code stream;
  • the optimal rate-distortion cost is the first minimum rate-distortion cost
  • the predictive filtering uses the flag and the intra prediction smoothing filtering uses the flag to write the code stream.
  • the first filtering part 11 is further configured to traverse the intra-frame prediction mode, and after determining the initial prediction value of the initial prediction block corresponding to the current block, use the current block Prediction mode, before performing intra-frame prediction on the current block, perform intra-frame prediction smoothing filtering processing on the initial prediction block respectively, to obtain the second type of prediction value; wherein, the intra-frame prediction smoothing filter adopts at least two A process of filtering the current block for multiple adjacent reference pixels in each adjacent reference pixel set in the adjacent reference pixel set;
  • the first determining part 10 is further configured to use the initial predicted value and the second type of predicted value to perform rate-distortion cost calculation with the original pixel value of the current block, respectively, to determine the rate-distortion cost corresponding to the optimal rate-distortion cost. the current prediction mode.
  • the first filtering part 11 is further configured to traverse the intra-frame prediction mode, and after determining the initial prediction value of the initial prediction block corresponding to the current block, use the current block prediction mode, before performing intra prediction on the current block, determine a prediction mode set according to the type of intra prediction mode, and the prediction mode set is a prediction mode enabling intra prediction smoothing filtering technology; for the initial prediction In the value, the initial sub-prediction value predicted by the prediction mode set is used to perform intra-frame prediction smoothing filtering processing to obtain the second type of prediction value;
  • the first determining part 10 is further configured to use the initial predicted value and the second type of predicted value to perform rate-distortion cost calculation with the original pixel value of the current block, respectively, to determine the rate-distortion cost corresponding to the optimal rate-distortion cost. the current prediction mode.
  • the filtering flags include: an intra-frame prediction smoothing filtering permission flag and an intra-frame prediction smoothing filtering use flag;
  • the writing part 13 is further configured to write the index information of the current prediction mode into the code stream; determine that the intra-frame prediction smoothing filtering permission flag is valid, and write the intra-frame prediction smoothing filtering permission flag incoming code stream;
  • the optimal rate-distortion cost is the third minimum rate-distortion cost, it is determined that the intra-frame prediction smoothing filter usage flag is valid, and the intra-frame prediction smoothing filter usage flag is written into the code stream.
  • the optimal rate-distortion cost is the first minimum rate-distortion cost, it is determined that the intra-frame prediction smoothing filter usage flag is invalid, and the intra-frame prediction smoothing filter usage flag is written into the code stream.
  • the encoding type of the initial prediction value corresponds to multiple encoding channels
  • the filtering identifiers corresponding to each encoding channel use the same identifier, or use one-to-one corresponding identifiers.
  • the first filtering part 11 is further configured to allow the use of intra-frame prediction smoothing to perform filtering when the size of the initial prediction block satisfies the prediction area threshold range; When the size is greater than the upper limit of the prediction area threshold range, the initial prediction block is divided to obtain prediction sub-blocks satisfying the prediction area threshold range; the intra prediction processing flow is implemented for the prediction sub-block.
  • the first filtering part 11 is further configured to traverse the intra-frame prediction mode, and after determining the initial prediction value of the initial prediction block corresponding to the current block, use the initial prediction value , the first type of prediction value and the second type of prediction value, respectively carry out rate-distortion cost calculation with the original pixel value of the current block, and before determining the current prediction mode corresponding to the optimal rate-distortion cost, the initial prediction block is respectively framed
  • the intra-prediction filtering is performed to obtain the first type of prediction value; the intra-frame prediction mode is traversed, and the intra-frame prediction smoothing filtering process is used to predict and estimate the current block to obtain the second type of prediction value.
  • the first filtering part 11 is further configured to traverse the intra prediction mode, and based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the current block, The current block is subjected to intra-frame prediction smoothing filtering to obtain the second type of prediction value.
  • the first determining part 10 is further configured to, when the preset horizontal distance is greater than the width of the initial prediction block, use the leftmost reference pixel set in the upper adjacent reference pixel set
  • the reference pixels on the upper side are filled to the left until the first boundary limit of the range of the upper adjacent reference block is determined, and/or, the rightmost reference pixel in the upper adjacent reference pixel set is used to fill to the right , until the second boundary limit of the upper adjacent reference block range is determined;
  • the lowermost reference pixel in the set of adjacent reference pixels on the left side is used to fill down, until the range of the adjacent reference block on the left side is determined. Until the third boundary limit, and/or, use the uppermost reference pixel in the left adjacent reference pixel set to fill upwards until the fourth boundary limit of the left adjacent reference block range is determined.
  • the encoder implements the process of filtering the current block by using one adjacent reference pixel in each adjacent reference pixel set in at least two adjacent reference pixel sets by using intra-frame prediction filtering.
  • Intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving coding efficiency. .
  • an encoder including:
  • the first memory 15 stores a computer program that can be run on the first processor 14 , and the first processor 14 executes the program for an intra-frame prediction method on the encoder side.
  • an embodiment of the present application provides a decoder 2, including:
  • the parsing part 20 is configured to obtain the code stream, parse the header information of the code stream, and obtain the filtering identification; and when the filtering identification indicates that the intra-frame prediction filtering permission flag is valid, and the intra-frame prediction smoothing filtering permission flag is valid , at least obtain the current prediction mode and intra prediction filtering use identifier from the code stream;
  • the second prediction part 21 is configured to, based on the current prediction mode, perform a prediction on the current block when the intra-frame prediction filtering use flag is invalid and a valid intra-frame prediction smoothing filter use flag is obtained from the code stream.
  • the intra-frame prediction is smoothed and filtered to obtain the first predicted value.
  • the parsing part 20 is further configured to at least acquire the current prediction mode and the intra-frame prediction filtering use flag from the code stream, when the intra-frame prediction filtering use flag is valid When , obtain the current prediction mode from the code stream;
  • the second prediction part 21 is further configured to perform intra-frame prediction filtering processing on the current block based on the current prediction mode to obtain a second prediction value.
  • the second prediction part 21 is further configured to frame the current block based on a preset horizontal distance and a preset vertical distance corresponding to each pixel in the current block
  • the intra-prediction smoothing filtering process is performed to obtain the first predicted value.
  • the second prediction part 21 is further configured to, based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the current block, determine a at least two adjacent reference block ranges of at least two adjacent reference pixel sets corresponding to each pixel;
  • each target reference pixel set includes at least one target reference pixel
  • intra-frame prediction smoothing filtering is performed on each pixel to obtain the first predicted value.
  • the second prediction part 21 is further configured to determine, from the at least two adjacent reference pixel sets, pixels at two boundary pixel positions of each adjacent reference block range is one target reference pixel set, thereby determining the at least two target reference pixel sets.
  • the second prediction part 21 is further configured to determine, from the at least two adjacent reference pixel sets, M arbitrary pixel positions within the range of each adjacent reference block The pixel is one target reference pixel set, so that the at least two target reference pixel sets are determined, wherein M is greater than 0 and does not exceed the maximum number of pixels of the corresponding adjacent reference pixel sets.
  • the at least two adjacent reference pixel sets include: a left adjacent reference pixel set and an upper adjacent reference pixel set;
  • the at least two adjacent reference block ranges include: a left adjacent reference pixel range and an upper adjacent reference pixel range;
  • the at least two target reference pixel sets include: a left target adjacent reference pixel set and an upper target adjacent reference pixel set.
  • the preset horizontal distance is less than or equal to the width of the initial prediction block; the preset vertical distance is less than or equal to the height of the initial prediction block;
  • the preset horizontal distance and the preset vertical distance corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are the same as those corresponding to other types of pixels except n rows and m columns of the initial prediction block.
  • the preset horizontal distance is different from the preset vertical distance; n and m are natural numbers;
  • the preset horizontal distance corresponding to each pixel in the first type of pixels is at least partially the same as the preset vertical distance, or both are different;
  • the preset horizontal distance and the preset vertical distance corresponding to each of the other types of pixels are at least partially the same, or both are different.
  • the second prediction part 21 is further configured to determine filter coefficients; based on the at least two target reference pixel sets and the filter coefficients, perform intra-frame performance on each pixel A prediction smoothing filtering process is performed to obtain the second type of prediction value.
  • the filter coefficients corresponding to the first type of pixels in the positions of n rows and m columns of the initial prediction block are corresponding to other types of pixels except for n rows and m columns of the initial prediction block.
  • Different filter coefficients; n and m are natural numbers;
  • the filter coefficients corresponding to each pixel in the first type of pixels are at least partially the same, or all different;
  • the filter coefficients corresponding to each pixel in the other types of pixels are at least partially the same, or all different.
  • the leftmost reference pixel in the set of adjacent reference pixels on the upper side is used to pad to the left, until it is determined that the upper until the first boundary of the range of the adjacent reference blocks on the side, and/or, use the rightmost reference pixel in the set of adjacent reference pixels on the upper side to fill to the right, until the range of the adjacent reference blocks on the upper side is determined. until the second boundary;
  • the lowermost reference pixel in the set of adjacent reference pixels on the left side is used to fill down, until the range of the adjacent reference block on the left side is determined. Until the third boundary limit, and/or, use the uppermost reference pixel in the left adjacent reference pixel set to fill upwards until the fourth boundary limit of the left adjacent reference block range is determined.
  • the decoder implements the process of filtering the current block by using one adjacent reference pixel in each adjacent reference pixel set in at least two adjacent reference pixel sets by using intra-frame prediction filtering.
  • intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in a set of adjacent reference pixels, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving decoding efficiency.
  • an embodiment of the present application further provides a decoder, including:
  • the second memory 22 stores a computer program that can be executed on the second processor 23, and the second processor 23 implements the intra-frame prediction method on the decoder side when executing the program.
  • an embodiment of the present application provides a storage medium on which a computer program is stored.
  • the computer program is executed by the first processor, an intra-frame prediction method of the encoder is implemented; or, the computer program is processed by the second processor.
  • the decoder executes, implements the decoder's intra prediction method.
  • Intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving coding efficiency.

Landscapes

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

Abstract

Embodiments of the present application provide an intra prediction method, an encoder, a decoder, and a storage medium, comprising: traversing intra prediction modes to determine an initial prediction value of an initial prediction block corresponding to a current block; performing intra prediction filtering and intra prediction smooth filtering respectively on the initial prediction block to obtain a first-type prediction value and a second-type prediction value, wherein the intra prediction smooth filtering is a filtering process performed on the current block using multiple adjacent reference pixels in each of at least two adjacent reference pixel sets; using the initial prediction value, the first-type prediction value and the second-type prediction value to calculate a rate distortion cost of an original pixel value of the current block, and determining a current prediction mode corresponding to an optimal rate distortion cost; performing intra prediction on the current block using the current prediction mode; and writing index information of the current prediction mode and a filtering identifier into a code stream, wherein the filtering identifier represents an identifier corresponding to intra prediction filtering and/or intra prediction smooth filtering.

Description

一种帧内预测方法、编码器、解码器及存储介质Intra-frame prediction method, encoder, decoder and storage medium 技术领域technical field
本申请实施例涉及视频编码技术,涉及但不限于一种帧内预测方法、编码器、解码器及存储介质。The embodiments of the present application relate to video coding technologies, and relate to, but are not limited to, an intra-frame prediction method, an encoder, a decoder, and a storage medium.
背景技术Background technique
在视频编解码,对当前块进行编解码的过程中,除了有帧间预测方式外,还可以采用帧内预测。帧内预测可以对每个编码单元分别进行帧内预测过程计算预测块。In video encoding and decoding, in the process of encoding and decoding the current block, in addition to the inter-frame prediction mode, intra-frame prediction can also be used. Intra-frame prediction may perform an intra-frame prediction process separately for each coding unit to calculate a prediction block.
现有技术中,帧内预测通常借助各自角度模式与非角度模式对当前块进行预测得到预测块,根据预测块与原始块计算得到的率失真代价信息,进而筛选出当前块的最优的预测模式,再基于该预测模式进行帧内预测。当前的帧内角度预测中并没有采用全部的参考像素,容易忽略一些像素与当前块之间的关联性,帧内预测滤波技术通过点对点的滤波提升像素预测精度,可以有效地增强空间关联性。因此,采用了帧内预测滤波技术通过点对点的滤波提升像素预测精度,可以有效地增强空间关联性,从而提升帧内预测精度。In the prior art, intra-frame prediction usually uses the respective angle mode and non-angle mode to predict the current block to obtain the predicted block, and then selects the optimal prediction of the current block according to the rate-distortion cost information calculated from the predicted block and the original block. mode, and then perform intra prediction based on the prediction mode. The current intra-frame angle prediction does not use all reference pixels, and it is easy to ignore the correlation between some pixels and the current block. The intra-frame prediction filtering technology improves the pixel prediction accuracy through point-to-point filtering, which can effectively enhance the spatial correlation. Therefore, the intra-frame prediction filtering technology is adopted to improve the pixel prediction accuracy through point-to-point filtering, which can effectively enhance the spatial correlation, thereby improving the intra-frame prediction accuracy.
然而,帧内预测滤波技术在纹理比较模糊的图像块的帧内预测中,过于锐化的预测可能会导致残差增加和变大,预测效果不好,从而导致编解码效率下降。However, in the intra-frame prediction filtering technique for image blocks with relatively blurred textures, over-sharp prediction may lead to an increase and larger residual error, and the prediction effect is not good, resulting in a decrease in encoding and decoding efficiency.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种帧内预测方法、编码器、解码器和存储介质,能够平滑处理的图像块的预测过程,提高编解码效率。The embodiments of the present application provide an intra-frame prediction method, an encoder, a decoder, and a storage medium, which can smooth the prediction process of processed image blocks and improve encoding and decoding efficiency.
第一方面,本申请实施例提供了一种帧内预测方法,应用于编码器,所述方法包括:In a first aspect, an embodiment of the present application provides an intra-frame prediction method, which is applied to an encoder, and the method includes:
遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值;Traverse the intra-frame prediction mode to determine the initial prediction value of the initial prediction block corresponding to the current block;
对所述初始预测块分别进行帧内预测滤波和帧内预测平滑滤波处理,得到第一类预测值和第二类预测值;其中,所述帧内预测平滑滤波为采用至少两个相邻参考像素集合中每个相邻参考像素集合中的多个相邻参考像素,对所述当前块进行滤波的过程;Perform intra-frame prediction filtering and intra-frame prediction smoothing filtering on the initial prediction block respectively, to obtain a first-type prediction value and a second-type prediction value; wherein, the intra-frame prediction smoothing filtering adopts at least two adjacent reference values A process of filtering the current block for multiple adjacent reference pixels in each adjacent reference pixel set in the pixel set;
采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式;Using the initial predicted value, the first-type predicted value and the second-type predicted value, respectively, perform rate-distortion cost calculation with the original pixel value of the current block, and determine the current prediction mode corresponding to the optimal rate-distortion cost;
采用所述当前预测模式,对所述当前块进行帧内预测;using the current prediction mode to perform intra prediction on the current block;
将所述当前预测模式的索引信息,以及滤波标识写入码流,其中,滤波标识表征帧内预测滤波和/或帧内预测平滑滤波对应的标识。The index information of the current prediction mode and the filter identifier are written into the code stream, where the filter identifier represents an identifier corresponding to intra-frame prediction filtering and/or intra-frame prediction smoothing filtering.
第二方面,本申请实施例提供了一种帧内预测方法,应用于解码器,所述方法包括:In a second aspect, an embodiment of the present application provides an intra-frame prediction method, which is applied to a decoder, and the method includes:
获取码流,解析码流的头信息,得到所述滤波标识;Obtain the code stream, parse the header information of the code stream, and obtain the filter identification;
当所述滤波标识为表征帧内预测滤波允许标识有效、且帧内预测平滑滤波允许标识有效时,至少从码流中获取当前预测模式和帧内预测滤波使用标识;When the filtering flag indicates that the intra-frame prediction filtering permission flag is valid and the intra-frame prediction smoothing filtering permission flag is valid, at least obtain the current prediction mode and the intra-frame prediction filtering use flag from the code stream;
当所述帧内预测滤波使用标识为无效、且从码流中获取到有效的帧内预测平滑滤波使用标识时,基于所述当前预测模式,对当前块进行帧内预测平滑滤波处理,得到第一预测值。When the intra-frame prediction filtering use flag is invalid and a valid intra-frame prediction smoothing filter use flag is obtained from the code stream, based on the current prediction mode, perform intra-frame prediction smoothing filtering processing on the current block to obtain the first a predicted value.
第三方面,本申请实施例提供了一种编码器,包括:In a third aspect, an embodiment of the present application provides an encoder, including:
第一确定部分,被配置为遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值;The first determining part is configured to traverse the intra prediction mode, and determine the initial prediction value of the initial prediction block corresponding to the current block;
第一滤波部分,被配置为对所述初始预测块分别进行帧内预测滤波和帧内预测平滑滤波处理,得到第一类预测值和第二类预测值;其中,所述帧内预测平滑滤波为采用至少两个相邻参考像素集合中每个相邻参考像素集合中的多个相邻参考像素,对所述当前块进行滤波的过程;The first filtering part is configured to perform intra-frame prediction filtering and intra-frame prediction smoothing filtering respectively on the initial prediction block to obtain a first-type prediction value and a second-type prediction value; wherein, the intra-frame prediction smoothing filtering process A process of filtering the current block for using a plurality of adjacent reference pixels in each adjacent reference pixel set in at least two adjacent reference pixel sets;
所述第一确定部分,还被配置为采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式;The first determining part is further configured to use the initial prediction value, the first type prediction value and the second type prediction value to calculate the rate-distortion cost with the original pixel value of the current block, respectively, and determine the corresponding optimal rate-distortion cost. The current forecast mode of ;
第一预测部分,被配置为采用所述当前预测模式,对所述当前块进行帧内预测;a first prediction part configured to use the current prediction mode to perform intra prediction on the current block;
写入部分,被配置为将所述当前预测模式的索引信息,以及滤波标识写入码流,其中,滤波标 识表征帧内预测滤波和/或帧内预测平滑滤波对应的标识。The writing part is configured to write the index information of the current prediction mode and the filtering identification into the code stream, wherein the filtering identification represents the identification corresponding to intra-frame prediction filtering and/or intra-frame prediction smoothing filtering.
第四方面,本申请实施例提供了一种解码器,包括:In a fourth aspect, an embodiment of the present application provides a decoder, including:
解析部分,被配置为获取码流,解析码流的头信息,得到所述滤波标识;以及当所述滤波标识为表征帧内预测滤波允许标识有效、且帧内预测平滑滤波允许标识有效时,至少从码流中获取当前预测模式和帧内预测滤波使用标识;The parsing part is configured to obtain the code stream, parse the header information of the code stream, and obtain the filtering identifier; and when the filtering identifier is an indication that the intra-frame prediction filtering permission flag is valid, and the intra-frame prediction smoothing filtering permission flag is valid, Obtain at least the current prediction mode and intra-frame prediction filtering use identifier from the code stream;
第二预测部分,被配置为当所述帧内预测滤波使用标识为无效、且从码流中获取到有效的帧内预测平滑滤波使用标识时,基于所述当前预测模式,对当前块进行帧内预测平滑滤波处理,得到第一预测值。The second prediction part is configured to, based on the current prediction mode, frame the current block when the intra-frame prediction filtering use flag is invalid and a valid intra-frame prediction smoothing filter use flag is obtained from the code stream The intra-prediction smoothing filtering process is performed to obtain the first predicted value.
第五方面,本申请实施例还提供了一种编码器,包括:In a fifth aspect, the embodiments of the present application also provide an encoder, including:
第一存储器和第一处理器;a first memory and a first processor;
所述第一存储器存储有可在第一处理器上运行的计算机程序,所述第一处理器执行所述程序时实现编码器的所述帧内预测方法。The first memory stores a computer program executable on a first processor, which when executed by the first processor implements the intra prediction method of the encoder.
第六方面,本申请实施例还提供了一种解码器,包括:In a sixth aspect, an embodiment of the present application also provides a decoder, including:
第二存储器和第二处理器;a second memory and a second processor;
所述第二存储器存储有可在第二处理器上运行的计算机程序,所述第二处理器执行所述程序时实现解码器的所述帧内预测方法。The second memory stores a computer program executable on a second processor, which when executed by the second processor implements the intra prediction method of the decoder.
第七方面,本申请实施例提供了一种存储介质,包括:In a seventh aspect, an embodiment of the present application provides a storage medium, including:
其上存储有计算机程序,该计算机程序被第一处理器执行时,实现编码器的所述帧内预测方法;或者,该计算机程序被第二处理器执行时,实现解码器的所述帧内预测方法。A computer program is stored thereon, and when the computer program is executed by the first processor, the intra-frame prediction method of the encoder is realized; or, when the computer program is executed by the second processor, the intra-frame prediction method of the decoder is realized. method of prediction.
本申请实施例提供了一种帧内预测方法、编码器、解码器和存储介质,通过编码器采用帧内预测滤波实现了采用至少两个相邻参考像素集合中每个相邻参考像素集合中的一个相邻参考像素,对当前块进行滤波的过程。采用帧内预测平滑滤波由于可以参考一个相邻参考像素集合中的多个相邻参考像素,因此,这样的预测会更平滑一些,针对模糊图像的预测也会更精确一些,从而可以提高编码效率。Embodiments of the present application provide an intra-frame prediction method, an encoder, a decoder, and a storage medium. By using intra-frame prediction filtering in the encoder, it is possible to use at least two adjacent reference pixel sets in each adjacent reference pixel set. The process of filtering the current block of a neighboring reference pixel. Intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving coding efficiency. .
附图说明Description of drawings
图1A-1C为本申请实施例提供的示例性的不同颜色格式下的各分量分布图;1A-1C are exemplary distribution diagrams of components in different color formats provided by the embodiments of the present application;
图2为本申请实施例提供的示例性的编码单元的划分示意图;2 is a schematic diagram of the division of an exemplary coding unit provided by an embodiment of the present application;
图3为本申请实施例提供的示例性的预测模式的示意图;3 is a schematic diagram of an exemplary prediction mode provided by an embodiment of the present application;
图4A-4C为本申请实施例提供的示例性的帧内预测滤波的三种滤波情况示意图;4A-4C are schematic diagrams of three filtering situations of exemplary intra-frame prediction filtering provided by an embodiment of the present application;
图5为本申请实施例提供的示例性的视频编解码的网络架构的组成结构示意图;FIG. 5 is a schematic diagram of the composition and structure of an exemplary network architecture for video encoding and decoding provided by an embodiment of the present application;
图6为本申请实施例提供的示例性的视频编码码系统结构图;FIG. 6 is a structural diagram of an exemplary video coding system provided by an embodiment of the present application;
图7为本申请实施例提供的示例性的视频解码系统结构图;FIG. 7 is a structural diagram of an exemplary video decoding system provided by an embodiment of the present application;
图8为本申请实施例提供的一种帧内预测方法的流程图一;FIG. 8 is a flowchart 1 of an intra-frame prediction method provided by an embodiment of the present application;
图9A-9C为本申请实施例提供的示例性的目标参考像素的示意图;9A-9C are schematic diagrams of exemplary target reference pixels provided by embodiments of the present application;
图10为本申请实施例提供的一种帧内预测方法的流程图二;10 is a second flowchart of an intra-frame prediction method provided by an embodiment of the present application;
图11为本申请实施例还提供的一种帧内预测方法的流程图;11 is a flowchart of an intra-frame prediction method further provided by an embodiment of the present application;
图12为本申请实施例提供的一种编码器的结构示意图一;FIG. 12 is a schematic structural diagram 1 of an encoder according to an embodiment of the present application;
图13为本申请实施例提供的一种编码器的结构示意图二;FIG. 13 is a second schematic structural diagram of an encoder according to an embodiment of the application;
图14为本申请实施例提供的一种解码器的结构示意图一;FIG. 14 is a schematic structural diagram 1 of a decoder according to an embodiment of the present application;
图15为本申请实施例提供的一种解码器的结构示意图二。FIG. 15 is a second schematic structural diagram of a decoder according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。可以理解的是,此处所描述的具体实施例仅仅用于解释相关申请,而非对该申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关申请相关的部分。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It should be understood that the specific embodiments described herein are only used to explain the related application, but not to limit the application. In addition, it should be noted that, for the convenience of description, only the parts related to the relevant application are shown in the drawings.
在视频图像中,一般采用第一图像分量、第二图像分量和第三图像分量来表征当前块(Coding Block,CB);其中,这三个图像分量分别为一个亮度分量、一个蓝色色度分量和一个红色色度分量,具体地,亮度分量通常使用符号Y表示,蓝色色度分量通常使用符号Cb或者U表示,红色色度分 量通常使用符号Cr或者V表示;这样,视频图像可以用YCbCr格式表示,也可以用YUV格式表示。In a video image, a first image component, a second image component and a third image component are generally used to represent the current block (Coding Block, CB); wherein, the three image components are a luminance component and a blue chrominance component respectively. and a red chrominance component, specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V; in this way, the video image can use the YCbCr format Representation can also be represented in YUV format.
通常,数字视频压缩技术作用于颜色编码方法为YCbCr(YUV)格式的影像数据上,YUV比例通测为4:2:0、4:2:2或者4:4:4,Y表示明亮度(Luma),Cb(U)表示蓝色色度,Cr(V)表示红色色度,U和V表示为色度(Chroma)用于描述色彩及饱和度。图1A至图1C展示了不同颜色格式下的各分量分布图,其中白色为Y分量,黑灰色为UV分量。如图1A所示,在颜色格式上,4:2:0表示每4个像素有4个亮度分量,2个色度分量(YYYYCbCr),如图1B所示,4:2:2表示每4个像素有4个亮度分量,4个色度分量(YYYYCbCrCbCr),而如图1C所示,4:4:4表示全像素显示(YYYYCbCrCbCrCbCrCbCr)。Usually, digital video compression technology works on image data whose color coding method is YCbCr (YUV) format, YUV ratio is generally measured as 4:2:0, 4:2:2 or 4:4:4, Y represents brightness ( Luma), Cb(U) represents blue chromaticity, Cr(V) represents red chromaticity, U and V represent chromaticity (Chroma) to describe color and saturation. 1A to 1C show the distribution diagrams of each component in different color formats, wherein white is the Y component, and black and gray are the UV components. As shown in Figure 1A, in the color format, 4:2:0 means that every 4 pixels has 4 luminance components and 2 chrominance components (YYYYCbCr), as shown in Figure 1B, 4:2:2 means that every 4 A pixel has 4 luminance components, 4 chrominance components (YYYYCbCrCbCr), and as shown in Figure 1C, 4:4:4 represents a full pixel display (YYYYCbCrCbCrCbCrCbCr).
目前,通用的视频编解码标准基于都采用基于块的混合编码框架。视频图像中的每一帧被分割成相同大小(比如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)。由于视频图像的一个帧内相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测方式能够消除相邻像素之间的空间冗余。帧间预测可以参考不同帧的图像信息,利用运动估计搜索最匹配当前划分块的运动矢量信息,用于消除时间冗余;变换将预测后的图像块转换到频率域,能量重新分布,结合量化可以将人眼不敏感的信息去除,用于消除视觉冗余;熵编码可以根据当前上下文模型以及二进制码流的概率信息消除字符冗余。Currently, common video coding standards are based on the block-based hybrid coding framework. Each frame in the video image is divided into square largest coding units (Largest Coding Units, LCUs) of the same size (such as 128×128, 64×64, etc.), and each LCU can also be divided into rectangular ones according to the rules. Coding unit (Coding Unit, CU); and the coding unit may be divided into smaller prediction units (Prediction Unit, PU). Specifically, 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 the video coding and decoding technology can eliminate the spatial redundancy between adjacent pixels. Inter-frame prediction can refer to the image information of different frames, and use motion estimation to search for the motion vector information that best matches the current divided block to eliminate temporal redundancy; transformation converts the predicted image block to the frequency domain, redistributes the energy, and combines quantization The information that is not sensitive to the human eye can be removed to eliminate visual redundancy; entropy coding can eliminate character redundancy according to the current context model and the probability information of the binary code stream.
需要说明的是,视频编码过程中,编码器首先读取图像信息,将图像划分成若干个编码树单元(Coding Tree Unit,CTU),而一个编码树单元又可以继续划分成若干个编码单元(Coding Unit,CU),这些编码单元可以为矩形块也可以为方形块,具体关系可以参考图2所示。It should be noted that in the video coding process, the encoder first reads the image information, and divides the image into several coding tree units (Coding Tree Units, CTUs), and a coding tree unit can be further divided into several coding units ( Coding Unit, CU), these coding units can be rectangular blocks or square blocks, and the specific relationship can be referred to as shown in FIG. 2 .
在帧内预测过程中,当前编码单元不能参考不同帧图像的信息,只能借助同一帧图像的相邻编码单元作为参考信息进行预测,即根据目前大多数的从左至右、从上到下的编码顺序,当前编码单元可以参考左上侧编码单元,上侧编码单元以及左侧编码单元作为参考信息来预测当前编码单元,而当前编码单元又作为下一个编码单元的参考信息,如此对整幅图像进行预测。若输入的数字视频为彩色格式,即当前主流的数字视频编码器输入源为YUV 4:2:0格式,即图像的每4个像素点由4个Y分量和2个UV分量组成,编码器会对Y分量和UV分量分别进行编码,采用的编码工具与技术也略有不同,同时,解码端也会根据不同格式对应进行解码。In the process of intra-frame prediction, the current coding unit cannot refer to the information of different frame images, and can only use the adjacent coding units of the same frame image as reference information for prediction, that is, according to most of the current left-to-right, top-to-bottom The current coding unit can refer to the upper left coding unit, the upper coding unit and the left coding unit are used as reference information to predict the current coding unit, and the current coding unit is used as the reference information of the next coding unit. image for prediction. If the input digital video is in color format, that is, the input source of the current mainstream digital video encoder is YUV 4:2:0 format, that is, every 4 pixels of the image consists of 4 Y components and 2 UV components. The Y component and UV component will be encoded separately, and the encoding tools and technologies used are slightly different. At the same time, the decoding end will also decode according to different formats.
针对数字视频编解码中的帧内预测部分,主要参考当前帧的相邻块图像信息对当前块进行预测,将预测块与原始图像块计算残差得到残差信息后经由变换与量化等过程,将残差信息传输到解码端。解码端接收并解析码流后,经过反变换与反量化等步骤得到残差信息,将解码端预测得到的预测图像块叠加残差信息后得到重建图像块。For the intra-frame prediction part in digital video coding and decoding, the current block is mainly predicted with reference to the image information of adjacent blocks of the current frame, the residual information is obtained by calculating the residual between the predicted block and the original image block, and then the process of transformation and quantization is performed. The residual information is transmitted to the decoding end. After the decoding end receives and parses the code stream, the residual information is obtained through inverse transformation and inverse quantization, and the reconstructed image block is obtained by superimposing the residual information on the predicted image block predicted by the decoding end.
在此过程中,帧内预测通常借助各自角度模式与非角度模式对当前编码块进行预测得到预测块,根据预测块与原始块计算得到的率失真信息,筛选出当前编码单元最优的预测模式,后将该预测模式经码流传输到解码端。解码端解析出预测模式,预测得到当前解码块的预测图像并叠加经码流传输而来的残差像素,即可得到重建图像。经过历代的数字视频编解码标准发展,非角度模式保持相对稳定,有均值模式和平面模式;角度模式则随着数字视频编解码标准的演进而不断增加,以国际数字视频编码标准H系列为例,H.264/AVC标准仅有8种角度预测模式和1种非角度预测模式;H.265/HEVC扩展到33种角度预测模式和2种非角度预测模式;以及目前最新通用视频编码标准H.266/VVC采用了67种预测模式,其中保留2种非角度预测模式,将角度模式从H.265的33种扩展到了65种。毋庸置疑,随着角度模式的增加,帧内预测将会更加精确,也更加符合当前社会对高清以及超高清视频发展的需求。不仅国际标准如此,国内数字音视频编码标准3(Audio Video coding Standard,AVS3)也继续扩展了角度模式和非角度模式,超高清数字视频的发展对帧内预测提出了更高的要求,不能仅仅只是依靠单纯地增加角度预测模式,扩展宽角度来提交编码效率。因此,国内数字音视频编码标准AVS3采纳了帧内预测滤波技术(Intra Prediction Filter,IPF),帧内预测滤波技术指出当前的帧内角度预测中并没有采用全部的参考像素,容易忽略一些像素与当前编码单元之间的关联性,帧内预测滤波技术通过点对点的滤波提升像素预测精度,可以有效地增强空间关联性,从而提升帧内预测精度。IPF技术以AVS3中自右上向左下的预测模式为例,具体如图3所示。In this process, intra prediction usually uses the respective angle mode and non-angle mode to predict the current coding block to obtain the prediction block, and selects the optimal prediction mode for the current coding unit according to the rate-distortion information calculated from the prediction block and the original block. , and then transmit the prediction mode to the decoding end via the code stream. The decoding end parses the prediction mode, predicts the prediction image of the current decoding block, and superimposes the residual pixels transmitted by the code stream to obtain the reconstructed image. After the development of digital video coding and decoding standards over the past generations, the non-angle mode remains relatively stable, including the average mode and the plane mode; the angle mode continues to increase with the evolution of digital video coding standards. Take the international digital video coding standard H series as an example , the H.264/AVC standard has only 8 angle prediction modes and 1 non-angle prediction mode; H.265/HEVC is extended to 33 angle prediction modes and 2 non-angle prediction modes; and the latest general video coding standard H .266/VVC adopts 67 prediction modes, among which 2 non-angle prediction modes are reserved, and the angle mode is expanded from 33 kinds of H.265 to 65 kinds. Undoubtedly, with the increase of the angle mode, the intra-frame prediction will be more accurate, and it will be more in line with the needs of the current society for the development of high-definition and ultra-high-definition video. Not only the international standard, but the domestic digital audio and video coding standard 3 (Audio Video coding Standard, AVS3) also continues to expand the angle mode and non-angle mode. The development of ultra-high-definition digital video puts forward higher requirements for intra-frame prediction, not only It only relies on simply increasing the angle prediction mode and expanding the wide angle to submit coding efficiency. Therefore, the domestic digital audio and video coding standard AVS3 adopts the Intra Prediction Filter (IPF). The intra prediction filtering technology points out that not all reference pixels are used in the current intra-frame angle prediction, and it is easy to ignore some pixels and The correlation between the current coding units, the intra-frame prediction filtering technology improves the pixel prediction accuracy through point-to-point filtering, which can effectively enhance the spatial correlation, thereby improving the intra-frame prediction accuracy. The IPF technology takes the prediction mode from upper right to lower left in AVS3 as an example, as shown in FIG. 3 .
该预测模式方向从右上到左下,生成的当前编码单元预测值主要使用上方MRB这一行相邻块的参考像素点,即当前编码单元的预测像素并没有参考到左侧相邻块的重建像素,然而当前编码单元与左侧重建块为空间相邻关系,若只参考上侧MRB像素而不参考左侧URB像素则容易缺失空间关联性导致预测效果较差。The direction of the prediction mode is from upper right to lower left, and the generated prediction value of the current coding unit mainly uses the reference pixels of the adjacent blocks in the upper MRB row, that is, the prediction pixels of the current coding unit do not refer to the reconstructed pixels of the adjacent blocks on the left. However, the current coding unit and the left reconstruction block are in a spatially adjacent relationship. If only the upper MRB pixels are referenced instead of the left URB pixels, the spatial correlation is likely to be lost, resulting in poor prediction effect.
针对这个问题,提出了帧内预测滤波技术(Intra Prediction Filter,IPF),帧内预测滤波技术是应用于帧内预测的所有预测模式中,来提高帧内预测精度的滤波方法。In order to solve this problem, the intra-frame prediction filter technology (Intra Prediction Filter, IPF) is proposed. The intra-frame prediction filter technology is a filtering method applied to all prediction modes of intra-frame prediction to improve the accuracy of intra-frame prediction.
IPF主要通过以下流程实现:IPF is mainly realized through the following processes:
1、帧内预测滤波技术对该编码单元的当前预测模式进行判断,划分为水平类角度预测模式、垂直类角度预测模式和非角度预测模式;1. The intra-frame prediction filtering technology judges the current prediction mode of the coding unit and divides it into a horizontal angle prediction mode, a vertical angle prediction mode and a non-angle prediction mode;
2、根据不同类别的预测模式,IPF技术采用不同的滤波器对输入像素进行滤波;2. According to different types of prediction modes, IPF technology uses different filters to filter input pixels;
3、根据当前像素到参考像素的距离不同,IPF技术采用不同的滤波系数对输入像素进行滤波;3. According to the different distances from the current pixel to the reference pixel, the IPF technology uses different filter coefficients to filter the input pixels;
4、IPF技术的输入像素为各个预测模式下得到的预测像素,输出像素为IPF滤波后的最终预测像素。4. The input pixels of the IPF technology are the predicted pixels obtained in each prediction mode, and the output pixels are the final predicted pixels after IPF filtering.
IPF技术有允许标识位ipf_enable_flag(帧内预测滤波允许标识),示例性的,二值变量,值为‘1’表示可使用帧内预测滤波;值为‘0’表示不应使用帧内预测滤波。同时IPF技术还有使用标识位ipf_flag(帧内预测滤波使用标识),示例性的,二值变量,值为‘1’表示应使用帧内预测滤波;值为‘0’表示不应使用帧内预测滤波,如果码流中不存在标识位ipf_flag,则默认为0。The IPF technology has an allowable flag bit ipf_enable_flag (intra-frame prediction filtering permission flag), which is an exemplary, binary variable. A value of '1' indicates that intra-frame prediction filtering can be used; a value of '0' indicates that intra-frame prediction filtering should not be used. . At the same time, the IPF technology also uses the flag ipf_flag (intra-frame prediction filtering use flag), which is an exemplary, binary variable. A value of '1' indicates that intra-frame prediction filtering should be used; a value of '0' indicates that intra-frame prediction filtering should not be used. Predictive filtering, if the flag bit ipf_flag does not exist in the code stream, the default value is 0.
其中,ipf_flag的语法元素表示如下所示:Among them, the syntax element representation of ipf_flag is as follows:
Figure PCTCN2020121668-appb-000001
Figure PCTCN2020121668-appb-000001
需要说明的是,IPF技术将预测模式0、1和2归类为非角度预测模式,使用第一三抽头滤波器对预测像素进行滤波;将预测模式3至预测模式18、预测模式34至预测模式50归类为垂直类角度预测模式,使用第一两抽头滤波器对预测像素进行滤波;将预测模式19至预测模式32、预测模式51至预测模式65归类为水平类角度预测模式,使用第二两抽头滤波器对预测像素进行滤波。其中,It should be noted that the IPF technology classifies prediction modes 0, 1 and 2 as non-angle prediction modes, and uses the first three-tap filter to filter the prediction pixels; Mode 50 is classified as a vertical angle-like prediction mode, and the predicted pixels are filtered using the first two-tap filter; The second two-tap filter filters the predicted pixels. in,
上述适用于IPF技术的第一三抽头滤波器,滤波公式如公式(1)所示:The above-mentioned first three-tap filter suitable for IPF technology, the filtering formula is shown in formula (1):
P′(x,y)=f(x)·P(-1,y)+f(y)·P(x,-1)+(1-f(x)-f(y))·P(x,y)   (1)P'(x,y)=f(x)·P(-1,y)+f(y)·P(x,-1)+(1-f(x)-f(y))·P( x,y) (1)
上述适用于IPF技术的第一三抽头滤波器,滤波公式如公式(2)所示:The above-mentioned first three-tap filter suitable for IPF technology, the filtering formula is shown in formula (2):
P′(x,y)=f(x)·P(-1,y)+(1-f(x))·P(x,y)    (2)P′(x,y)=f(x)·P(-1,y)+(1-f(x))·P(x,y) (2)
上述适用于IPF技术的第二两抽头滤波器,滤波公式如公式(3)所示:The above-mentioned second two-tap filter suitable for IPF technology, the filtering formula is shown in formula (3):
P′(x,y)=f(y)·P(x,-1)+(1-f(y))·P(x,y)   (3)P′(x,y)=f(y)·P(x,-1)+(1-f(y))·P(x,y) (3)
其中,P′(x,y)为当前色度预测块位于(x,y)位置像素的最终预测值,f(x)与f(y)分别为参考左侧相邻块重建像素的水平滤波系数与参考上侧相邻块重建像素的垂直滤波系数,P(-1,y)与P(x,-1)分别为位于y行的左侧重建像素与位于x列的上侧重建像素,P(x,y)为当前色度分量预测块里的原始预测像素值。其中,x与y的值均不超过当前编码单元的宽度与高度取值范围。Among them, P'(x, y) is the final prediction value of the pixel located at the position (x, y) of the current chrominance prediction block, and f(x) and f(y) are the horizontal filtering of the reconstructed pixels with reference to the adjacent blocks on the left, respectively. The coefficient and the vertical filter coefficient of the reconstructed pixel of the adjacent block on the reference upper side, P(-1,y) and P(x,-1) are the reconstructed pixels on the left side of row y and the reconstructed pixels on the upper side of column x, respectively, P(x,y) is the original predicted pixel value in the current chrominance component prediction block. The values of x and y do not exceed the range of the width and height of the current coding unit.
需要说明的是,上述水平滤波系数与垂直滤波系数的取值与当前编码单元的尺寸以及当前预测块中预测像素到左侧重建像素点、上侧重建像素点的距离有关。上述水平滤波系数可以根据当前编码单元的大小划分成不同滤波器系数组。表1给出了帧内预测滤波技术的滤波系数。It should be noted that the values of the above-mentioned horizontal filter coefficients and vertical filter coefficients are related to the size of the current coding unit and the distances from the predicted pixels in the current prediction block to the left reconstructed pixels and the top reconstructed pixels. The above-mentioned horizontal filter coefficients may be divided into different filter coefficient groups according to the size of the current coding unit. Table 1 presents the filter coefficients of the intra-frame prediction filtering technique.
表1Table 1
Figure PCTCN2020121668-appb-000002
Figure PCTCN2020121668-appb-000002
Figure PCTCN2020121668-appb-000003
Figure PCTCN2020121668-appb-000003
示例性的,图4A至4C展示了帧内预测滤波的三种滤波情况示意图,分别仅参考了上侧参考像素对当前编码单元中的预测值进行滤波(即图4A上侧两抽头滤波);仅参考了左侧参考像素对当前编码单元预中的测值进行滤波(即,图4B的左侧两抽头滤波);以及都参考了上侧与左侧参考像素对当前编码单元块中的预测值进行滤波(即,图4C上侧和左侧三抽头滤波)。Exemplarily, FIGS. 4A to 4C show schematic diagrams of three filtering situations of intra-frame prediction filtering, respectively only referring to the upper reference pixels to filter the prediction value in the current coding unit (that is, the upper two-tap filtering in FIG. 4A ); Only the left reference pixel is referenced to filter the measurements in the current coding unit pre-filter (ie, the left two-tap filtering of FIG. 4B ); and both the upper and left reference pixels are referenced to the prediction in the current coding unit block values are filtered (ie, three-tap filtering on the upper and left sides of Figure 4C).
IPF技术作用于视频编码混合框架中的帧内预测部分,具体应用于帧内预测的所有预测模式,对编码端和解码端同时作用。The IPF technology acts on the intra-frame prediction part of the video coding hybrid framework, and is specifically applied to all prediction modes of intra-frame prediction, acting on both the encoding end and the decoding end.
基于上述概念的基础上,本申请实施例提供了一种包含帧内预测方法的视频编解码系统的网络架构,图5为本申请实施例视频编解码的网络架构的组成结构示意图,如图5所示,该网络架构包括一个或多个电子设备12至1N和通信网络01,其中,电子设备12至1N可以通过通信网络01进行视频交互。电子设备在实施的过程中可以为各种类型的具有视频编解码功能的设备,例如,所述电子设备可以包括手机、平板电脑、个人计算机、个人数字助理、导航仪、数字电话、视频电话、电视机、传感设备、服务器等,本申请实施例不作限制。其中,本申请实施例中的帧内预测装置就可以为上述电子设备。Based on the above concepts, an embodiment of the present application provides a network architecture of a video encoding and decoding system including an intra-frame prediction method. FIG. 5 is a schematic diagram of the composition and structure of the network architecture for video encoding and decoding according to an embodiment of the present application, as shown in FIG. 5 . As shown, the network architecture includes one or more electronic devices 12 to 1N and a communication network 01 , wherein the electronic devices 12 to 1N can perform video interaction through the communication network 01 . In the implementation process, the electronic device can be various types of devices with video codec functions, for example, the electronic device can include mobile phones, tablet computers, personal computers, personal digital assistants, navigators, digital phones, video phones, Televisions, sensing devices, servers, etc., are not limited in the embodiments of the present application. The intra-frame prediction apparatus in the embodiment of the present application may be the above-mentioned electronic device.
其中,本申请实施例中的电子设备具有视频编解码功能,一般包括视频编码器(即编码器)和视频解码器(即解码器)。The electronic device in the embodiments of the present application has a video encoding and decoding function, and generally includes a video encoder (ie, encoder) and a video decoder (ie, decoder).
本申请提供一种视频编码系统,如图6所示,该视频编码系统11包括:The present application provides a video coding system. As shown in FIG. 6 , the video coding system 11 includes:
变换单元111、量化单元112、模式选择和编码控制逻辑单元113、帧内预测单元114、帧间预测单元115(包括:运动补偿和运动估计)、反量化单元116、反变换单元117、环路滤波单元118、编码单元119和解码图像缓存单元110;针对输入的原始视频信号,通过编码树块(Coding Tree Unit,CTU)的划分可以得到一个视频重建块,通过模式选择和编码控制逻辑单元113确定编码模式,然后,对经过帧内或帧间预测后得到的残差像素信息,通过变换单元111、量化单元112对该视频重建块进行变换,包括将残差信息从像素域变换到变换域,并对所得的变换系数进行量化,用以进一步减少比特率;帧内预测单元114用于对该视频重建块进行帧内预测;其中,帧内预测单元114用于确定该视频重建块的最优帧内预测模式(即目标预测模式);帧间预测单元115用于执行所接收的视频重建块相对于一或多个参考帧中的一或多个块的帧间预测编码,以提供时间预测信息;其中吗,运动估计为产生运动向量的过程,所述运动向量可以估计该视频重建块的运动,然后,运动补偿基于由运动估计所确定的运动向量执行运动补偿;在确定帧间预测模式之后,帧间预测单元115还用于将所选择的帧间预测数据提供到编码单元119,而且,将所计算确定的运动向量数据也发送到编码单元119;此外,反量化单元116和反变换单元117用于该视频重建块的重构建,在像素域中重构建残差块,该重构建残差块通过环路滤波单元118去除方块效应伪影,然后,将该重构残差块添加到解码图像缓存单元110的帧中的一个预测性块,用以产生经重构建的视频重建块;编码单元119是用于编码各种编码参数及量化后的变换系数。而解码图像缓存单元110用于存放重构建的视频重建块,用于预测参考。随着视频图像编码的进行,会不断生成新的重构建的视频重建块,这些重构建的视频重建块都会被存放在解码图像缓存单元110中。 Transform unit 111, quantization unit 112, mode selection and coding control logic unit 113, intra prediction unit 114, inter prediction unit 115 (including: motion compensation and motion estimation), inverse quantization unit 116, inverse transform unit 117, loop Filtering unit 118, coding unit 119 and decoding image buffering unit 110; for the input original video signal, a video reconstruction block can be obtained by the division of coding tree block (Coding Tree Unit, CTU), by mode selection and coding control logic unit 113 Determine the encoding mode, and then transform the video reconstruction block through the transform unit 111 and the quantization unit 112 for the residual pixel information obtained after intra-frame or inter-frame prediction, including transforming the residual information from the pixel domain to the transform domain , and quantize the obtained transform coefficients to further reduce the bit rate; the intra-frame prediction unit 114 is used to perform intra-frame prediction on the video reconstruction block; wherein, the intra-frame prediction unit 114 is used to determine the maximum value of the video reconstruction block. optimal intra prediction mode (ie, target prediction mode); inter prediction unit 115 is used to perform inter prediction encoding of the received video reconstruction block relative to one or more blocks in one or more reference frames to provide temporal Prediction information; where, motion estimation is the process of generating a motion vector that can estimate the motion of the video reconstruction block, and then motion compensation is performed based on the motion vector determined by motion estimation; After the mode, the inter prediction unit 115 is also used to provide the selected inter prediction data to the encoding unit 119, and also send the calculated motion vector data to the encoding unit 119; in addition, the inverse quantization unit 116 and the inverse The transform unit 117 is used for the reconstruction of the video reconstruction block, reconstructing the residual block in the pixel domain, the reconstructed residual block is passed through the loop filtering unit 118 to remove the blocking artifacts, and then, the reconstructed residual block is A predictive block added to the frame of the decoded image buffer unit 110 to generate a reconstructed video reconstruction block; the encoding unit 119 is used to encode various encoding parameters and quantized transform coefficients. The decoded image buffer unit 110 is used for storing reconstructed video reconstruction blocks for prediction reference. As the video image encoding proceeds, new reconstructed video reconstruction blocks are continuously generated, and these reconstructed video reconstruction blocks are all stored in the decoded image buffer unit 110 .
本申请实施例提供一种视频解码系统,图7为本申请实施例视频编码系统的组成结构示意图,如图7所示,该视频编码系统12包括:An embodiment of the present application provides a video decoding system, and FIG. 7 is a schematic structural diagram of a video encoding system according to an embodiment of the present application. As shown in FIG. 7 , the video encoding system 12 includes:
解码单元121、反变换单元127,与反量化单元122、帧内预测单元123、运动补偿单元124、环路滤波单元125和解码图像缓存单元126单元;输入的视频信号经过视频编码系统11进行编码处理之后,输出该视频信号的码流;该码流输入视频解码系统12中,首先经过解码单元121,用于得到解码后的变换系数;针对该变换系数通过反变换单元127与反量化单元122进行处理,以便在像 素域中产生残差块;帧内预测单元123可用于基于所确定的帧内预测方向和来自当前帧或图片的先前经解码块的数据而产生当前视频解码块的预测数据;运动补偿单元124是通过剖析运动向量和其他关联语法元素来确定用于视频解码块的预测信息,并使用该预测信息以产生正被解码的视频解码块的预测性块;通过对来自反变换单元127与反量化单元122的残差块与由帧内预测单元123或运动补偿单元124产生的对应预测性块进行求和,而形成解码的视频块;该解码的视频信号通过环路滤波单元125以便去除方块效应伪影,可以改善视频质量;然后将经解码的视频块存储于解码图像缓存单元126中,解码图像缓存单元126存储用于后续帧内预测或运动补偿的参考图像,同时也用于视频信号的输出,得到所恢复的原始视频信号。Decoding unit 121, inverse transform unit 127, inverse quantization unit 122, intra-frame prediction unit 123, motion compensation unit 124, loop filtering unit 125 and decoded image buffer unit 126; the input video signal is encoded by the video encoding system 11 After processing, the code stream of the video signal is output; the code stream is input into the video decoding system 12, and firstly passes through the decoding unit 121 to obtain the decoded transform coefficient; for the transform coefficient, the inverse transform unit 127 and the inverse quantization unit 122 processed to generate a residual block in the pixel domain; intra-prediction unit 123 may be used to generate prediction data for the current video decoding block based on the determined intra-prediction direction and data from previously decoded blocks of the current frame or picture Motion compensation unit 124 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 the predictive block of the video decoding block being decoded; The residual blocks of unit 127 and inverse quantization unit 122 are summed with the corresponding predictive blocks produced by intra prediction unit 123 or motion compensation unit 124 to form a decoded video block; the decoded video signal is passed through the loop filtering unit 125 to remove blocking artifacts, which can improve video quality; the decoded video blocks are then stored in a decoded picture buffer unit 126, which stores reference pictures for subsequent intra prediction or motion compensation, while also storing It is used for the output of the video signal to obtain the restored original video signal.
采用IPT进行帧内预测编码模式的编码器的实施方式如下:The implementation of the encoder using IPT for intra-frame prediction coding mode is as follows:
在当前编码单元中,若IPF的允许标识位为‘1’则进行如下所有步骤,若IPF的允许标识位为‘0’则仅进行a)、b)和f)步骤:In the current coding unit, if the allowable identification bit of IPF is '1' then all the following steps are carried out, if the allowable identification bit of IPF is '0' then only a), b) and f) steps are carried out:
a)、帧内预测首先对所有预测模式进行遍历,计算每一种帧内预测模式下的预测像素,并根据原始像素计算率失真代价;a), the intra-frame prediction first traverses all prediction modes, calculates the predicted pixels under each intra-frame prediction mode, and calculates the rate-distortion cost according to the original pixels;
b)、根据上述所有预测模式率失真代价最小原则,选择出当前编码单元的最优预测模式,记录最优预测模式信息和与之对应的率失真代价信息;b), select the optimal prediction mode of the current coding unit according to the principle of the minimum rate-distortion cost of all the above-mentioned prediction modes, and record the optimal prediction mode information and the corresponding rate-distortion cost information;
c)、对所有帧内预测模式再次进行遍历,此过程开启IPF技术,首先计算每一种帧内预测模式下的预测像素,得到当前编码单元的预测块;c), traverse all intra-frame prediction modes again, this process opens the IPF technology, first calculates the predicted pixels under each intra-frame prediction mode, and obtains the prediction block of the current coding unit;
d)、对当前编码单元的预测块进行IPF滤波,根据当前预测模式选择与之相对应的滤波器,根据当前编码单元尺寸选择相对应的滤波系数组,具体对应关系可查表1;d), carry out IPF filtering to the prediction block of the current coding unit, select the corresponding filter according to the current prediction mode, select the corresponding filter coefficient group according to the current coding unit size, and the specific correspondence can look up Table 1;
e)、根据上述经过IPF滤波技术得到的最终预测像素与原始像素计算得到每一种预测模式的率失真代价信息,记录最小率失真代价信息的预测模式和对应代价值;e), calculate the rate-distortion cost information of each prediction mode according to the final prediction pixel and original pixel obtained through the above-mentioned IPF filtering technology, and record the prediction mode and the corresponding cost value of the minimum rate-distortion cost information;
f)、若IPF允许标识位为‘0’,则将b)中记录的预测模式索引经码流传输给解码端;若IPF允许标识位为‘1’,则将b)中记录的最小代价值与e)中记录的最小代价值进行比较,若b)中的率失真代价更小,则将b)中记录的预测模式索引编码作为当前编码单元的最优预测模式经码流传输给解码端,将IPF当前编码单元标识位置否,表示不使用IPF技术,也经码流传输给解码端;若e)中的率失真更小,则将e)中记录的预测模式引编码作为当前编码单元的最优预测模式经码流传输给解码端,将IPF当前编码单元标识位置真,表示使用IPF技术,也经码流传输给解码端。f), if the IPF allows the identification bit to be '0', then transmit the prediction mode index recorded in b) to the decoding end through the code stream; if the IPF allows the identification bit to be '1', then the minimum code recorded in b) The value is compared with the minimum cost value recorded in e), if the rate-distortion cost in b) is smaller, the prediction mode index encoding recorded in b) is used as the optimal prediction mode of the current coding unit and transmitted to decoding through the code stream end, the IPF current coding unit identification position is no, indicating that the IPF technology is not used, and is also transmitted to the decoding end through the code stream; if the rate-distortion in e) is smaller, then the prediction mode index code recorded in e) is used as the current code. The optimal prediction mode of the unit is transmitted to the decoding end through the code stream, and the current IPF coding unit identification position is true, indicating that the IPF technology is used, and is also transmitted to the decoding end through the code stream.
之后,将预测值与变换与量化等操作后的残差信息叠加,得到当前编码单元的重建块作为后续编码单元的参考信息。After that, the predicted value is superimposed with the residual information after operations such as transformation and quantization to obtain the reconstructed block of the current coding unit as the reference information of the subsequent coding unit.
采用IPT进行帧内预测编码模式的解码器的实施方式如下:The implementation of the decoder for intra-frame prediction coding mode using IPT is as follows:
解码端获取码流并解析得到数字视频序列信息,解析得到当前视频序列的IPF允许标识位、当前解码单元编码模式为帧内预测编码模式和当前解码单元的IPF使用标识位。The decoding end obtains the code stream and parses to obtain the digital video sequence information, and parses to obtain the IPF permission flag of the current video sequence, the coding mode of the current decoding unit is the intra-frame prediction coding mode, and the IPF usage flag of the current decoding unit.
在当前解码单元中,若IPF的允许标识位为‘1’则进行如下所有步骤;若IPF的允许标识位为‘0’则仅进行a)、b)和e)步骤:In the current decoding unit, if the allowable identification bit of IPF is '1' then all the following steps are carried out; if the allowable identification bit of IPF is '0' then only a), b) and e) steps are carried out:
a)、获取码流信息,解析当前解码单元的残差信息,经过反变换与反量化过程得到时域残差信息;a), obtain the code stream information, analyze the residual information of the current decoding unit, and obtain the time-domain residual information through the inverse transformation and inverse quantization process;
b)、解析码流并获取当前解码单元的预测模式索引,根据相邻重建块与预测模式索引,计算得到当前解码单元的预测块;b), parse the code stream and obtain the prediction mode index of the current decoding unit, calculate the prediction block of the current decoding unit according to the adjacent reconstruction block and the prediction mode index;
c)、解析并获取IPF的使用标识位,若IPF的使用标识位为‘0’,则不对当前预测块做额外操作;若IPF的使用标识位为‘1’,则执行d);c), parse and obtain the use identification bit of IPF, if the use identification bit of IPF is '0', then do not perform additional operations on the current prediction block; if the use identification bit of IPF is '1', then execute d);
d)、根据当前解码单元的预测模式归类信息选择相对应的滤波器,根据当前解码单元的尺寸大小选择相对应的滤波器系数组,之后对预测块内各个像素进行滤波得到最终预测块;d), select the corresponding filter according to the prediction mode classification information of the current decoding unit, select the corresponding filter coefficient group according to the size of the current decoding unit, then filter each pixel in the prediction block to obtain the final prediction block;
将预测块叠加还原后的残差信息得到当前解码单元的重建块,经后处理输出。The reconstructed block of the current decoding unit is obtained by superimposing the restored residual information of the prediction block, and output after post-processing.
但是,帧内预测滤波技术能够有效提升帧内预测的编码效率,大大增强了帧内预测的空间关联性,很好地解决了帧内预测过程中,忽略了未使用到的参考像素对预测值的影响。但当帧内预测过程如需要平滑处理的部分时,帧内预测滤波技术和目前帧内预测模式都不能很好地解决类似问题,逐像素的根据参考像素滤波可以提高预测块与参考块的关联性,却无法解决预测块内部的平滑问题。也就是说,根据单一预测模式计算所得的预测块通常在纹理比较清晰的图像当中会体现出较好的预测效果,残差因此也会变得更小更少,编码效率得以提升。但在纹理比较模糊的图像块中,过于锐化的预测可能会导致残差增加和变大,预测效果不好,编码效率下降。However, the intra-frame prediction filtering technology can effectively improve the coding efficiency of intra-frame prediction, greatly enhance the spatial correlation of intra-frame prediction, and solve the problem of ignoring unused reference pixels in the process of intra-frame prediction. Impact. However, when the intra-frame prediction process needs to be smoothed, the intra-frame prediction filtering technology and the current intra-frame prediction mode cannot solve similar problems well, and pixel-by-pixel filtering based on reference pixels can improve the correlation between the prediction block and the reference block. However, it cannot solve the smoothing problem inside the prediction block. That is to say, a prediction block calculated according to a single prediction mode usually shows a better prediction effect in an image with a clearer texture, and therefore the residual error will be smaller and smaller, and the coding efficiency will be improved. However, in image blocks with blurred texture, over-sharpened prediction may lead to increased and larger residual errors, poor prediction effect and reduced coding efficiency.
基于此,在进行帧内预测时对预测块实行本技术,针对一些需要平滑处理的图像块,本申请提 出一种基于平滑处理的帧内预测滤波增强技术的帧内预测方法。本申请实施例提供的一种帧内预测方法主要作用于视频编码系统11的帧内预测单元114和视频解码系统12的帧内预测单元,即帧内预测单元123;也就是说,如果在视频编码系统11能够通过本申请实施例提供的帧内预测方法得到一个较好的预测效果,那么,对应地,在解码端,也能够改善视频解码恢复质量。Based on this, the present technology is implemented on the prediction block when performing intra-frame prediction, and for some image blocks that need smoothing processing, the present application proposes an intra-frame prediction method based on the smoothing-processing intra-frame prediction filtering enhancement technology. An intra-frame prediction method provided in this embodiment of the present application mainly acts on the intra-frame prediction unit 114 of the video coding system 11 and the intra-frame prediction unit 123 of the video decoding system 12; The encoding system 11 can obtain a better prediction effect through the intra-frame prediction method provided in the embodiment of the present application, and correspondingly, at the decoding end, the video decoding and restoration quality can also be improved.
基于此,下面结合附图和实施例对本申请的技术方案进一步详细阐述。在进行详细阐述之前,需要说明的是,说明书通篇中提到的“第一”、“第二”、“第三”等,仅仅是为了区分不同的特征,不具有限定优先级、先后顺序、大小关系等功能。Based on this, the technical solutions of the present application are further elaborated below with reference to the accompanying drawings and embodiments. Before going into detail, it should be noted that the "first", "second", "third", etc. mentioned throughout the specification are only for distinguishing different features, and do not have a limited priority or sequence. , size relationship and other functions.
本申请实施例提供一种帧内预测方法,该方法应用于视频编码设备,即编码器。该方法所实现的功能可以通过视频编码设备中的处理器调用程序代码来实现,当然程序代码可以保存在计算机存储介质中,可见,该视频编码设备至少包括处理器和存储介质。其中,当前编码单元和当前解码单元下述均用当前块来表示。An embodiment of the present application provides an intra-frame prediction method, which is applied to a video encoding device, that is, an encoder. The functions implemented by the method can be implemented by the processor in the video encoding device calling program codes, and of course the program codes can be stored in a computer storage medium. It can be seen that the video encoding device includes at least a processor and a storage medium. Hereinafter, the current coding unit and the current decoding unit are both represented by the current block.
图8为本申请实施例一种帧内预测方法的实现流程示意图,如图8所示,该方法包括:FIG. 8 is a schematic flowchart of an implementation of an intra-frame prediction method according to an embodiment of the present application. As shown in FIG. 8 , the method includes:
S101、遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值。S101. Traverse the intra prediction mode to determine the initial prediction value of the initial prediction block corresponding to the current block.
S102、对初始预测块分别进行帧内预测滤波和帧内预测平滑滤波处理,得到第一类预测值和第二类预测值;其中,帧内预测平滑滤波为采用至少两个相邻参考像素集合中每个相邻参考像素集合中的多个相邻参考像素,对当前块进行滤波的过程。S102, performing intra-frame prediction filtering and intra-frame prediction smoothing filtering on the initial prediction block respectively, to obtain a first-type prediction value and a second-type prediction value; wherein, the intra-frame prediction smoothing filtering adopts at least two adjacent reference pixel sets The process of filtering the current block for multiple adjacent reference pixels in each adjacent reference pixel set.
S103、采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式。S103 , using the initial prediction value, the first type prediction value and the second type prediction value, respectively perform rate-distortion cost calculation with the original pixel value of the current block, and determine the current prediction mode corresponding to the optimal rate-distortion cost.
S104、采用当前预测模式,对当前块进行帧内预测。S104. Using the current prediction mode, perform intra-frame prediction on the current block.
S105、将当前预测模式的索引信息,以及滤波标识写入码流,其中,滤波标识表征帧内预测滤波和/或帧内预测平滑滤波对应的标识。S105. Write the index information of the current prediction mode and the filter identifier into the code stream, where the filter identifier represents an identifier corresponding to intra-frame prediction filtering and/or intra-frame prediction smoothing filtering.
在本申请实施例中,提出了一种帧内预测平滑滤波技术(Intra Prediction Smooth,IPS),在基于IPF的基础上,可以叠加使用IPS技术实现帧内预测。即IPF和IPS都是允许的情况下,进行编码器侧的帧内预测过程。In the embodiments of the present application, an intra-frame prediction smoothing filtering technology (Intra Prediction Smooth, IPS) is proposed, and on the basis of IPF, the IPS technology can be superimposed to realize intra-frame prediction. That is, when both IPF and IPS are allowed, the intra-frame prediction process on the encoder side is performed.
在本申请实施例中,视频图像可以划分为多个图像块,每个当前待编码的图像块可以称为编码块,其中,每个编码块可以包括第一图像分量、第二图像分量和第三图像分量;而当前块为视频图像中当前待进行第一图像分量、第二图像分量或者第三图像分量预测的编码块。In this embodiment of the present application, a video image may be divided into multiple image blocks, and each image block to be encoded currently may be called an encoding block, wherein each encoding block may include a first image component, a second image component, and a first image component. Three image components; and the current block is the coding block in the video image currently to be predicted for the first image component, the second image component or the third image component.
其中,假定当前块进行第一图像分量预测,而且第一图像分量为亮度分量,即待预测图像分量为亮度分量,那么当前块也可以称为亮度块;或者,假定当前块进行第二图像分量预测,而且第二图像分量为色度分量,即待预测图像分量为色度分量,那么当前块也可以称为色度块。Wherein, it is assumed that the current block performs the first image component prediction, and the first image component is a luminance component, that is, the image component to be predicted is a luminance component, then the current block may also be called a luminance block; or, it is assumed that the current block performs the second image component prediction prediction, and the second image component is a chrominance component, that is, the image component to be predicted is a chrominance component, then the current block may also be called a chrominance block.
需要说明的是,编码器确定当前块的待预测图像分量;基于当前块的参数,利用多种预测模式分别对待预测图像分量进行预测编码,得到初始预测值,再基于初始预测值计算多种预测模式下每一种预测模式对应的率失真代价;从计算得到的多个率失真代价中选取最小率失真代价(即第一最小率失真代价),并将最小率失真代价确定为最优率失真代价,其最优率失真代价对应的预测模式确定为当前块的预测模式。It should be noted that the encoder determines the to-be-predicted image component of the current block; based on the parameters of the current block, various prediction modes are used to predict and encode the to-be-predicted image component to obtain an initial predicted value, and then calculate various predictions based on the initial predicted value. The rate-distortion cost corresponding to each prediction mode in the mode; select the minimum rate-distortion cost (ie, the first minimum rate-distortion cost) from the multiple calculated rate-distortion costs, and determine the minimum rate-distortion cost as the optimal rate-distortion cost cost, the prediction mode corresponding to the optimal rate-distortion cost is determined as the prediction mode of the current block.
在本申请实施例中,在确定编码器遍历所有帧内预测模式,确定出当前块对应的初始预测块的初始预测值,然后还采用IPF和IPS技术,对当前块进行滤波处理后,得到第一类预测值和第二类预测值,采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出各自对应的三种最小率失真代价,再从这三种最小率失真代价中,选择三种中最小的率失真代价,作为最优率失真代价,那么改最优率失真代价对应的预测模式就是当前预测模式。采用当前预测模式,对当前块进行帧内预测,以完成待预测图像分量的预测。In the embodiment of the present application, after determining that the encoder traverses all intra-frame prediction modes, determines the initial prediction value of the initial prediction block corresponding to the current block, and then uses the IPF and IPS technologies to filter the current block, the first block is obtained. The first-class predicted value and the second-class predicted value, the initial predicted value, the first-class predicted value and the second-class predicted value are used to calculate the rate-distortion cost with the original pixel value of the current block respectively, and the three corresponding minimum values are determined. rate-distortion cost, and then select the smallest rate-distortion cost among the three minimum rate-distortion costs as the optimal rate-distortion cost, then the prediction mode corresponding to changing the optimal rate-distortion cost is the current prediction mode. Using the current prediction mode, intra-frame prediction is performed on the current block to complete the prediction of the image component to be predicted.
需要说明的是,帧内预测平滑滤波为采用至少两个相邻参考像素集合中每个相邻参考像素集合中的多个相邻参考像素,对当前块进行滤波的过程。而帧内预测滤波为是采用至少两个相邻参考像素集合中每个相邻参考像素集合中的一个相邻参考像素,对当前块进行滤波的过程。采用帧内预测平滑滤波由于可以参考一个相邻参考像素集合中的多个相邻参考像素,因此,这样的预测会更平滑一些,针对模糊图像的预测也会更精确一些,从而可以提高编码效率。It should be noted that the intra prediction smoothing filtering is a process of filtering the current block by using multiple adjacent reference pixels in each adjacent reference pixel set in at least two adjacent reference pixel sets. Intra-frame prediction filtering is a process of filtering the current block by using one adjacent reference pixel in each adjacent reference pixel set in at least two adjacent reference pixel sets. Intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving coding efficiency. .
在本申请实施例中,编码器采用IPF和IPS技术,对当前块进行滤波处理后,得到第一类预测值和第二类预测值的过程:一种是在得到当前块对应的初始预测块的基础上,再分别对初始预测块进行IPF和IPS的处理的;另一种是编码器重新遍历所有帧内预测模式,开启IPF时,才计算每一种帧内预测模式下的初始预测块,再对初始预测块进行IPF滤波,确定出第一类预测值。然后,编码器再次重新遍历所有帧内预测模式,开启IPS时,才计算每一种帧内预测模式下的初始预测块, 再对初始预测块进行IPS滤波,确定出第二类预测值,本申请实施例不作限制。In the embodiment of the present application, the encoder adopts IPF and IPS technology, and after filtering the current block, the process of obtaining the first type of prediction value and the second type of prediction value: one is to obtain the initial prediction block corresponding to the current block. On the basis of IPF, the initial prediction block is processed by IPF and IPS respectively; the other is that the encoder traverses all intra prediction modes again, and only calculates the initial prediction block in each intra prediction mode when IPF is turned on. , and then perform IPF filtering on the initial prediction block to determine the first type of prediction value. Then, the encoder traverses all intra-frame prediction modes again, and only calculates the initial prediction block in each intra-frame prediction mode when IPS is turned on, and then performs IPS filtering on the initial prediction block to determine the second type of prediction value. The application examples are not limited.
在本申请的一些实施例中,编码器对初始预测块分别进行帧内预测滤波和帧内预测平滑滤波处理,得到第一类预测值和第二类预测值的过程可以为:编码器基于初始预测块中的每个像素的左侧相邻参考像素点和上侧相邻参考像素点,对初始预测块的每个像素进行帧内预测滤波,得到第一类预测值;以及编码器基于初始预测块中的每个像素对应的预设水平距离和预设垂直距离,对初始预测块进行帧内预测平滑滤波处理,得到第二类预测值。In some embodiments of the present application, the encoder performs intra-frame prediction filtering and intra-frame prediction smoothing filtering on the initial prediction block respectively, and the process of obtaining the first type prediction value and the second type prediction value may be: The left adjacent reference pixel point and the upper adjacent reference pixel point of each pixel in the prediction block, perform intra-frame prediction filtering on each pixel of the initial prediction block to obtain the first type of prediction value; and the encoder is based on the initial prediction value. According to the preset horizontal distance and the preset vertical distance corresponding to each pixel in the prediction block, the initial prediction block is subjected to intra-frame prediction smoothing filtering processing to obtain the second type of prediction value.
需要说明的是,编码器对当前块的预测块进行IPF滤波,根据当前遍历的预测模式选择与之相对应的滤波器,根据当前块的尺寸选择相对应的滤波系数组,具体对应关系可查表1,确定出滤波系数之后,基于该滤波系数对预测块进行滤波,得到每一种预测模式的率失真代价,再从中选出最小的就是第二最小率失真代价。It should be noted that the encoder performs IPF filtering on the prediction block of the current block, selects the corresponding filter according to the currently traversed prediction mode, and selects the corresponding filter coefficient group according to the size of the current block. In Table 1, after the filter coefficient is determined, the prediction block is filtered based on the filter coefficient to obtain the rate-distortion cost of each prediction mode, and the smallest one is the second minimum rate-distortion cost.
在本申请的一些实施例中,编码器在进行IPS滤波的过程可以基于初始预测块中的每个像素对应的预设水平距离和预设垂直距离,确定与每个像素对应的至少两个相邻参考像素集合的至少两个相邻参考块范围;从至少两个相邻参考像素集合中,对应确定出属于至少两个相邻参考块范围内的至少两个目标参考像素集合;其中,每个目标参考像素集合中包含至少一个目标参考像素;基于至少两个目标参考像素集合,对每个像素进行帧内预测平滑滤波处理,得到第二类预测值。In some embodiments of the present application, in the process of performing IPS filtering, the encoder may determine, based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the initial prediction block, at least two phases corresponding to each pixel. At least two adjacent reference block ranges of the adjacent reference pixel set; from the at least two adjacent reference pixel sets, correspondingly determine at least two target reference pixel sets belonging to the at least two adjacent reference block ranges; wherein, each The target reference pixel sets include at least one target reference pixel; based on the at least two target reference pixel sets, intra-frame prediction smoothing filtering is performed on each pixel to obtain a second-type prediction value.
在本申请的一些实施例中,编码器从至少两个相邻参考像素集合中,对应确定出属于至少两个相邻参考块范围内的至少两个目标参考像素集合的过程可以为:In some embodiments of the present application, the process of the encoder correspondingly determining at least two target reference pixel sets belonging to the at least two adjacent reference pixel sets from the at least two adjacent reference pixel sets may be:
方式一:编码器从至少两个相邻参考像素集合中,确定每个相邻参考块范围的两个边界像素位置的像素为一个目标参考像素集合,从而确定出至少两个目标参考像素集合。Manner 1: The encoder determines, from at least two adjacent reference pixel sets, pixels at two boundary pixel positions of each adjacent reference block range as a target reference pixel set, thereby determining at least two target reference pixel sets.
方式二:编码器从至少两个相邻参考像素集合中,确定每个相邻参考块范围内的任意像素位置的M个像素为一个目标参考像素集合,从而确定出至少两个目标参考像素集合,其中,M为大于0,且不超过对应的相邻参考像素集合的最大像素数量。Mode 2: The encoder determines, from at least two adjacent reference pixel sets, M pixels at any pixel position within the range of each adjacent reference block as a target reference pixel set, thereby determining at least two target reference pixel sets , where M is greater than 0 and does not exceed the maximum number of pixels in the corresponding adjacent reference pixel set.
在本申请的一些实施例中,至少两个相邻参考像素集合包括:左侧相邻参考像素集合和上侧相邻参考像素集合;至少两个相邻参考块范围包括:左侧相邻参考像素范围和上侧相邻参考像素范围;至少两个目标参考像素集合包括:左侧目标相邻参考像素集合和上侧目标相邻参考像素集合。In some embodiments of the present application, the at least two adjacent reference pixel sets include: a left adjacent reference pixel set and an upper adjacent reference pixel set; the at least two adjacent reference block ranges include: a left adjacent reference pixel set A pixel range and an upper adjacent reference pixel range; the at least two target reference pixel sets include: a left target adjacent reference pixel set and an upper target adjacent reference pixel set.
需要说明的是,至少两个相邻参考像素集合包括:左侧相邻参考像素集合和上侧相邻参考像素集合时,编码器确定当前像素对应的预设水平距离和预设垂直距离,以当前块的当前像素为基准,分别向左右移动预设水平距离,得到第一水平像素位置和第二水平像素位置;以及向上下分别移动预设垂直距离,得到第一垂直像素位置和第二垂直像素位置。基于第一水平像素位置和第二水平像素位置,映射到上侧相邻参考像素集合中,确定出了像素位置的第一边界限和第二边界限,第一边界限和第二边界限之间的像素位置就是当前像素对应的与上侧相邻参考像素集合对应的上侧相邻参考像素范围,基于第一垂直像素位置和第二垂直像素位置,映射到左侧相邻参考像素集合中,确定出了像素位置的第三边界限和第四边界限,第三边界限和第四边界限之间的像素位置就是当前像素对应的与左侧相邻参考像素集合对应的左侧相邻参考像素范围,这样就得到了至少两个相邻参考块范围。针对每个相邻参考像素集合,编码器可以从其对应的相邻参考像素范围所包含的参考像素中选择出至少一个相邻参考像素(即目标参考像素集合)用于进行帧内预测,从而选出了至少两个目标参考像素集合。It should be noted that the at least two adjacent reference pixel sets include: when the left adjacent reference pixel set and the upper adjacent reference pixel set, the encoder determines the preset horizontal distance and the preset vertical distance corresponding to the current pixel to The current pixel of the current block is used as the reference, and the preset horizontal distance is moved left and right to obtain the first horizontal pixel position and the second horizontal pixel position; and the preset vertical distance is moved up and down respectively to obtain the first vertical pixel position and the second vertical pixel position. pixel location. Based on the first horizontal pixel position and the second horizontal pixel position, it is mapped to the upper adjacent reference pixel set, and the first boundary limit and the second boundary limit of the pixel position are determined. The pixel position between is the upper adjacent reference pixel range corresponding to the current pixel corresponding to the upper adjacent reference pixel set. Based on the first vertical pixel position and the second vertical pixel position, it is mapped to the left adjacent reference pixel set. , the third boundary limit and the fourth boundary limit of the pixel position are determined, and the pixel position between the third boundary limit and the fourth boundary limit is the left adjacent reference pixel set corresponding to the current pixel corresponding to the left adjacent pixel set Reference pixel range, so that at least two adjacent reference block ranges are obtained. For each adjacent reference pixel set, the encoder may select at least one adjacent reference pixel (ie, the target reference pixel set) from the reference pixels included in the corresponding adjacent reference pixel range for performing intra prediction, thereby At least two target reference pixel sets are selected.
在本申请实施例中,编码器对当前块的每个像素都是这么进行的,从而完成对当前块的处理、针对当前像素,编码器针对一个相邻参考像素集合选出的目标参考像素集合中参考像素的个数可以是一个,也可以是多个,这是基于当前像素在当前块中的位置决定的。In this embodiment of the present application, the encoder does this for each pixel of the current block, so as to complete the processing of the current block, and for the current pixel, the encoder selects a target reference pixel set for an adjacent reference pixel set The number of reference pixels can be one or more, which is determined based on the position of the current pixel in the current block.
需要说明的是,编码器可以选择每个相邻参考像素范围的边界位置对应的参考像素值组成目标参考像素集合,也可以从每个相邻参考像素范围中选择任意M个参考像素组成目标参考像素集合,其中,M大于0即可,本申请实施例不作限制。It should be noted that the encoder can select the reference pixel value corresponding to the boundary position of each adjacent reference pixel range to form the target reference pixel set, or can select any M reference pixels from each adjacent reference pixel range to form the target reference pixel. A set of pixels, where M may be greater than 0, which is not limited in this embodiment of the present application.
需要说明的是,针对不同的相邻参考像素集合,对应确定的M个参考像素的个数可以是不同的,也可以是相同的,本申请实施例不作限制。例如,上侧相邻参考像素集合对应的目标参考像素集合可以是UPNum个,和左侧相邻参考像素集合对应的目标参考像素集合可以是LFNum个,UPNum和LFNum可以相同,也可以不同。It should be noted that, for different adjacent reference pixel sets, the corresponding determined number of M reference pixels may be different or may be the same, which is not limited in this embodiment of the present application. For example, the target reference pixel set corresponding to the upper adjacent reference pixel set may be UPNum, the target reference pixel set corresponding to the left adjacent reference pixel set may be LFNum, and UPNum and LFNum may be the same or different.
在本申请的一些实施例中,预设水平距离小于等于初始预测块的宽度;预设垂直距离小于等于初始预测块的高度。In some embodiments of the present application, the preset horizontal distance is less than or equal to the width of the initial prediction block; the preset vertical distance is less than or equal to the height of the initial prediction block.
在本申请的一些实施例中,初始预测块的n行m列位置的第一类像素对应的预设水平距离和预设垂直距离,与初始预测块的除n行m列之外的其他类像素对应的预设水平距离和预设垂直距离不 同;n和m为自然数;第一类像素中的每个像素对应的预设水平距离和预设垂直距离至少部分相同,或者均不相同;其他类像素中的每个像素对应的预设水平距离和预设垂直距离至少部分相同,或者均不相同。In some embodiments of the present application, the preset horizontal distance and the preset vertical distance corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are different from those of other types except n rows and m columns of the initial prediction block. The preset horizontal distance and the preset vertical distance corresponding to the pixels are different; n and m are natural numbers; the preset horizontal distance and the preset vertical distance corresponding to each pixel in the first type of pixels are at least partially the same, or both are different; other The preset horizontal distance and the preset vertical distance corresponding to each pixel in the class of pixels are at least partially the same, or both are different.
需要说明的是,预设水平距离和预设垂直距离是相等的,具体的数值可以实现根据实际情况设置在编码器和解码器中,也可以根据当前预测块的大小预设在编码器和解码器中,本申请实施例不作限制。It should be noted that the preset horizontal distance and the preset vertical distance are equal, and the specific values can be set in the encoder and decoder according to the actual situation, or can be preset in the encoder and decoder according to the size of the current prediction block. In the device, the embodiments of the present application are not limited.
在本申请实施例中,初始预测块的n行m列可以是前n行和前m列,也可以是其他的形式,本申请实施例不作限制。In this embodiment of the present application, the n rows and m columns of the initial prediction block may be the first n rows and the first m columns, or may be in other forms, which are not limited in the embodiments of the present application.
示例性的,上述IPS技术对于初始预测块的前n行和前m列滤波处理可以不同,具体为前n行和前m列可以采用第一种位置关系对应的参考像素,而其他非前n行和前m列预测像素滤波可以采用第二种位置关系对应的参考像素。例如,前三行和前三列采用HD和VD均相同,为1,而非前三行和前三列采用HD和VD均相同,为2。Exemplarily, the above-mentioned IPS technology may have different filtering processes for the first n rows and the first m columns of the initial prediction block. Specifically, the first n rows and the first m columns may use the reference pixels corresponding to the first positional relationship, while other non-first n rows and m columns may use the reference pixels corresponding to the first positional relationship. The reference pixels corresponding to the second positional relationship may be used for the filtering of the predicted pixels of the row and the first m columns. For example, the first three rows and the first three columns use the same HD and VD, which is 1, while the first three rows and the first three columns use the same HD and VD, which is 2.
其中,n和m不超过当前块的尺寸,n和m可以相同,也可以不相同,本申请实施例不作限制。Wherein, n and m do not exceed the size of the current block, and n and m may be the same or different, which are not limited in this embodiment of the present application.
在本申请的一些实施例中,编码器可以根据IPF的原理机制,确定滤波系数;基于至少两个目标参考像素集合和滤波系数,对每个像素进行帧内预测平滑滤波处理,得到第二类预测值。In some embodiments of the present application, the encoder may determine filter coefficients according to the principle mechanism of IPF; based on at least two target reference pixel sets and filter coefficients, perform intra-frame prediction smoothing filtering on each pixel to obtain the second type Predictive value.
其中,初始预测块的n行m列位置的第一类像素对应的滤波系数,与初始预测块的除n行m列之外的其他类像素对应的滤波系数不同;n和m为自然数;第一类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同;其他类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同。Among them, the filter coefficients corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are different from the filter coefficients corresponding to other types of pixels except n rows and m columns of the initial prediction block; n and m are natural numbers; The filter coefficients corresponding to each pixel in one type of pixels are at least partially the same, or all different; the filter coefficients corresponding to each pixel in other types of pixels are at least partially the same, or all different.
在本申请实施例中,IPS技术可以拥有多个不同的滤波系数,如当前预测像素处于前n行和前m列所用到的系数与非前n行和非前m列所用的滤波系数不同等,并且,前n行和前m列中的每个像素对应的滤波系数也是可以相同,部分相同,或者均不相同的;非前n行和非前m列中的每个像素对应的滤波系数也是可以相同,部分相同,或者均不相同的。In this embodiment of the present application, the IPS technology may have multiple different filter coefficients, for example, the coefficients used by the current predicted pixel in the first n rows and the first m columns are different from the filter coefficients used in the non-first n rows and non-first m columns, etc. , and the filter coefficients corresponding to each pixel in the first n rows and the first m columns may also be the same, partly the same, or all different; the filter coefficients corresponding to each pixel in the non-first n rows and non-first m columns It can also be the same, partially the same, or all different.
需要说明的是,在本申请实施例的一些实施例中,编码器可以确定权值系数;基于至少两个目标参考像素集合和权值系数,对每个像素进行加权求和,完成帧内预测平滑滤波处理,得到第二类预测值。其中,IPS技术可以拥有多个不同的权值系数,如当前预测像素处于前n行和前m列所用到的系数与非前n行和非前m列所用的权值系数不同等,并且,前n行和前m列中的每个像素对应的权值系数也是可以相同,部分相同,或者均不相同的;非前n行和非前m列中的每个像素对应的权值系数也是可以相同,部分相同,或者均不相同的。It should be noted that, in some embodiments of the embodiments of the present application, the encoder may determine a weight coefficient; based on at least two target reference pixel sets and the weight coefficient, weighted summation is performed on each pixel to complete intra-frame prediction After smoothing and filtering, the second type of predicted value is obtained. Among them, the IPS technology can have multiple different weight coefficients, such as the coefficients used by the current predicted pixel in the first n rows and the first m columns are different from the weight coefficients used in the non-first n rows and non-first m columns, etc., and, The weight coefficients corresponding to each pixel in the first n rows and the first m columns can also be the same, partially the same, or different; the weight coefficients corresponding to each pixel in the non-first n rows and non-first m columns are also Can be the same, partially the same, or all different.
示例性的,编码器使用当前预测像素所在的位置为基准,以水平距离HD和垂直距离VD为偏移,获取上侧相邻UPNum个重建参考像素和左侧LFNum个重建参考像素,将获取到的参考像素与当前预测像素进行滤波,或可以是加权求和,得到精确后的预测像素作为预测块中当前位置的最终预测像素。Exemplarily, the encoder uses the position of the current predicted pixel as a reference, and uses the horizontal distance HD and vertical distance VD as offsets to obtain UPNum reconstruction reference pixels adjacent to the upper side and LFNum reconstruction reference pixels on the left side, and obtain The reference pixel and the current predicted pixel are filtered, or the weighted summation can be used to obtain the accurate predicted pixel as the final predicted pixel of the current position in the predicted block.
示例性的,如图9A所示的距离为2的4个目标参考像素的示意图,a为当前像素,b和c是相邻参考像素范围,编码器获取得到4个参考像素点与预测像素点组成一个5抽头滤波器或加权得到精确修正后的预测像素值,在给出的具体例子中,可以设定4个参考像素点前两行和前两列的系数均为10,未精确修正的预测像素点的加权系数为216,总和需除以256或向右移8位,且前两行和前两列的VD和HD可以设定为1;设定4个参考像素点非前两行和非前两列的加权系数均为13,未精确修正的预测像素点系数为204,总和需除以256或向右移8位。Exemplarily, as shown in the schematic diagram of 4 target reference pixels with a distance of 2 as shown in FIG. 9A , a is the current pixel, b and c are the adjacent reference pixel ranges, and the encoder obtains 4 reference pixels and predicted pixels. A 5-tap filter or weighting is formed to obtain the accurately corrected predicted pixel value. In the specific example given, the coefficients of the first two rows and the first two columns of the four reference pixels can be set to be 10. The weighting coefficient of the predicted pixels is 216, and the sum needs to be divided by 256 or shifted to the right by 8 bits, and the VD and HD of the first two rows and columns can be set to 1; set 4 reference pixels not the first two rows The weighting coefficients of the first two columns and the non-corrected ones are both 13, and the uncorrected predicted pixel coefficient is 204, and the sum needs to be divided by 256 or shifted to the right by 8 bits.
如图9B所示的距离为1的4个目标参考像素的示意图,a为当前像素,b和c是相邻参考像素范围,编码器获取得到4个参考像素点与预测像素点组成一个5抽头滤波器或加权得到精确修正后的预测像素值,在给出的具体例子中,可以设定4个参考像素点的加权系数均为7,未精确修正的预测像素点的加权系数为228,总和需除以256或向右移8位。As shown in Figure 9B, a schematic diagram of 4 target reference pixels with a distance of 1, a is the current pixel, b and c are the adjacent reference pixel ranges, and the encoder obtains 4 reference pixels and predicted pixels to form a 5-tap Filter or weight to obtain the accurately corrected predicted pixel value. In the specific example given, the weighting coefficient of the 4 reference pixels can be set to be 7, and the weighting coefficient of the imprecisely corrected predicted pixel is 228. The sum of Divide by 256 or shift right by 8 bits.
如图9C所示的距离为0的2个目标参考像素的示意图,a为当前像素,b和c是相邻参考像素范围,编码器获取得到2个参考像素点与预测像素点组成一个3抽头滤波器或加权得到精确修正后的预测像素值,在给出的具体例子中,可以设定2个参考像素点的加权系数均为14,未精确修正的预测像素点的加权系数为228,总和需除以256或向右移8位。As shown in Figure 9C, a schematic diagram of two target reference pixels with a distance of 0, a is the current pixel, b and c are the adjacent reference pixel ranges, the encoder obtains two reference pixels and predicted pixels to form a 3-tap Filter or weight to obtain the accurately corrected predicted pixel value. In the specific example given, the weighting coefficient of the two reference pixels can be set to be 14, and the weighting coefficient of the uncorrected predicted pixel is 228. The sum of Divide by 256 or shift right by 8 bits.
在本申请实施例中,编码器进行IPS技术所获取的预测像素可以与其他情况下不同,例如使用4抽头不同滤波系数或其他个数抽头不同滤波系数得到IPS使用的预测像素的第二类预测值等。In this embodiment of the present application, the predicted pixels obtained by the encoder performing the IPS technology may be different from other cases, for example, the second type of prediction of the predicted pixels used by the IPS is obtained by using 4-tap different filter coefficients or different filter coefficients of other taps. value etc.
在本申请的一些实施例中,编码器采用IPS技术对当前块进行滤波时,若需要获取的重建参考像素,即目标参考像素集中的参考像素的坐标超出上侧相邻参考像素集合或左侧相邻参考像素集合 的尺寸范围,还可以对当前块的相邻参考像素集合进行填充后,再进行目标参考像素集合的选取。In some embodiments of the present application, when the encoder uses IPS technology to filter the current block, if the reconstructed reference pixels need to be acquired, that is, the coordinates of the reference pixels in the target reference pixel set exceed the upper adjacent reference pixel set or the left side The size range of the adjacent reference pixel set can also be filled with the adjacent reference pixel set of the current block, and then the target reference pixel set is selected.
在本申请的一些实施例中,当预设水平距离大于初始预测块的宽度时,编码器采用上侧相邻参考像素集合中的最左侧的参考像素向左填充,直至确定出上侧相邻参考块范围的第一边界限时为止,和/或,采用上侧相邻参考像素集合中的最右侧的参考像素向右填充,直至确定出上侧相邻参考块范围的第二边界限时为止;预设垂直距离小于等于初始预测块的高度时,采用左侧相邻参考像素集合中的最下侧的参考像素向下填充,直至确定出左侧相邻参考块范围的第三边界限时为止,和/或,采用左侧相邻参考像素集合中的最上侧的参考像素向上填充,直至确定出左侧相邻参考块范围的第四边界限时为止。In some embodiments of the present application, when the preset horizontal distance is greater than the width of the initial prediction block, the encoder uses the leftmost reference pixel in the upper adjacent reference pixel set to pad to the left until the upper phase is determined. until the first boundary of the range of adjacent reference blocks, and/or, using the rightmost reference pixel in the set of adjacent reference pixels on the upper side to fill to the right, until the second boundary of the range of adjacent reference blocks on the upper side is determined When the preset vertical distance is less than or equal to the height of the initial prediction block, the lowermost reference pixel in the set of adjacent reference pixels on the left side is used to fill down until the third boundary limit of the range of the adjacent reference block on the left side is determined. and/or, the uppermost reference pixel in the set of adjacent reference pixels on the left side is used to fill upwards until the fourth boundary limit of the range of the adjacent reference block on the left side is determined.
示例性的,编码器使用上侧相邻重建像素最左侧的重建参考像素向左填充直到满足需要索取的范围,使用上侧相邻重建像素最右侧的重建参考像素向右填充直到满足需要索取的范围;使用左侧相邻重建像素最上侧的重建参考像素向上填充直到满足需要索取的范围,使用左侧相邻重建像素向下填充直到满足需要索取的范围。上述填充过程也可以使用条件判断的方式替换,超出范围的像素直接索取最边界处像素点等,本申请实施例不做限制。Exemplarily, the encoder fills the leftmost reconstruction reference pixel with the uppermost adjacent reconstructed pixel to the left until the required range is satisfied, and uses the rightmost reconstruction reference pixel of the upper adjacent reconstruction pixel to fill to the right until the requirement is met. The requested range; use the reconstructed reference pixel on the uppermost side of the adjacent reconstructed pixels on the left to fill up until the required range is satisfied, and use the adjacent reconstructed pixels on the left to fill down until the required range is satisfied. The above filling process can also be replaced by a conditional judgment method, and the pixels beyond the range can directly request the pixels at the most boundary, etc., which are not limited in this embodiment of the present application.
需要说明的是,编码器对当前块的预测块进行IPS滤波,根据当前遍历的预测模式选择与之相对应的滤波器,确定出滤波系数之后,基于该滤波系数对预测块进行滤波,得到每一种预测模式的率失真代价,再从中选出最小的就是第三最小率失真代价。It should be noted that the encoder performs IPS filtering on the prediction block of the current block, selects the corresponding filter according to the currently traversed prediction mode, determines the filter coefficient, and filters the prediction block based on the filter coefficient to obtain each filter coefficient. The rate-distortion cost of a prediction mode, and the smallest one is selected to be the third smallest rate-distortion cost.
在本申请的一些实施例中,编码器在得到了第一类预测值和第二类预测值之后,该编码器采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出与初始预测值对应的第一最小率失真代价、与第一类预测值对应的第二最小率失真代价以及与第二类预测值对应的第三最小率失真代价;从第一最小率失真代价、第二最小率失真代价以及第三最小率失真代价中,确定出最小的最优率失真代价;将得到最优率失真代价对应预测模式作为当前预测模式。这样,编码器就可以采用当前预测模式,对当前块进行帧内预测,并将当前预测模式的索引信息,以及滤波标识写入码流,其中,滤波标识表征帧内预测滤波和/或帧内预测平滑滤波对应的标识。In some embodiments of the present application, after the encoder obtains the predicted value of the first type and the predicted value of the second type, the encoder adopts the initial predicted value, the predicted value of the first type and the predicted value of the second type, which are respectively the same as the current predicted value. The original pixel value of the block is subjected to rate-distortion cost calculation, and the first minimum rate-distortion cost corresponding to the initial prediction value, the second minimum rate-distortion cost corresponding to the first type of prediction value, and the first minimum rate-distortion cost corresponding to the second type of prediction value are determined. Three minimum rate-distortion costs; determine the minimum optimal rate-distortion cost from the first minimum rate-distortion cost, the second minimum rate-distortion cost and the third minimum rate-distortion cost; take the prediction mode corresponding to the obtained optimal rate-distortion cost as Current forecast mode. In this way, the encoder can use the current prediction mode to perform intra-frame prediction on the current block, and write the index information of the current prediction mode and the filter flag into the code stream, where the filter flag represents intra-frame prediction filtering and/or intra-frame prediction Predictive smoothing filter corresponding flag.
在本申请实施例中,滤波标识包括:帧内预测滤波允许标识、帧内预测滤波使用标识、帧内预测平滑滤波允许标识和帧内预测平滑滤波使用标识。In this embodiment of the present application, the filtering flags include: an intra-frame prediction filtering permission flag, an intra-frame prediction filtering use flag, an intra-frame prediction smoothing filtering permission flag, and an intra-frame prediction smoothing filtering use flag.
在本申请的一些实施例中,由于本申请均采用了IPF和IPS,因此,编码器确定帧内预测滤波允许标识为有效,以及帧内预测平滑滤波允许标识为有效,并将帧内预测滤波允许标识和帧内预测平滑滤波允许标识写入码流;In some embodiments of the present application, since both IPF and IPS are adopted in the present application, the encoder determines that the intra-frame prediction filtering permission flag is valid, and the intra-frame prediction smoothing filtering permission flag is valid, and sets the intra-frame prediction filtering permission flag to be valid. Allows markers and intra-frame prediction smoothing filtering to allow markers to be written into the stream;
其中,帧内预测滤波使用标识和帧内预测平滑滤波使用标识的传输遵循以下一种传输方式给解码器:The transmission of the intra-frame prediction filtering use flag and the intra-frame prediction smoothing filter use flag follows one of the following transmission modes to the decoder:
当最优率失真代价为第二最小率失真代价时,确定帧内预测滤波使用标识为有效,并将帧内预测滤波使用标识写入码流;When the optimal rate-distortion cost is the second minimum rate-distortion cost, determine that the intra-frame prediction filtering use flag is valid, and write the intra-frame prediction filtering use flag into the code stream;
当最优率失真代价为第三最小率失真代价时,确定帧内预测滤波使用标识为无效,且帧内预测平滑滤波使用标识为有效,并将帧内预测滤波使用标识和帧内预测平滑滤波使用标识写入码流;When the optimal rate-distortion cost is the third minimum rate-distortion cost, it is determined that the intra-frame prediction filtering use flag is invalid, and the intra-frame prediction smoothing filter use flag is valid, and the intra-frame prediction filtering use flag and the intra-frame prediction smoothing filter use flag are determined. Write the code stream using the identifier;
当最优率失真代价为第一最小率失真代价时,确定帧内预测滤波使用标识为无效,且帧内预测平滑滤波使用标识为无效,并将帧内预测滤波使用标识和帧内预测平滑滤波使用标识写入码流。When the optimal rate-distortion cost is the first minimum rate-distortion cost, it is determined that the intra-frame prediction filtering use flag is invalid, and the intra-frame prediction smoothing filter use flag is invalid, and the intra-frame prediction filtering use flag and the intra-frame prediction smoothing filter use flag are determined to be invalid. Write the codestream with the flag.
在本申请实施例中,可以采用二进制数表示是否有效,例如,1表示有效,0表示无效,也可以0表示有效,1表示无效等,具体的设置方式和设置数值本申请实施例不作限制。In the embodiment of the present application, a binary number may be used to indicate whether it is valid, for example, 1 indicates valid, 0 indicates invalid, or 0 indicates valid, 1 indicates invalid, etc. The specific setting method and setting value are not limited in this embodiment of the present application.
可以理解的是,编码器采用帧内预测滤波实现了采用至少两个相邻参考像素集合中每个相邻参考像素集合中的一个相邻参考像素,对当前块进行滤波的过程。采用帧内预测平滑滤波由于可以参考一个相邻参考像素集合中的多个相邻参考像素,因此,这样的预测会更平滑一些,针对模糊图像的预测也会更精确一些,从而可以提高编码效率。It can be understood that the encoder implements the process of filtering the current block by using one adjacent reference pixel in each adjacent reference pixel set in at least two adjacent reference pixel sets by using intra-frame prediction filtering. Intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving coding efficiency. .
在本申请的一些实施例中,待预测分量可以有三种,实现对Y、U、V三个编码通道的编码,即初始预测值的编码类型对应多个编码通道;那么,每个编码通道对应的滤波标识采用同一个标识,或者采用一一对应的标识。In some embodiments of the present application, there may be three types of components to be predicted, to implement the encoding of the three encoding channels of Y, U, and V, that is, the encoding type of the initial predicted value corresponds to multiple encoding channels; then, each encoding channel corresponds to The filtering identifiers of the s are the same identifier, or use one-to-one corresponding identifiers.
也就是说,IPS技术的适用到各个编码通道,其中,亮度分量和色度分量分别使用独立标识位表示IPS技术的使用与否。That is to say, the IPS technology is applicable to each encoding channel, wherein the luminance component and the chrominance component respectively use independent identification bits to indicate whether the IPS technology is used or not.
可以理解的是,编码器使用一个滤波标识针对三种编码通道时,可以节约比特和传输标识位的数据量,减少计算的复杂度。It can be understood that, when the encoder uses one filter flag for three coding channels, it can save bits and data amount of transmitted flag bits, and reduce the computational complexity.
在本申请的一些实施例中,编码器可以先对当前块进行判别,看是否符合可以进行IPS处理的 条件,若不符合,就不采用,或者将当前块划分成符合条件的;若符合,就采用本申请提出的帧内预测方法。其中,In some embodiments of the present application, the encoder may first determine the current block to see if it meets the conditions for IPS processing. The intra-frame prediction method proposed in this application is adopted. in,
当初始预测块的尺寸满足预测面积阈值范围时,允许使用帧内预测平滑滤波进行滤波处理;When the size of the initial prediction block satisfies the prediction area threshold range, it is allowed to use intra prediction smoothing filtering for filtering;
当初始预测块的尺寸大于预测面积阈值范围的上限时,将初始预测块进行划分,得到满足预测面积阈值范围的预测子块;针对预测子块实现帧内预测处理流程。When the size of the initial prediction block is larger than the upper limit of the prediction area threshold range, the initial prediction block is divided to obtain prediction sub-blocks that meet the prediction area threshold range; the intra-frame prediction processing flow is implemented for the prediction sub-block.
其中,预测面积阈值范围可以是不小于4×4或8×8,不超过64×64或32×32,详细的数值可根据实际情况设置。面积过于小的就可以不进行IPS处理,但面积过大的,可以通过划分,使其满足使用IPS条件后,再进行处理。The range of the predicted area threshold can be no less than 4×4 or 8×8, and no more than 64×64 or 32×32, and the detailed value can be set according to the actual situation. If the area is too small, IPS processing can not be performed, but if the area is too large, it can be divided to meet the conditions for using IPS before processing.
可以理解的是,编码器对IPS的使用范围进行限制,对于预测块面积较小的单元不使用IPS技术,以减少传输标识位和降低计算复杂度。It can be understood that the encoder limits the use range of the IPS, and does not use the IPS technology for the unit with a small prediction block area, so as to reduce the transmission identification bits and reduce the computational complexity.
在本申请的一些实施例中,编码器确定出当前块对应的初始预测块的初始预测值之后,采用当前预测模式,对当前块进行帧内预测之前,该编码器可以根据帧内预测模式的类型,确定出预测模式集合,预测模式集合为启用帧内预测平滑滤波技术的预测模式;针对初始预测值中,采用预测模式集合预测出的初始子预测值,进行帧内预测平滑滤波处理,得到第二类预测值;采用初始预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式。In some embodiments of the present application, after determining the initial prediction value of the initial prediction block corresponding to the current block, the encoder adopts the current prediction mode, and before performing intra prediction on the current block, the encoder may Type, the prediction mode set is determined, and the prediction mode set is the prediction mode that enables the intra-frame prediction smoothing filtering technology; for the initial prediction value, the initial sub-prediction value predicted by the prediction mode set is used to perform intra-frame prediction smoothing filtering. The second type of prediction value; the initial prediction value and the second type of prediction value are used to calculate the rate-distortion cost with the original pixel value of the current block respectively, and the current prediction mode corresponding to the optimal rate-distortion cost is determined.
可以理解的是,编码器对IPS的使用范围进行限制,对于当前块的预测模式进行筛选,仅对部分预测模式使用IPS技术,以减少传输标识位和降低计算复杂度。It is understandable that the encoder limits the scope of use of the IPS, filters the prediction modes of the current block, and only uses the IPS technology for part of the prediction modes, so as to reduce transmission flag bits and reduce computational complexity.
在本申请的一些实施例中,编码器得到第一类预测值和第二类预测值的方式,还可以包括:In some embodiments of the present application, the manner in which the encoder obtains the predicted value of the first type and the predicted value of the second type may further include:
编码器在遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值之后,采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式之前,对初始预测块分别进行帧内预测滤波,得到第一类预测值;遍历帧内预测模式,采用帧内预测平滑滤波处理对当前块进行预测估计,得到第二类预测值。After traversing the intra-frame prediction mode and determining the initial prediction value of the initial prediction block corresponding to the current block, the encoder uses the initial prediction value, the first-type prediction value and the second-type prediction value to compare with the original pixel value of the current block respectively. Calculate the rate-distortion cost. Before determining the current prediction mode corresponding to the optimal rate-distortion cost, perform intra-frame prediction filtering on the initial prediction block to obtain the first type of prediction value; traverse the intra-frame prediction mode and use intra-frame prediction smoothing filtering. Perform prediction estimation on the current block to obtain the second type of prediction value.
也就是说,编码器可以再遍历帧内预测模式,基于当前块中的每个像素对应的预设水平距离和预设垂直距离,对当前块进行帧内预测平滑滤波处理,得到第二类预测值;而不用对初始预测值进行滤波处理。其中,编码器对当前块进行滤波处理的实现原理与前述实施例中对初始预测块进行滤波的原理一致,此处不再赘述。That is to say, the encoder can traverse the intra prediction mode again, and based on the preset horizontal distance and preset vertical distance corresponding to each pixel in the current block, perform intra prediction smoothing filtering processing on the current block to obtain the second type of prediction value; without filtering the initial predicted value. Wherein, the implementation principle of the filter processing performed on the current block by the encoder is the same as the principle of filtering the initial prediction block in the foregoing embodiment, and details are not described herein again.
示例性的,编码器获取编码信息,包括帧内预测滤波(IPF)允许标识位以及本技术方案(IPS)的允许标识位等,获取图像信息后将图像划分成若干个CTU,进一步再划分成若干个CU,每个独立CU都进行帧内预测,当前CU可以限制最小面积和最大面积进行IPS技术。Exemplarily, the encoder obtains coding information, including intra-frame prediction filtering (IPF) allowable identification bits and the allowable identification bits of this technical solution (IPS), etc., and after obtaining the image information, the image is divided into several CTUs, and further divided into several CTUs. Several CUs, each independent CU performs intra-frame prediction, the current CU can limit the minimum area and the maximum area for IPS technology.
在编码端的帧内预测过程中,若IPF允许标识位和IPS允许标识位都为‘1’,则执行如下所有步骤;若IPF允许标识位为‘1’且IPS允许标识位为‘0’,则仅执行a)、b)、c)、d)、e)、和h);若IPF允许标识位为‘0’且IPS允许标识位为‘1’,则仅执行a)、b)、f)、g)、和h);若IPF允许标识位和IPS允许标识位都为‘0’,则仅执行a)、b)和h)。上述若IPF或IPS允许标识位为‘0’,则编码端默认所有编码块的对应技术的使用标识位为‘0’:In the intra-frame prediction process at the encoding end, if the IPF allowable flag bit and the IPS allowable flag bit are both '1', perform all the following steps; if the IPF allowable flag bit is '1' and the IPS allowable flag bit is '0', Then only a), b), c), d), e), and h) are executed; if the IPF allowable flag is '0' and the IPS allowable flag is '1', only a), b), f), g), and h); if both the IPF allow flag and the IPS allow flag are '0', only a), b) and h) are performed. If the above-mentioned IPF or IPS allows the flag bit to be '0', then the coding end defaults to the use flag bit of the corresponding technology of all coding blocks to be '0':
a)、当前编码单元遍历所有帧内预测模式,计算得到每一种预测模式下的预测块,根据原始像素块计算得到当前预测模式的率失真代价信息;a), the current coding unit traverses all intra-frame prediction modes, calculates the prediction block under each prediction mode, and calculates the rate-distortion cost information of the current prediction mode according to the original pixel block;
b)、根据上述所有预测模式率失真代价最小原则,选择出当前编码单元的最优预测模式,记录最优预测模式信息和与之对应的率失真代价信息;b), select the optimal prediction mode of the current coding unit according to the principle of the minimum rate-distortion cost of all the above-mentioned prediction modes, and record the optimal prediction mode information and the corresponding rate-distortion cost information;
c)、对所有帧内预测模式进行遍历,此过程使用IPF技术,首先计算每一种帧内预测模式下的预测像素,得到当前编码单元的预测块;c), traverse all intra-frame prediction modes, this process uses IPF technology, first calculates the predicted pixels under each intra-frame prediction mode, and obtains the prediction block of the current coding unit;
d)、对当前编码单元的预测块进行IPF滤波,根据当前预测模式选择与之相对应的滤波器,根据当前编码单元尺寸选择相对应的滤波系数组,具体对应关系可查表1;d), carry out IPF filtering to the prediction block of the current coding unit, select the corresponding filter according to the current prediction mode, select the corresponding filter coefficient group according to the current coding unit size, and the specific correspondence can look up Table 1;
e)、根据上述经过IPF滤波技术得到的最终预测像素与原始像素计算得到每一种预测模式的率失真代价信息,记录最小率失真代价信息的预测模式和对应代价值;e), calculate the rate-distortion cost information of each prediction mode according to the final prediction pixel and original pixel obtained through the above-mentioned IPF filtering technology, and record the prediction mode and the corresponding cost value of the minimum rate-distortion cost information;
f)、对所有帧内预测模式进行遍历,此过程使用IPS技术,计算每一种帧内预测模式下的预测像素,计算预测像素过程使用IPS技术,具体可以为若干个抽头插值滤波器加上若干个参考像素作为新的插值滤波器预测得到该过程的预测像素,上述若干个抽头插值滤波器可以为8个抽头滤波器,上述若干个参考像素可以为4个,获取上述若干个参考像素的过程如下:以各预测像素所在的位置为基准,以水平距离HD和垂直距离VD为偏移,获取上侧相邻UPNum个重建参考像素和左侧 LFNum个重建参考像素。上述HD与VD可以取值为0,1,2,3,…,N等,N不超过当前块的宽或高。上述UPNum与LFNum可以取值为0,1,2,3,…,M等,M不超过当前块上侧相邻重建参考像素个数和左侧相邻重建参考像素个数;f), traverse all intra-frame prediction modes, this process uses IPS technology, calculates the predicted pixels under each intra-frame prediction mode, and calculates the predicted pixel process using IPS technology, which can be added for several tap interpolation filters. Several reference pixels are used as new interpolation filters to predict the predicted pixels of the process. The above-mentioned several tap interpolation filters can be 8 tap filters, and the above-mentioned several reference pixels can be 4. The above-mentioned several reference pixels are obtained. The process is as follows: taking the position of each predicted pixel as a reference, and taking the horizontal distance HD and vertical distance VD as offsets, obtain UPNum reconstruction reference pixels adjacent to the upper side and LFNum reconstruction reference pixels on the left side. The above HD and VD can be 0, 1, 2, 3, ..., N, etc., and N does not exceed the width or height of the current block. The above UPNum and LFNum can be 0, 1, 2, 3, ..., M, etc., and M does not exceed the number of adjacent reconstruction reference pixels on the upper side of the current block and the number of adjacent reconstruction reference pixels on the left side;
g)、根据上述经过IPS技术得到的最终预测像素与原始像素计算得到每一种预测模式的率失真代价信息,记录最小率失真代价信息的预测模式和对应代价值;g), calculate the rate-distortion cost information of each prediction mode according to the final predicted pixel obtained through the IPS technology and the original pixel, and record the prediction mode and the corresponding cost value of the minimum rate-distortion cost information;
h)、若IPF允许标识位为‘0’且IPS允许标识位为‘0’,则将b)中记录的预测模式索引经码流传输给解码端;若IPF允许标识位为‘1’且IPS允许标识位为‘0’,则将b)中记录的最小代价值与e)中记录的最小代价值进行比较,若b)中的率失真代价更小,则将b)中记录的预测模式索引编码作为当前编码单元的最优预测模式经码流传输给解码端,将IPF当前编码单元标识位置‘0’,表示不使用IPF技术,也经码流传输给解码端;若e)中的率失真更小,则将e)中记录的预测模式引编码作为当前编码单元的最优预测模式经码流传输给解码端,将IPF当前编码单元标识位置‘1’,表示使用IPF技术,也经码流传输给解码端;若IPF允许标识位为‘0’且IPS允许标识位为‘1’,则将b)中记录的最小代价值与g)中记录的最小代价值进行比较,若b)中的率失真代价更小,则将b)中记录的预测模式索引编码作为当前编码单元的最优预测模式经码流传输给解码端,将当前编码单元的IPS使用标识位置‘0’,表示不使用该技术,也经码流传输给解码端;若g)中的率失真更小,则将g)中记录的预测模式引编码作为当前编码单元的最优预测模式经码流传输给解码端,将当前编码单元的IPS使用标识位置‘1’,表示使用该技术,也经码流传输给解码端;若IPF允许标识位为‘1’且IPS允许标识位为‘1’,则将b)、e)和g)中记录的最小代价值进行比较,若b)中的率失真代价更小,则将b)中记录的预测模式索引编码作为当前编码单元的最优预测模式经码流传输给解码端,将当前编码单元的IPS使用标识位和IPF使用标识位置‘0’,表示均不使用,也经码流传输给解码端;若e)中的率失真更小,则将e)中记录的预测模式引编码作为当前编码单元的最优预测模式经码流传输给解码端,将当前编码单元的IPF使用标识位置‘1’且不传输IPS使用标识位,表示使用IPF技术而不使用IPS技术,也经码流传输给解码端;若a)、中的率失真更小,则将g)中记录的预测模式引编码作为当前编码单元的最优预测模式经码流传输给解码端,将当前编码单元的IPF使用标识位置‘0’且IPS使用标识位置‘1’,表示不使用IPF技术而使用IPS技术,也经码流传输给解码端。h), if the IPF allows the identification bit to be '0' and the IPS allows the identification bit to be '0', then transmit the prediction mode index recorded in b) to the decoding end through the code stream; if the IPF allows the identification bit to be '1' and If the IPS allows the flag bit to be '0', compare the minimum cost value recorded in b) with the minimum cost value recorded in e), and if the rate-distortion cost in b) is smaller, compare the prediction recorded in b) The mode index coding is used as the optimal prediction mode of the current coding unit and is transmitted to the decoding end through the code stream, and the IPF current coding unit identification position is '0', indicating that the IPF technology is not used, and is also transmitted to the decoding end through the code stream; if e) in The rate distortion is smaller, then the prediction mode index code recorded in e) is transmitted to the decoding end as the optimal prediction mode of the current coding unit through the code stream, and the IPF current coding unit identification position '1' indicates that the IPF technology is used, It is also transmitted to the decoding end through the code stream; if the IPF allows the identification bit to be '0' and the IPS allows the identification bit to be '1', then compare the minimum cost value recorded in b) with the minimum cost value recorded in g), If the rate-distortion cost in b) is smaller, then use the prediction mode index encoding recorded in b) as the optimal prediction mode of the current coding unit and transmit it to the decoding end through the code stream, and use the IPS identifier position '0 of the current coding unit ', indicating that this technology is not used, and it is also transmitted to the decoding end through the code stream; if the rate-distortion in g) is smaller, the prediction mode recorded in g) will be encoded as the optimal prediction mode of the current coding unit through the code stream It is transmitted to the decoding end, and the IPS use flag position of the current coding unit is '1', indicating that this technology is used, and it is also transmitted to the decoding end through the code stream; if the IPF allowable flag bit is '1' and the IPS allowable flag bit is '1' , then compare the minimum cost values recorded in b), e) and g), if the rate-distortion cost in b) is smaller, then encode the prediction mode index recorded in b) as the optimal prediction for the current coding unit The mode is transmitted to the decoding end through the code stream, and the IPS use identification bit and the IPF use identification position of the current coding unit are '0', indicating that they are not used, and are also transmitted to the decoding end through the code stream; if the rate distortion in e) is smaller , then the prediction mode index code recorded in e) is transmitted to the decoding end as the optimal prediction mode of the current coding unit through the code stream, and the IPF of the current coding unit uses the identification position '1 ' and does not transmit the IPS to use the identification position, indicating Using IPF technology instead of IPS technology, it is also transmitted to the decoding end through the code stream; if the rate-distortion in a), is smaller, then use the prediction mode recorded in g) as the optimal prediction mode of the current coding unit. The code stream is transmitted to the decoding end, and the IPF usage flag position of the current coding unit is '0' and the IPS usage flag position is '1', indicating that the IPF technology is not used but the IPS technology is used, and is also transmitted to the decoding end through the code stream.
编码器最后将预测块和反变换、反量化后的残差叠加得到重建后的编码单元块,作为下一个编码块的预测参考块。Finally, the encoder superimposes the predicted block and the inversely transformed and inversely quantized residuals to obtain a reconstructed coding unit block, which is used as a prediction reference block for the next coding block.
本申请实施例提供了一种帧内预测方法,如图10所示,包括:An embodiment of the present application provides an intra-frame prediction method, as shown in FIG. 10 , including:
S201、遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值。S201. Traverse the intra-frame prediction mode to determine the initial prediction value of the initial prediction block corresponding to the current block.
S202、对初始预测块分别进行帧内预测平滑滤波处理,得到第二类预测值;其中,帧内预测平滑滤波为采用至少两个相邻参考像素集合中每个相邻参考像素集合中的多个相邻参考像素,对当前块进行滤波的过程。S202: Perform intra-frame prediction smoothing filtering processing on the initial prediction block respectively, to obtain a second type of prediction value; wherein, the intra-frame prediction smoothing filtering is performed by using the multi-dimensional data in each adjacent reference pixel set in at least two adjacent reference pixel sets. The process of filtering the current block with adjacent reference pixels.
S203、采用初始预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式。S203 , using the initial predicted value and the second-type predicted value, respectively perform rate-distortion cost calculation with the original pixel value of the current block, and determine the current prediction mode corresponding to the optimal rate-distortion cost.
S204、采用当前预测模式,对当前块进行帧内预测。S204. Using the current prediction mode, perform intra-frame prediction on the current block.
S205、将当前预测模式的索引信息,以及滤波标识写入码流,其中,滤波标识表征帧内预测平滑滤波对应的标识。S205: Write the index information of the current prediction mode and the filter flag into the code stream, where the filter flag represents the flag corresponding to the intra-frame prediction smoothing filter.
在本申请实施例中,编码器可以只判断是否进行IPS就可以,不依赖IPF技术的实现基础上,那么就是帧内预测平滑滤波允许标识有效。In the embodiment of the present application, the encoder can only determine whether to perform IPS, and it is not dependent on the implementation of the IPF technology, so that the intra-frame prediction smoothing filtering permission flag is valid.
在本申请实施例中,编码器可以只进行了IPS,这样开启IPS技术时,编码器对初始预测块分别进行帧内预测平滑滤波处理,得到第二类预测值,该编码器只需要采用初始预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式即可。详细的滤波处理方式跟前述实施例的实现一致,此处不再赘述。In this embodiment of the present application, the encoder may only perform IPS, so that when the IPS technology is enabled, the encoder performs intra-frame prediction smoothing filtering on the initial prediction blocks respectively to obtain the second type of prediction value, and the encoder only needs to use the initial prediction block. The predicted value and the second type of predicted value are respectively calculated with the original pixel value of the current block to calculate the rate-distortion cost, and the current prediction mode corresponding to the optimal rate-distortion cost can be determined. The detailed filtering processing method is consistent with the implementation of the foregoing embodiment, and is not repeated here.
在本申请实施例中,滤波标识包括:帧内预测平滑滤波允许标识和帧内预测平滑滤波使用标识。编码器将当前预测模式的索引信息写入码流;确定帧内预测平滑滤波允许标识为有效,并将帧内预测平滑滤波允许标识写入码流。In this embodiment of the present application, the filtering flag includes: an intra-frame prediction smoothing filtering permission flag and an intra-frame prediction smoothing filtering use flag. The encoder writes the index information of the current prediction mode into the code stream; determines that the intra-frame prediction smoothing filtering permission flag is valid, and writes the intra-frame prediction smoothing filtering permission flag into the code stream.
帧内预测平滑滤波使用标识的传输方式为以下之一:Intra-frame prediction smoothing filtering uses one of the following transmission modes:
当最优率失真代价为第三最小率失真代价时,确定帧内预测平滑滤波使用标识为有效,并将帧内预测平滑滤波使用标识写入码流。When the optimal rate-distortion cost is the third minimum rate-distortion cost, it is determined that the intra-frame prediction smoothing filtering use flag is valid, and the intra-frame prediction smoothing filtering use flag is written into the code stream.
当最优率失真代价为第一最小率失真代价时,确定帧内预测平滑滤波使用标识为无效,并将帧内预测平滑滤波使用标识写入码流。When the optimal rate-distortion cost is the first minimum rate-distortion cost, it is determined that the intra-frame prediction smoothing filtering use flag is invalid, and the intra-frame prediction smoothing filtering use flag is written into the code stream.
示例性的,编码器获取编码信息,包括帧内预测滤波(IPF)允许标识位以及本技术方案(IPS)的允许标识位等,获取图像信息后将图像划分成若干个CTU,进一步再划分成若干个CU,每个独立CU都进行帧内预测,当前CU可以限制最小面积和最大面积进行IPS技术。Exemplarily, the encoder obtains coding information, including intra-frame prediction filtering (IPF) allowable identification bits and the allowable identification bits of this technical solution (IPS), etc., and after obtaining the image information, the image is divided into several CTUs, and further divided into several CTUs. Several CUs, each independent CU performs intra-frame prediction, the current CU can limit the minimum area and the maximum area for IPS technology.
在编码端帧内预测过程中,若IPF允许标识位和IPS允许标识位都为‘1’,则执行如下所有步骤;若IPF允许标识位为‘1’且IPS允许标识位为‘0’,则仅执行a)、b)、c)、d)、e)、和i);若IPF允许标识位为‘0’且IPS允许标识位为‘1’,则仅执行a)、b)、f)、g)、h)、和i);若IPF允许标识位和IPS允许标识位都为‘0’,则仅执行a)、b)和i)。上述若IPF或IPS允许标识位为‘0’,则编码端默认所有编码块的对应技术的使用标识位为‘0’:During the intra-frame prediction process at the coding end, if the IPF allowable flag bit and the IPS allowable flag bit are both '1', perform all the following steps; if the IPF allowable flag bit is '1' and the IPS allowable flag bit is '0', Then only execute a), b), c), d), e), and i); if the IPF allow flag bit is '0' and the IPS allow flag bit is '1', then only execute a), b), f), g), h), and i); if both the IPF allow flag and the IPS allow flag are '0', only execute a), b) and i). If the above-mentioned IPF or IPS allows the flag bit to be '0', then the coding end defaults to the use flag bit of the corresponding technology of all coding blocks to be '0':
a)、当前编码单元遍历所有帧内预测模式,计算得到每一种预测模式下的预测块,根据原始像素块计算得到当前预测模式的率失真代价信息;a), the current coding unit traverses all intra-frame prediction modes, calculates the prediction block under each prediction mode, and calculates the rate-distortion cost information of the current prediction mode according to the original pixel block;
b)、根据上述所有预测模式率失真代价最小原则,选择出当前编码单元的最优预测模式,记录最优预测模式信息和与之对应的率失真代价信息;b), select the optimal prediction mode of the current coding unit according to the principle of the minimum rate-distortion cost of all the above-mentioned prediction modes, and record the optimal prediction mode information and the corresponding rate-distortion cost information;
c)、对所有帧内预测模式进行遍历,此过程使用IPF技术,首先计算每一种帧内预测模式下的预测像素,得到当前编码单元的预测块;c), traverse all intra-frame prediction modes, this process uses IPF technology, first calculates the predicted pixels under each intra-frame prediction mode, and obtains the prediction block of the current coding unit;
d)、对当前编码单元的预测块进行IPF滤波,根据当前预测模式选择与之相对应的滤波器,根据当前编码单元尺寸选择相对应的滤波系数组,具体对应关系可查表1;d), carry out IPF filtering to the prediction block of the current coding unit, select the corresponding filter according to the current prediction mode, select the corresponding filter coefficient group according to the current coding unit size, and the specific correspondence can look up Table 1;
e)、根据上述经过IPF滤波技术得到的最终预测像素与原始像素计算得到每一种预测模式的率失真代价信息,记录最小率失真代价信息的预测模式和对应代价值;e), calculate the rate-distortion cost information of each prediction mode according to the final prediction pixel and original pixel obtained through the above-mentioned IPF filtering technology, and record the prediction mode and the corresponding cost value of the minimum rate-distortion cost information;
f)、对所有帧内预测模式进行遍历,此过程使用IPS技术,首先计算每一种帧内预测模式下的预测像素,得到当前编码单元的预测块。该过程计算帧内预测像素的插值滤波器可以与步骤a)和c)不同,使用更强的滤波器可以得到更平滑的预测像素,具体实施可以为角度预测模式采用8个抽头插值滤波器,示例性的,滤波系数可以如下4组所示,每组可以包括32种8抽头的滤波系数。f) traversing all intra-frame prediction modes, this process uses IPS technology, first calculates the predicted pixels in each intra-frame prediction mode, and obtains the prediction block of the current coding unit. The interpolation filter for calculating intra-frame predicted pixels in this process may be different from steps a) and c), and a stronger filter can be used to obtain smoother predicted pixels. The specific implementation can be an 8-tap interpolation filter for the angle prediction mode, Exemplarily, the filter coefficients may be shown in the following 4 groups, and each group may include 32 types of 8-tap filter coefficients.
一组:{15,99,238,315,237,101,18,1},{14,95,233,315,242,105,19,1},{13,91,229,315,246,109,20,1},{12,89,226,314,248,112,22,1},{11,84,220,314,253,117,24,1},{10,81,217,313,257,120,25,1},{9,77,211,312,262,125,27,1},{8,74,208,311,265,129,28,1},{7,71,203,310,269,133,30,1},{7,68,200,309,271,136,32,1},{6,65,195,307,275,141,34,1},{5,62,190,304,278,146,37,2},{5,59,185,302,282,150,39,2},{4,56,182,301,285,154,40,2},{4,54,177,298,287,158,43,3},{3,51,172,296,290,163,46,3},{3,48,167,294,294,167,48,3},{3,46,163,290,296,172,51,3},{3,43,158,287,298,177,54,4},{2,40,154,285,301,182,56,4},{2,39,150,282,302,185,59,5},{2,37,146,278,304,190,62,5},{1,34,141,275,307,195,65,6},{1,32,136,271,309,200,68,7},{1,30,133,269,310,203,71,7},{1,28,129,265,311,208,74,8},{1,27,125,262,312,211,77,9},{1,25,120,257,313,217,81,10},{1,24,117,253,314,220,84,11},{1,22,112,248,314,226,89,12},{1,20,109,246,315,229,91,13},{1,19,105,242,315,233,95,14};A set: {15,99,238,315,237,101,18,1},{14,95,233,315,242,105,19,1},{13,91,229,315,246,109,20,1},{12,89,226,314,248,112,22,1},2,54,24 1},{10,81,217,313,257,120,25,1},{9,77,211,312,262,125,27,1},{8,74,208,311,265,129,28,1},{7,71,203,310,269,133,30,1},{7,68,200 1},{6,65,195,307,275,141,34,1},{5,62,190,304,278,146,37,2},{5,59,185,302,282,150,39,2},{4,56,182,301,285,154,40,2},{4,54,1877,29 3},{3,51,172,296,290,163,46,3},{3,48,167,294,294,167,48,3},{3,46,163,290,296,172,51,3},{3,43,158,287,298,177,54,4},{2,40,254,528 4},{2,39,150,282,302,185,59,5},{2,37,146,278,304,190,62,5},{1,34,141,275,307,195,65,6},{1,32,136,271,309,200,68,7},{1,3,2,3,79,30,133, 7},{1,28,129,265,311,208,74,8},{1,27,125,262,312,211,77,9},{1,25,120,257,313,217,81,10},{1,24,117,253,314,220,84,11},{1,22,11 12}, {1, 20, 109, 246, 315, 229, 91, 13}, {1, 19, 105, 242, 315, 233, 95, 14};
二组:{7,92,245,339,245,91,6,-1},{6,87,239,339,250,96,8,-1},{5,83,236,339,255,99,8,-1},{4,80,231,338,259,103,10,-1},{3,75,226,338,265,108,11,-2},{1,70,220,337,271,114,13,-2},{1,67,217,337,275,117,13,-3},{0,64,211,335,279,122,16,-3},{-1,61,206,333,283,127,18,-3},{-1,57,202,332,287,131,19,-3},{-2,53,196,330,292,137,21,-3},{-3,49,190,328,297,142,24,-3},{-3,47,187,326,300,146,25,-4},{-3,43,181,324,305,151,27,-4},{-3,41,177,321,308,155,29,-4},{-4,37,171,319,312,161,32,-4},{-4,35,166,315,315,166,35,-4},{-4,32,161,312,319,171,37,-4},{-4,29,155,308,321,177,41,-3},{-4,27,151,305,324,181,43,-3},{-4,25,146,300,326,187,47,-3},{-3,24,142,297,328,190,49,-3},{-3,21,137,292,330,196,53,-2},{-3,19,131,287,332,202,57,-1},{-3,18,127,283,333,206,61,-1},{-3,16,122,279,335,211,64,0},{-3,13,117,275,337,217,67,1},{-2,13,114,271,337,220,70,1},{-2,11,108,265,338,226,75,3},{-1,10,103,259,338,231,80,4},{-1,8,99,255,339,236,83,5},{-1,8,96,250,339,239,87,6};Two groups: {7,92,245,339,245,91,6,-1},{6,87,239,339,250,96,8,-1},{5,83,236,339,255,99,8,-1},{4,80,231,338,259,103,10,- 1},{3,75,226,338,265,108,11,-2},{1,70,220,337,271,114,13,-2},{1,67,217,337,275,117,13,-3},{0,64,211,335,279,122,16,-3},{-1 ,61,206,333,283,127,18,-3},{-1,57,202,332,287,131,19,-3},{-2,53,196,330,292,137,21,-3},{-3,49,190,328,297,142,24,,326,47,1 ,25,-4},{-3,43,181,324,305,151,27,-4},{-3,41,177,321,308,155,29,-4},{-4,37,171,319,312,161,32,-4},{-4,35,166,315,315,166,35 ,-4},{-4,32,161,312,319,171,37,-4},{-4,29,155,308,321,177,41,-3},{-4,27,151,305,324,181,43,-3},{-4,25,146,300,326,187,47,- 3},{-3,24,142,297,328,190,49,-3},{-3,21,137,292,330,196,53,-2},{-3,19,131,287,332,202,57,-1},{-3,18,127,283,333,206,61,-1} ,{-3,16,122,279,335,211,64,0},{-3,13,117,275,337,217,67,1},{-2,13,114,271,337,220,70,1},{-2,11,108,215,338,226,75,3},{-1,10,23,1 ,80,4},{-1,8,99,255,339,236,83,5},{-1,8,96,250,339,239,87,6};
三组:{0,42,125,178,125,42,0,0},{-1,40,121,177,128,46,1,0},{-1,37,118,177,130,48,3,0},{-1,36,116,176,133,50,3,-1},{-1,34,114,176,135,52,3,-1},{-2,32,110,175,138,56,4,-1},{-3,30,107,174,141,59,5,-1},{-3,29,106,173,142,60,6,-1},{-3,28,104,172,143,62,7,-1},{-3,25,101,172,146,64,8,-1},{-4,23,97,171,149,68,9,-1},{-4,21,94,170,152,71,10,-2},{-4,19,91,168,156,74,11,-3},{-3,19,91,167,155,74,12,-3},{-3,20,90,165,155,75,13,-3},{-3,18,87,163,157,79,14,-3},{-3,16,83,160,160,83,16,-3},{-3,14,79,157,163,87,18,-3},{-3,13,75,155,165,90,20,-3},{-3,12,74,155,167,91,19,-3},{-3,11,74,156,168,91,19,-4},{-2,10,71,152,170,94,21,-4},{-1,9,68,149,171,97,23,-4},{-1,8,64,146,172,101,25,-3},{-1,7,62,143,172,104,28,-3},{-1,6,60,142,173,106,29,-3},{-1,5,59,141,174,107,30,-3},{-1,4,56,138,175,110,32,-2},{-1,3,52,135,176,114,34,-1},{-1,3,50,133,176,116,36, -1},{0,3,48,130,177,118,37,-1},{0,1,46,128,177,121,40,-1};Three groups: {0,42,125,178,125,42,0,0},{-1,40,121,177,128,46,1,0},{-1,37,118,177,130,48,3,0},{-1,36,116,176,133,50,3 ,-1},{-1,34,114,176,135,52,3,-1},{-2,32,110,175,138,56,4,-1},{-3,30,107,174,141,59,5,-1},{-3 ,29,106,173,142,60,6,-1},{-3,28,104,172,143,62,7,-1},{-3,25,101,172,146,64,8,-1},{-4,23,97,171,149,68,9 ,-1},{-4,21,94,170,152,71,10,-2},{-4,19,91,168,156,74,11,-3},{-3,19,91,167,155,74,12,- 3},{-3,20,90,165,155,75,13,-3},{-3,18,87,163,157,79,14,-3},{-3,16,83,160,160,83,16,-3} ,{-3,14,79,157,163,87,18,-3},{-3,13,75,155,165,90,20,-3},{-3,12,74,155,167,91,19,-3},{ -3,11,74,156,168,91,19,-4},{-2,10,71,152,170,94,21,-4},{-1,9,68,149,171,97,23,-4},{-1 ,8,64,146,172,101,25,-3},{-1,7,62,143,172,104,28,-3},{-1,6,60,142,173,106,29,-3},{-1,5,59,141,174,107,30,- 3},{-1,4,56,138,175,110,32,-2},{-1,3,52,135,176,114,34,-1},{-1,3,50,133,176,116,36, -1},{0,3, 48,130,177,118,37,-1},{0,1,46,128,177,121,40,-1};
四组:{21,105,235,302,235,105,21,0},{21,102,231,300,237,108,24,1},{20,100,227,298,239,113,26,1},{19,97,223,296,241,117,29,2},{19,94,218,294,243,121,32,3},{18,92,214,292,246,125,34,3},{17,89,210,290,248,129,37,4},{17,86,206,288,250,133,39,5},{16,84,202,286,252,137,42,5},{15,81,198,284,254,141,45,6},{15,78,194,282,256,145,47,7},{14,76,190,280,258,149,50,7},{13,73,186,277,260,154,53,8},{12,71,182,275,262,158,55,9},{12,68,178,273,264,162,58,9},{11,65,174,271,267,166,60,10},{10,63,170,269,269,170,63,10},{10,60,166,267,271,174,65,11},{9,58,162,264,273,178,68,12},{9,55,158,262,275,182,71,12},{8,53,154,260,277,186,73,13},{7,50,149,258,280,190,76,14},{7,47,145,256,282,194,78,15},{6,45,141,254,284,198,81,15},{5,42,137,252,286,202,84,16},{5,39,133,250,288,206,86,17},{4,37,129,248,290,210,89,17},{3,34,125,246,292,214,92,18},{3,32,121,243,294,218,94,19},{2,29,117,241,296,223,97,19},{1,26,113,239,298,227,100,20},{1,24,108,237,300,231,102,21}。Four groups: 21,105,235,302,235,105,21,0 {}, {} 21,102,231,300,237,108,24,1, 20,100,227,298,239,113,26,1 {}, {} 19,97,223,296,241,117,29,2, 19,94,218,294,243,121,32,3 {}, {18, 92,214,292,246,125,34,3},{17,89,210,290,248,129,37,4},{17,86,206,288,250,133,39,5},{16,84,202,286,252,137,42,5},{15,8,1,141,98,28 78,194,282,256,145,47,7},{14,76,190,280,258,149,50,7},{13,73,186,277,260,154,53,8},{12,71,182,275,262,158,55,9},{12,6,162,58,273,162,58,27 65,174,271,267,166,60,10},{10,63,170,269,269,170,63,10},{10,60,166,267,271,174,65,11},{9,58,162,264,273,17,8,68,12},{9,52}{2,78,27,2} 53,154,260,277,186,73,13},{7,50,149,258,280,190,76,14},{7,47,145,256,282,194,78,15},{6,45,141,254,284,198,81,15},{5,42,13,87,25 39,133,250,288,206,86,17},{4,37,129,248,290,210,89,17},{3,34,125,246,292,214,92,18},{3,32,121,243,294,218,94,19},{2,2,9,11,7,24 26,113,239,298,227,100,20},{1,24,108,237,300,231,102,21}.
g)、对当前编码单元的预测块进行预测像素精确修正,该精确修正过程可以是使用当前预测像素所在的位置为基准,以水平距离HD和垂直距离VD为偏移,获取上侧相邻UPNum个重建参考像素和左侧LFNum个重建参考像素,将获取到的参考像素与当前预测像素进行滤波,或可以是加权求和,得到精确后的预测像素作为预测块中当前位置的最终预测像素。上述HD与VD可以取值为0,1,2,3,…,N等,N不超过当前块的宽或高。上述UPNum与LFNum可以取值为0,1,2,3,…,M等,M不超过当前块上侧相邻重建参考像素个数和左侧相邻重建参考像素个数;g), the prediction block of the current coding unit is accurately corrected for the predicted pixels, and the accurate correction process can be based on the position where the current predicted pixels are located, and the horizontal distance HD and the vertical distance VD are used as offsets to obtain the adjacent UPNum on the upper side. Reconstruction reference pixels and LFNum reconstruction reference pixels on the left, filter the obtained reference pixels and the current prediction pixel, or perform weighted summation to obtain the accurate prediction pixel as the final prediction pixel at the current position in the prediction block. The above HD and VD can be 0, 1, 2, 3, ..., N, etc., and N does not exceed the width or height of the current block. The above UPNum and LFNum can be 0, 1, 2, 3, ..., M, etc., and M does not exceed the number of adjacent reconstruction reference pixels on the upper side of the current block and the number of adjacent reconstruction reference pixels on the left side;
h)、根据上述经过IPS技术得到的最终预测像素与原始像素计算得到每一种预测模式的率失真代价信息,记录最小率失真代价信息的预测模式和对应代价值;h), calculate the rate-distortion cost information of each prediction mode according to the final predicted pixel and original pixel obtained by the above-mentioned IPS technology, and record the prediction mode and the corresponding cost value of the minimum rate-distortion cost information;
i)、若IPF允许标识位为‘0’且IPS允许标识位为‘0’,则将b)中记录的预测模式索引经码流传输给解码端;若IPF允许标识位为‘1’且IPS允许标识位为‘0’,则将b)中记录的最小代价值与e)中记录的最小代价值进行比较,若b)中的率失真代价更小,则将b)中记录的预测模式索引编码作为当前编码单元的最优预测模式经码流传输给解码端,将IPF当前编码单元标识位置‘0’,表示不使用IPF技术,也经码流传输给解码端;若e)中的率失真更小,则将e)中记录的预测模式引编码作为当前编码单元的最优预测模式经码流传输给解码端,将IPF当前编码单元标识位置‘1’,表示使用IPF技术,也经码流传输给解码端;若IPF允许标识位为‘0’且IPS允许标识位为‘1’,则将b)中记录的最小代价值与h)中记录的最小代价值进行比较,若b)中的率失真代价更小,则将b)中记录的预测模式索引编码作为当前编码单元的最优预测模式经码流传输给解码端,将当前编码单元的IPS使用标识位置‘0’,表示不使用该技术,也经码流传输给解码端;若h)中的率失真更小,则将h)中记录的预测模式引编码作为当前编码单元的最优预测模式经码流传输给解码端,将当前编码单元的IPS使用标识位置‘1’,表示使用该技术,也经码流传输给解码端;若IPF允许标识位为‘1’且IPS允许标识位为‘1’,则将b)、e)和h)中记录的最小代价值进行比较,若b)中的率失真代价更小,则将b)中记录的预测模式索引编码作为当前编码单元的最优预测模式经码流传输给解码端,将当前编码单元的IPS使用标识位和IPF使用标识位置‘0’,表示均不使用,也经码流传输给解码端;若e)中的率失真更小,则将e)中记录的预测模式引编码作为当前编码单元的最优预测模式经码流传输给解码端,将当前编码单元的IPF使用标识位置‘1’且不传输IPS使用标识位,表示使用IPF技术而不使用IPS技术,也经码流传输给解码端;若h)中的率失真更小,则将h)中记录的预测模式引编码作为当前编码单元的最优预测模式经码流传输给解码端,将当前编码单元的IPF使用标识位置‘0’且IPS使用标识位置‘1’,表示不使用IPF技术而使用IPS技术,也经码流传输给解码端。i), if the IPF allows the identification bit to be '0' and the IPS allows the identification bit to be '0', then transmit the prediction mode index recorded in b) to the decoding end through the code stream; if the IPF allows the identification bit to be '1' and If the IPS allows the flag bit to be '0', compare the minimum cost value recorded in b) with the minimum cost value recorded in e), and if the rate-distortion cost in b) is smaller, compare the prediction recorded in b) The mode index coding is used as the optimal prediction mode of the current coding unit and is transmitted to the decoding end through the code stream, and the IPF current coding unit identification position is '0', indicating that the IPF technology is not used, and is also transmitted to the decoding end through the code stream; if e) in The rate distortion is smaller, then the prediction mode index code recorded in e) is transmitted to the decoding end as the optimal prediction mode of the current coding unit through the code stream, and the IPF current coding unit identification position '1' indicates that the IPF technology is used, It is also transmitted to the decoding end through the code stream; if the IPF allows the identification bit to be '0' and the IPS allows the identification bit to be '1', then compare the minimum cost value recorded in b) with the minimum cost value recorded in h), If the rate-distortion cost in b) is smaller, then use the prediction mode index encoding recorded in b) as the optimal prediction mode of the current coding unit and transmit it to the decoding end through the code stream, and use the IPS identifier position '0 of the current coding unit ', indicating that this technology is not used, and is also transmitted to the decoding end through the code stream; if the rate-distortion in h) is smaller, the prediction mode recorded in h) is used as the optimal prediction mode of the current coding unit through the code stream It is transmitted to the decoding end, and the IPS use flag position of the current coding unit is '1', indicating that this technology is used, and it is also transmitted to the decoding end through the code stream; if the IPF allowable flag bit is '1' and the IPS allowable flag bit is '1' , then compare the minimum cost values recorded in b), e) and h), and if the rate-distortion cost in b) is smaller, encode the prediction mode index recorded in b) as the optimal prediction for the current coding unit The mode is transmitted to the decoding end through the code stream, and the IPS use identification bit and the IPF use identification position of the current coding unit are '0', indicating that they are not used, and are also transmitted to the decoding end through the code stream; if the rate distortion in e) is smaller , then the prediction mode index code recorded in e) is transmitted to the decoding end as the optimal prediction mode of the current coding unit through the code stream, and the IPF of the current coding unit uses the identification position '1 ' and does not transmit the IPS to use the identification position, indicating Using IPF technology instead of IPS technology, it is also transmitted to the decoding end through the code stream; if the rate-distortion in h) is smaller, the prediction mode recorded in h) is used as the optimal prediction mode of the current coding unit. The stream is transmitted to the decoding end, and the IPF use identification position of the current coding unit is '0' and the IPS use identification position is '1', indicating that the IPF technology is not used but the IPS technology is used, and is also transmitted to the decoding end through the code stream.
编码器最后将预测块和反变换、反量化后的残差叠加得到重建后的编码单元块,作为下一个编码单元的预测参考块。Finally, the encoder superimposes the prediction block and the inversely transformed and inversely quantized residuals to obtain a reconstructed coding unit block, which is used as a prediction reference block for the next coding unit.
可以理解的是,编码器采用帧内预测平滑滤波技术,强了帧内预测的空间关联性,并且一个相邻参考像素集合中的多个参考像素进行平滑滤波,避免了过于锐化的预测可能会导致残差增加和变大,预测效果不好的问题,提高了编码效率。It can be understood that the encoder adopts intra-frame prediction smoothing filtering technology, which strengthens the spatial correlation of intra-frame prediction, and multiple reference pixels in a neighboring reference pixel set are smoothed and filtered, avoiding the possibility of over-sharp prediction. It will cause the residual error to increase and become larger, the prediction effect is not good, and the coding efficiency is improved.
本申请实施例提供一种帧内预测方法,该方法应用于视频解码设备,即解码器。该方法所实现的功能可以通过视频解码设备中的处理器调用程序代码来实现,当然程序代码可以保存在计算机存储介质中,可见,该视频编码设备至少包括处理器和存储介质。An embodiment of the present application provides an intra-frame prediction method, which is applied to a video decoding device, that is, a decoder. The functions implemented by the method can be implemented by the processor in the video decoding device calling program codes, and of course the program codes can be stored in a computer storage medium. It can be seen that the video encoding device includes at least a processor and a storage medium.
图11为本申请实施例一种帧内预测方法的实现流程示意图,如图11所示,该方法包括:FIG. 11 is a schematic flowchart of an implementation of an intra-frame prediction method according to an embodiment of the present application. As shown in FIG. 11 , the method includes:
S301、获取码流,解析码流的头信息,得到滤波标识。S301. Acquire a code stream, parse the header information of the code stream, and obtain a filter identifier.
S302、当滤波标识为表征帧内预测滤波允许标识有效、且帧内预测平滑滤波允许标识有效时, 至少从码流中获取当前预测模式和帧内预测滤波使用标识。S302. When the filtering flag indicates that the intra-frame prediction filtering permission flag is valid and the intra-frame prediction smoothing filtering permission flag is valid, obtain at least the current prediction mode and the intra-frame prediction filtering use flag from the code stream.
S303、当帧内预测滤波使用标识为无效、且从码流中获取到有效的帧内预测平滑滤波使用标识时,基于当前预测模式,对当前块进行帧内预测平滑滤波处理,得到第一预测值。S303, when the intra-frame prediction filtering use flag is invalid and the valid intra-frame prediction smoothing filtering use flag is obtained from the code stream, based on the current prediction mode, perform intra-frame prediction smoothing filtering processing on the current block to obtain the first prediction value.
在本申请实施例中,解码器在获取到了码流信息后,可以从码流的头信息中解析出是不是进行了IPF和IPS的处理的。即可以解析出滤波标识中的帧内预测滤波允许标识,和/或,帧内预测平滑滤波允许标识的。当采用了IPF和IPS时,滤波标识为表征帧内预测滤波允许标识有效、且帧内预测平滑滤波允许标识有效。这时,解码器就可以至少从码流中获取当前预测模式和帧内预测滤波使用标识了,当帧内预测滤波使用标识为无效、且从码流中获取到有效的帧内预测平滑滤波使用标识时,即当前块采用的是IPS技术确定的当前预测模式的情况时,基于当前预测模式,对当前块进行帧内预测平滑滤波处理,就可以得到第一预测值了,然后再基于第一预测值进行后续的解码流程。In this embodiment of the present application, after acquiring the code stream information, the decoder can parse from the header information of the code stream to determine whether the IPF and IPS processing is performed. That is, the intra-frame prediction filtering permission flag in the filtering flags, and/or the intra-frame prediction smoothing filtering permission flag can be parsed out. When IPF and IPS are employed, the filtering flags are indicative of the Intra prediction filtering permission flag being valid, and the intra prediction smoothing filtering permission flag being valid. At this time, the decoder can obtain at least the current prediction mode and the intra-frame prediction filtering use flag from the code stream. When the intra-frame prediction filtering use flag is invalid, and the valid intra-frame prediction smoothing filter use flag is obtained from the code stream When identifying, that is, when the current block adopts the current prediction mode determined by the IPS technology, based on the current prediction mode, perform intra-frame prediction smoothing filtering on the current block to obtain the first prediction value, and then based on the first prediction value. The predicted value goes through the subsequent decoding process.
在本申请的一些实施例中,当帧内预测滤波使用标识为有效时,从码流中获取当前预测模式;基于当前预测模式,对当前块进行帧内预测滤波处理,得到第二预测值。In some embodiments of the present application, when the intra prediction filtering use flag is valid, the current prediction mode is obtained from the code stream; based on the current prediction mode, intra prediction filtering is performed on the current block to obtain the second prediction value.
在本申请的一些实施例中,解码器基于当前块中的每个像素对应的预设水平距离和预设垂直距离,对当前块进行帧内预测平滑滤波处理,得到第一预测值。In some embodiments of the present application, the decoder performs intra-frame prediction smoothing filtering processing on the current block based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the current block to obtain the first predicted value.
在本申请的一些实施例中,基于当前块中的每个像素对应的预设水平距离和预设垂直距离,确定与每个像素对应的至少两个相邻参考像素集合的至少两个相邻参考块范围;In some embodiments of the present application, at least two adjacent sets of at least two adjacent reference pixels corresponding to each pixel are determined based on a preset horizontal distance and a preset vertical distance corresponding to each pixel in the current block reference block range;
从至少两个相邻参考像素集合中,对应确定出属于至少两个相邻参考块范围内的至少两个目标参考像素集合;其中,每个目标参考像素集合中包含至少一个目标参考像素;From the at least two adjacent reference pixel sets, correspondingly determine at least two target reference pixel sets within the scope of at least two adjacent reference blocks; wherein, each target reference pixel set includes at least one target reference pixel;
基于至少两个目标参考像素集合,对每个像素进行帧内预测平滑滤波处理,得到第一预测值。Based on at least two target reference pixel sets, intra-frame prediction smoothing filtering is performed on each pixel to obtain a first predicted value.
在本申请的一些实施例中,解码器从所述至少两个相邻参考像素集合中,对应确定出属于所述至少两个相邻参考块范围内的至少两个目标参考像素集合包括以下方式:In some embodiments of the present application, the decoder correspondingly determines, from the at least two adjacent reference pixel sets, at least two target reference pixel sets belonging to the range of the at least two adjacent reference blocks, including the following manners :
方式一:从所述至少两个相邻参考像素集合中,确定每个相邻参考块范围的两个边界像素位置的像素为一个目标参考像素集合,从而确定出所述至少两个目标参考像素集合。Manner 1: From the at least two adjacent reference pixel sets, determine the pixels at the two boundary pixel positions of each adjacent reference block range as a target reference pixel set, so as to determine the at least two target reference pixels gather.
方式二:从所述至少两个相邻参考像素集合中,确定每个相邻参考块范围内的任意像素位置的M个像素为一个目标参考像素集合,从而确定出所述至少两个目标参考像素集合,其中,M为大于0,且不超过对应的相邻参考像素集合的最大像素数量。Mode 2: From the at least two adjacent reference pixel sets, determine M pixels at any pixel position within the range of each adjacent reference block as a target reference pixel set, so as to determine the at least two target reference pixel sets. A set of pixels, where M is greater than 0 and does not exceed the maximum number of pixels in the corresponding adjacent reference pixel set.
在本申请的一些实施例中,至少两个相邻参考像素集合包括:左侧相邻参考像素集合和上侧相邻参考像素集合;In some embodiments of the present application, the at least two adjacent reference pixel sets include: a left adjacent reference pixel set and an upper adjacent reference pixel set;
至少两个相邻参考块范围包括:左侧相邻参考像素范围和上侧相邻参考像素范围;The at least two adjacent reference block ranges include: a left adjacent reference pixel range and an upper adjacent reference pixel range;
至少两个目标参考像素集合包括:左侧目标相邻参考像素集合和上侧目标相邻参考像素集合。The at least two target reference pixel sets include: a left target adjacent reference pixel set and an upper target adjacent reference pixel set.
在本申请的一些实施例中,预设水平距离小于等于初始预测块的宽度;预设垂直距离小于等于初始预测块的高度;In some embodiments of the present application, the preset horizontal distance is less than or equal to the width of the initial prediction block; the preset vertical distance is less than or equal to the height of the initial prediction block;
初始预测块的n行m列位置的第一类像素对应的预设水平距离和预设垂直距离,与初始预测块的除n行m列之外的其他类像素对应的预设水平距离和预设垂直距离不同;n和m为自然数;The preset horizontal distance and preset vertical distance corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block, and the preset horizontal distances and pre-set vertical distances corresponding to other types of pixels except n rows and m columns of the initial prediction block. Let the vertical distances be different; n and m are natural numbers;
第一类像素中的每个像素对应的预设水平距离和预设垂直距离至少部分相同,或者均不相同;The preset horizontal distance and the preset vertical distance corresponding to each pixel in the first type of pixels are at least partially the same, or both are different;
其他类像素中的每个像素对应的预设水平距离和预设垂直距离至少部分相同,或者均不相同。The preset horizontal distance and the preset vertical distance corresponding to each pixel in the other types of pixels are at least partially the same, or both are different.
在本申请的一些实施例中,基于至少两个目标参考像素集合,对每个像素进行帧内预测平滑滤波处理,得到第二类预测值,包括:解码器确定滤波系数;以及基于至少两个目标参考像素集合和滤波系数,对每个像素进行帧内预测平滑滤波处理,得到第二类预测值。In some embodiments of the present application, performing an intra-frame prediction smoothing filtering process on each pixel based on at least two target reference pixel sets to obtain a second type of prediction value, including: a decoder determining a filter coefficient; and based on at least two The target refers to the set of pixels and filter coefficients, and performs intra-frame prediction smoothing filtering processing on each pixel to obtain the second type of prediction value.
在本申请的一些实施例中,初始预测块的n行m列位置的第一类像素对应的滤波系数,与初始预测块的除n行m列之外的其他类像素对应的滤波系数不同;n和m为自然数;In some embodiments of the present application, the filter coefficients corresponding to the first type of pixels at the positions of n rows and m columns in the initial prediction block are different from the filter coefficients corresponding to other types of pixels except for n rows and m columns in the initial prediction block; n and m are natural numbers;
第一类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同;The filter coefficients corresponding to each pixel in the first type of pixels are at least partially the same, or all different;
其他类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同。The filter coefficients corresponding to each pixel in the other types of pixels are at least partially the same, or all different.
在本申请的一些实施例中,当预设水平距离大于初始预测块的宽度时,采用上侧相邻参考像素集合中的最左侧的参考像素向左填充,直至确定出上侧相邻参考块范围的第一边界限时为止,和/或,采用上侧相邻参考像素集合中的最右侧的参考像素向右填充,直至确定出上侧相邻参考块范围的第二边界限时为止;In some embodiments of the present application, when the preset horizontal distance is greater than the width of the initial prediction block, the leftmost reference pixel in the upper adjacent reference pixel set is used to pad to the left until the upper adjacent reference is determined until the first boundary of the block range, and/or, using the rightmost reference pixel in the upper adjacent reference pixel set to fill to the right, until the second boundary of the upper adjacent reference block range is determined;
预设垂直距离小于等于初始预测块的高度时,采用左侧相邻参考像素集合中的最下侧的参考像素向下填充,直至确定出左侧相邻参考块范围的第三边界限时为止,和/或,采用左侧相邻参考像素集合中的最上侧的参考像素向上填充,直至确定出左侧相邻参考块范围的第四边界限时为止。When the preset vertical distance is less than or equal to the height of the initial prediction block, the lowermost reference pixel in the set of adjacent reference pixels on the left side is used to fill down until the third boundary limit of the range of the adjacent reference block on the left side is determined, And/or, the uppermost reference pixel in the set of adjacent reference pixels on the left side is used to fill upwards until the fourth boundary limit of the range of the adjacent reference block on the left side is determined.
需要说明的是,本申请实施例中,解码器实现滤波处理的原理与编码器一致,此处不再赘述。It should be noted that, in this embodiment of the present application, the principle of the decoder implementing filtering processing is the same as that of the encoder, and details are not repeated here.
示例性的,解码器获取码码流,解析码流得到当前视频序列的IPF允许标识位和IPS允许标识位。Exemplarily, the decoder obtains the code stream, and parses the code stream to obtain the IPF permission flag and the IPS permission flag of the current video sequence.
在帧内预测解码过程中,若IPF的允许标识位和IPS的允许标识位都为‘1’,则执行如下所有步骤;若IPF的允许标识位为‘1’且IPS的允许标识位为‘0’,则仅执行a)、b)、c)、d)和g)步骤;若IPF的允许标识位为‘0’且IPS的允许标识位为‘1’,则仅执行a)、b)、e)、f)和g)步骤;若IPF的允许标识位和IPS的允许标识位都为‘0’,则仅执行a)、b)和g)步骤。上述若IPF或IPS允许标识位为‘0’,则解码端默认所有解码块的对应技术的使用标识位为‘0’:In the intra-frame prediction decoding process, if the allowable flag bit of the IPF and the allowable flag bit of the IPS are both '1', perform all the following steps; if the allowable flag bit of the IPF is '1' and the allowable flag bit of the IPS is ' 0', only perform steps a), b), c), d) and g); if the allowable flag bit of IPF is '0' and the allowable flag bit of IPS is '1', then only a), b ), e), f) and g) steps; if the allowable identification bit of IPF and the allowable identification bit of IPS are both '0', then only steps a), b) and g) are performed. If the above-mentioned IPF or IPS allows the flag bit to be '0', the decoding end defaults to the use flag bit of the corresponding technology of all decoding blocks to be '0':
a)、获取码流并解码得到残差信息,经过反变换与反量化等过程得到时域残差信息;a), obtain the code stream and decode to obtain residual information, and obtain time-domain residual information through processes such as inverse transformation and inverse quantization;
b)、解析码流得到当前解码单元的预测模式,根据当前解码单元的预测模式和相邻重建块计算得到预测块;b), parse the code stream to obtain the prediction mode of the current decoding unit, and calculate the prediction block according to the prediction mode of the current decoding unit and the adjacent reconstruction block;
c)、解析并获取IPF的使用标识位,若IPF的使用标识位为‘0’,则不对当前预测块做额外操作,跳过步骤d);若IPF的使用标识位为‘1’,则执行d);c), parse and obtain the use identification bit of IPF, if the use identification bit of IPF is '0', then do not perform additional operations on the current prediction block, skip step d); if the use identification bit of IPF is '1', then execute d);
d)、根据当前解码单元的预测模式归类信息选择相对应的滤波器,根据当前解码单元的尺寸大小选择相对应的滤波器系数组,之后对预测块内各个像素进行滤波得到预测块;d), select the corresponding filter according to the prediction mode classification information of the current decoding unit, select the corresponding filter coefficient group according to the size of the current decoding unit, then filter each pixel in the prediction block to obtain the prediction block;
e)、获取IPF的使用标识位,若IPF的使用标识位为‘1’,则跳过本步骤剩余过程并跳过f)步骤;若IPF的使用标识位为‘0’,则解析并获取IPS的使用标识位。若IPS的使用标识位为‘0’,则不对当前预测块做额外操作,跳过步骤f);若IPS的使用标识位为‘1’,则执行f);e), obtain the use identification bit of IPF, if the use identification bit of IPF is '1', then skip the remaining process of this step and skip step f); if the use identification bit of IPF is '0', then parse and obtain IPS usage flag. If the use flag bit of IPS is '0', then no additional operation is performed on the current prediction block, and step f) is skipped; if the use flag bit of IPS is '1', then f) is executed;
f)、对当前编码单元的预测块进行预测像素精确修正,该精确修正过程可以是使用当前预测像素所在的位置为基准,以水平距离HD和垂直距离VD为偏移,获取上侧相邻UPNum个重建参考像素和左侧LFNum个重建参考像素,将获取到的参考像素与当前预测像素进行滤波,或可以是加权求和,得到精确后的预测像素作为预测块中当前位置的最终预测像素。上述HD与VD可以取值为0,1,2,3,…,N等,N不超过当前块的宽或高。上述UPNum与LFNum可以取值为0,1,2,3,…,M等,M不超过当前块上侧相邻重建参考像素个数和左侧相邻重建参考像素个数;f), the prediction block of the current coding unit is accurately corrected for the predicted pixels. The accurate correction process can be based on the position where the current predicted pixels are located, and the horizontal distance HD and the vertical distance VD are used as offsets to obtain the adjacent UPNum on the upper side. Reconstruction reference pixels and LFNum reconstruction reference pixels on the left, filter the obtained reference pixels and the current prediction pixel, or perform weighted summation to obtain the accurate prediction pixel as the final prediction pixel at the current position in the prediction block. The above HD and VD can be 0, 1, 2, 3, ..., N, etc., and N does not exceed the width or height of the current block. The above UPNum and LFNum can be 0, 1, 2, 3, ..., M, etc., and M does not exceed the number of adjacent reconstruction reference pixels on the upper side of the current block and the number of adjacent reconstruction reference pixels on the left side;
g)、将预测块叠加步骤a)还原后的残差信息得到当前解码单元的重建块,经后处理输出。g), superimposing the residual information restored in step a) of the prediction block to obtain the reconstructed block of the current decoding unit, which is output after post-processing.
示例性的,解码器侧的实现还可以采用以下实现方式,本申请实施例不作限制。如下所示:Exemplarily, the implementation on the decoder side may also adopt the following implementation manners, which are not limited in this embodiment of the present application. As follows:
解码器获取码码流,解析码流得到当前视频序列的IPF允许标识位和IPS允许标识位。The decoder obtains the code stream, and parses the code stream to obtain the IPF allowable flag bit and the IPS allowable flag bit of the current video sequence.
在帧内预测解码过程中,若IPF的允许标识位和IPS的允许标识位都为‘1’,则执行如下所有步骤;若IPF的允许标识位为‘1’且IPS的允许标识位为‘0’,则仅执行a)、b)、和d)步骤;若IPF的允许标识位为‘0’且IPS的允许标识位为‘1’,则仅执行a)、c)和d)步骤;若IPF的允许标识位和IPS的允许标识位都为‘0’,则仅执行a)和d)步骤。上述若IPF或IPS允许标识位为‘0’,则解码端默认所有解码块的对应技术的使用标识位为‘0’:In the intra-frame prediction decoding process, if the allowable flag bit of the IPF and the allowable flag bit of the IPS are both '1', perform all the following steps; if the allowable flag bit of the IPF is '1' and the allowable flag bit of the IPS is ' 0', then only execute steps a), b), and d); if the allowable identification bit of IPF is '0' and the allowable identification bit of IPS is '1', then only steps a), c) and d) are executed ; If the allowable identification bit of IPF and the allowable identification bit of IPS are both '0', then only steps a) and d) are performed. If the above-mentioned IPF or IPS allows the flag bit to be '0', the decoding end defaults to the use flag bit of the corresponding technology of all decoding blocks to be '0':
a)、获取码流并解码得到当前解码单元的预测模式信息,残差信息,经过反变换与反量化等过程得到时域残差信息;a), obtain the code stream and decode to obtain the prediction mode information and residual information of the current decoding unit, and obtain the time domain residual information through processes such as inverse transformation and inverse quantization;
b)、解析码流得到当前解码单元的IPF的使用标识位;b), parse the code stream to obtain the use flag of the IPF of the current decoding unit;
c)、若当前解码单元的IPF使用标识位为‘0’,则解析码流得到IPS的使用标识位;若当前解码单元的IPF使用标识位为‘1’,则不解析IPS的使用标识位;c), if the IPF use identification bit of the current decoding unit is '0', then the use identification bit of the IPS is obtained by parsing the code stream; if the IPF use identification bit of the current decoding unit is '1', then the use identification bit of the IPS is not parsed ;
d)、若IPF的使用标识位为‘0’且IPS的使用标识位为‘0’,则根据当前预测模式计算得到预测块,跳过剩余所有步骤;若IPF的使用标识位为‘1’,则执行e);若IPS的使用标识位为‘1’,则执行f);d), if the use identification bit of IPF is '0' and the use identification bit of IPS is '0', then calculate the predicted block according to the current prediction mode, skip all remaining steps; if the use identification bit of IPF is '1' , then execute e); if the use flag of the IPS is '1', execute f);
e)、根据当前解码单元的预测模式归类信息选择相对应的滤波器,根据当前解码单元的尺寸大小选择相对应的滤波器系数组,之后对预测块内各个像素进行滤波得到预测块,跳过剩余所有步骤;e), select the corresponding filter according to the prediction mode classification information of the current decoding unit, select the corresponding filter coefficient group according to the size of the current decoding unit, then filter each pixel in the prediction block to obtain the prediction block, skip through all remaining steps;
f)、根据当前解码单元解析得到的预测模式,该过程可以使用区别于步骤d)和e)中生成预测像素的插值滤波器,可以使用8个抽头的插值滤波器加上使用各预测像素所在的位置为基准得到的若干个重建参考像素作为生成预测像素的插值滤波器,具体获取上述若干个重建参考像素过程为:以水平距离HD和垂直距离VD为偏移,获取上侧相邻UPNum个重建参考像素和左侧LFNum个重建参考像素。上述HD与VD可以取值为0,1,2,3,…,N等,N不超过当前块的宽或高。上述UPNum与LFNum可以取值为0,1,2,3,…,M等,M不超过当前块上侧相邻重建参考像素个数和左侧相邻重建参考像素个数;f), according to the prediction mode parsed by the current decoding unit, the process can use an interpolation filter that is different from the generation of predicted pixels in steps d) and e), and can use an 8-tap interpolation filter plus use the location of each predicted pixel. Several reconstructed reference pixels obtained based on the position of the pixel are used as interpolation filters for generating predicted pixels, and the specific process of obtaining the above-mentioned several reconstructed reference pixels is: taking the horizontal distance HD and the vertical distance VD as offsets, obtaining the adjacent UPNum on the upper side. Reconstructed reference pixels and left LFNum reconstructed reference pixels. The above HD and VD can be 0, 1, 2, 3, ..., N, etc., and N does not exceed the width or height of the current block. The above UPNum and LFNum can be 0, 1, 2, 3, ..., M, etc., and M does not exceed the number of adjacent reconstruction reference pixels on the upper side of the current block and the number of adjacent reconstruction reference pixels on the left side;
g)、将预测块叠加步骤a)还原后的残差信息得到当前解码单元的重建块,经后处理输出。g), superimposing the residual information restored in step a) of the prediction block to obtain the reconstructed block of the current decoding unit, which is output after post-processing.
可以理解的是,解码器采用帧内预测滤波实现了采用至少两个相邻参考像素集合中每个相邻参考像素集合中的一个相邻参考像素,对当前块进行滤波的过程。采用帧内预测平滑滤波由于可以参 考一个相邻参考像素集合中的多个相邻参考像素,因此,这样的预测会更平滑一些,针对模糊图像的预测也会更精确一些,从而可以提高解码效率。It can be understood that the decoder implements the process of filtering the current block by using one adjacent reference pixel in each adjacent reference pixel set in at least two adjacent reference pixel sets by using intra-frame prediction filtering. Using intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother and the prediction for blurred images will be more accurate, thereby improving decoding efficiency. .
如图12所示,本申请实施例提供一种编码器1,包括:As shown in FIG. 12, an embodiment of the present application provides an encoder 1, including:
第一确定部分10,被配置为遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值;The first determination part 10 is configured to traverse the intra prediction mode, and determine the initial prediction value of the initial prediction block corresponding to the current block;
第一滤波部分11,被配置为对所述初始预测块分别进行帧内预测滤波和帧内预测平滑滤波处理,得到第一类预测值和第二类预测值;其中,所述帧内预测平滑滤波为采用至少两个相邻参考像素集合中每个相邻参考像素集合中的多个相邻参考像素,对所述当前块进行滤波的过程;The first filtering part 11 is configured to perform intra-frame prediction filtering and intra-frame prediction smoothing filtering respectively on the initial prediction block to obtain a first-type prediction value and a second-type prediction value; wherein, the intra-frame prediction smoothing Filtering is a process of filtering the current block by using a plurality of adjacent reference pixels in each adjacent reference pixel set in at least two adjacent reference pixel sets;
所述第一确定部分10,还被配置为采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式;The first determining part 10 is further configured to use the initial prediction value, the first type prediction value and the second type prediction value to calculate the rate-distortion cost with the original pixel value of the current block, respectively, to determine the optimal rate-distortion cost. the corresponding current prediction mode;
第一预测部分12,被配置为采用所述当前预测模式,对所述当前块进行帧内预测;a first prediction part 12, configured to use the current prediction mode to perform intra-frame prediction on the current block;
写入部分13,被配置为将所述当前预测模式的索引信息,以及滤波标识写入码流,其中,滤波标识表征帧内预测滤波和/或帧内预测平滑滤波对应的标识。The writing part 13 is configured to write the index information of the current prediction mode and the filter flag into the code stream, wherein the filter flag represents the flag corresponding to intra-frame prediction filtering and/or intra-frame prediction smoothing filtering.
在本申请的一些实施例中,所述第一滤波部分11,还被配置为基于所述初始预测块中的每个像素的左侧相邻参考像素点和上侧相邻参考像素点,对所述初始预测块的每个像素进行帧内预测滤波,得到所述第一类预测值;以及基于所述初始预测块中的每个像素对应的预设水平距离和预设垂直距离,对所述初始预测块进行帧内预测平滑滤波处理,得到所述第二类预测值。In some embodiments of the present application, the first filtering part 11 is further configured to, based on the adjacent reference pixels on the left and the adjacent reference pixels on the upper side of each pixel in the initial prediction block, filter Perform intra-frame prediction filtering on each pixel of the initial prediction block to obtain the first type of prediction value; and based on the preset horizontal distance and preset vertical distance corresponding to each pixel in the initial prediction block, determine the The initial prediction block is subjected to intra-frame prediction smoothing filtering to obtain the second type of prediction value.
在本申请的一些实施例中,所述第一滤波部分11,还被配置为基于所述初始预测块中的每个像素对应的所述预设水平距离和所述预设垂直距离,确定与所述每个像素对应的至少两个相邻参考像素集合的至少两个相邻参考块范围;从所述至少两个相邻参考像素集合中,对应确定出属于所述至少两个相邻参考块范围内的至少两个目标参考像素集合;其中,每个目标参考像素集合中包含至少一个目标参考像素;基于所述至少两个目标参考像素集合,对所述每个像素进行帧内预测平滑滤波处理,得到所述第二类预测值。In some embodiments of the present application, the first filtering part 11 is further configured to, based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the initial prediction block, determine the at least two adjacent reference block ranges of at least two adjacent reference pixel sets corresponding to each pixel; from the at least two adjacent reference pixel sets, correspondingly determined to belong to the at least two adjacent reference pixel sets At least two target reference pixel sets within the block range; wherein, each target reference pixel set includes at least one target reference pixel; based on the at least two target reference pixel sets, intra prediction smoothing is performed on each pixel filtering to obtain the predicted value of the second type.
在本申请的一些实施例中,所述第一滤波部分11,还被配置为从所述至少两个相邻参考像素集合中,确定每个相邻参考块范围的两个边界像素位置的像素为一个目标参考像素集合,从而确定出所述至少两个目标参考像素集合。In some embodiments of the present application, the first filtering part 11 is further configured to determine, from the at least two adjacent reference pixel sets, pixels at two boundary pixel positions of each adjacent reference block range is one target reference pixel set, thereby determining the at least two target reference pixel sets.
在本申请的一些实施例中,所述第一滤波部分11,还被配置为从所述至少两个相邻参考像素集合中,确定每个相邻参考块范围内的任意像素位置的M个像素为一个目标参考像素集合,从而确定出所述至少两个目标参考像素集合,其中,M为大于0,且不超过对应的相邻参考像素集合的最大像素数量。In some embodiments of the present application, the first filtering part 11 is further configured to determine, from the at least two adjacent reference pixel sets, M arbitrary pixel positions within the range of each adjacent reference block The pixel is one target reference pixel set, so that the at least two target reference pixel sets are determined, wherein M is greater than 0 and does not exceed the maximum number of pixels of the corresponding adjacent reference pixel sets.
在本申请的一些实施例中,所述至少两个相邻参考像素集合包括:左侧相邻参考像素集合和上侧相邻参考像素集合;In some embodiments of the present application, the at least two adjacent reference pixel sets include: a left adjacent reference pixel set and an upper adjacent reference pixel set;
所述至少两个相邻参考块范围包括:左侧相邻参考像素范围和上侧相邻参考像素范围;The at least two adjacent reference block ranges include: a left adjacent reference pixel range and an upper adjacent reference pixel range;
所述至少两个目标参考像素集合包括:左侧目标相邻参考像素集合和上侧目标相邻参考像素集合。The at least two target reference pixel sets include: a left target adjacent reference pixel set and an upper target adjacent reference pixel set.
在本申请的一些实施例中,所述预设水平距离小于等于所述初始预测块的宽度;所述预设垂直距离小于等于所述初始预测块的高度;In some embodiments of the present application, the preset horizontal distance is less than or equal to the width of the initial prediction block; the preset vertical distance is less than or equal to the height of the initial prediction block;
所述初始预测块的n行m列位置的第一类像素对应的预设水平距离和所述预设垂直距离,与所述初始预测块的除n行m列之外的其他类像素对应的预设水平距离和所述预设垂直距离不同;n和m为自然数;The preset horizontal distance and the preset vertical distance corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are the same as those corresponding to other types of pixels except n rows and m columns of the initial prediction block. The preset horizontal distance is different from the preset vertical distance; n and m are natural numbers;
所述第一类像素中的每个像素对应的预设水平距离和所述预设垂直距离至少部分相同,或者均不相同;The preset horizontal distance corresponding to each pixel in the first type of pixels is at least partially the same as the preset vertical distance, or both are different;
所述其他类像素中的每个像素对应的预设水平距离和所述预设垂直距离至少部分相同,或者均不相同。The preset horizontal distance and the preset vertical distance corresponding to each of the other types of pixels are at least partially the same, or both are different.
在本申请的一些实施例中,所述第一滤波部分11,还被配置为确定滤波系数;基于所述至少两个目标参考像素集合和所述滤波系数,对所述每个像素进行帧内预测平滑滤波处理,得到所述第二类预测值。In some embodiments of the present application, the first filtering part 11 is further configured to determine a filter coefficient; based on the at least two target reference pixel sets and the filter coefficient, perform intra-frame filtering on each pixel A prediction smoothing filtering process is performed to obtain the second type of prediction value.
在本申请的一些实施例中,所述初始预测块的n行m列位置的第一类像素对应的滤波系数,与所述初始预测块的除n行m列之外的其他类像素对应的滤波系数不同;n和m为自然数;In some embodiments of the present application, the filter coefficients corresponding to the first type of pixels in the positions of n rows and m columns of the initial prediction block are corresponding to other types of pixels except for n rows and m columns of the initial prediction block. Different filter coefficients; n and m are natural numbers;
所述第一类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同;The filter coefficients corresponding to each pixel in the first type of pixels are at least partially the same, or all different;
所述其他类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同。The filter coefficients corresponding to each pixel in the other types of pixels are at least partially the same, or all different.
在本申请的一些实施例中,所述第一确定部分10,还被配置为采用初始预测值、第一类预测值 和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出与所述初始预测值对应的第一最小率失真代价、与所述第一类预测值对应的第二最小率失真代价以及与所述第二类预测值对应的第三最小率失真代价;从所述第一最小率失真代价、所述第二最小率失真代价以及所述第三最小率失真代价中,确定出最小的最优率失真代价;将得到所述最优率失真代价对应预测模式作为所述当前预测模式。In some embodiments of the present application, the first determining part 10 is further configured to use the initial prediction value, the first type prediction value and the second type prediction value to perform rate-distortion costing on the original pixel values of the current block, respectively. Calculate to determine a first minimum rate-distortion cost corresponding to the initial predicted value, a second minimum rate-distortion cost corresponding to the first type of prediction value, and a third minimum rate-distortion cost corresponding to the second type of prediction value Distortion cost; from the first minimum rate-distortion cost, the second minimum rate-distortion cost, and the third minimum rate-distortion cost, determine the minimum optimal rate-distortion cost; the optimal rate-distortion cost will be obtained The cost corresponds to the prediction mode as the current prediction mode.
在本申请的一些实施例中,所述滤波标识包括:帧内预测滤波允许标识、帧内预测滤波使用标识、帧内预测平滑滤波允许标识和帧内预测平滑滤波使用标识;In some embodiments of the present application, the filtering flags include: intra-frame prediction filtering permission flags, intra-frame prediction filtering use flags, intra-frame prediction smoothing filtering permission flags, and intra-frame prediction smoothing filtering use flags;
所述写入部分13,还被配置为将所述当前预测模式的索引信息写入码流;确定所述帧内预测滤波允许标识为有效,以及所述帧内预测平滑滤波允许标识为有效,并将所述帧内预测滤波允许标识和所述帧内预测平滑滤波允许标识写入码流;The writing part 13 is further configured to write the index information of the current prediction mode into the code stream; determine that the intra-frame prediction filtering permission flag is valid, and the intra-frame prediction smoothing filtering permission flag is valid, and writing the intra-frame prediction filtering permission flag and the intra-frame prediction smoothing filtering permission flag into the code stream;
当所述最优率失真代价为所述第二最小率失真代价时,确定所述帧内预测滤波使用标识为有效,并将所述帧内预测滤波使用标识写入码流;When the optimal rate-distortion cost is the second minimum rate-distortion cost, determining that the intra-frame prediction filtering use flag is valid, and writing the intra-frame prediction filtering use flag into the code stream;
当所述最优率失真代价为所述第三最小率失真代价时,确定所述帧内预测滤波使用标识为无效,且所述帧内预测平滑滤波使用标识为有效,并将所述帧内预测滤波使用标识和所述帧内预测平滑滤波使用标识写入码流;When the optimal rate-distortion cost is the third minimum rate-distortion cost, it is determined that the intra-frame prediction filtering use flag is invalid and the intra-frame prediction smoothing filter use flag is valid, and the intra-frame prediction filtering use flag is valid. The prediction filtering uses the flag and the intra-frame prediction smoothing filtering uses the flag to write the code stream;
当所述最优率失真代价为所述第一最小率失真代价时,确定所述帧内预测滤波使用标识为无效,且所述帧内预测平滑滤波使用标识为无效,并将所述帧内预测滤波使用标识和所述帧内预测平滑滤波使用标识写入码流。When the optimal rate-distortion cost is the first minimum rate-distortion cost, it is determined that the intra-frame prediction filtering use flag is invalid, and the intra-frame prediction smoothing filter use flag is invalid, and the intra-frame prediction filtering use flag is invalid The predictive filtering uses the flag and the intra prediction smoothing filtering uses the flag to write the code stream.
在本申请的一些实施例中,所述第一滤波部分11,还被配置为所述遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值之后,所述采用所述当前预测模式,对所述当前块进行帧内预测之前,对所述初始预测块分别进行帧内预测平滑滤波处理,得到第二类预测值;其中,所述帧内预测平滑滤波为采用至少两个相邻参考像素集合中每个相邻参考像素集合中的多个相邻参考像素,对所述当前块进行滤波的过程;In some embodiments of the present application, the first filtering part 11 is further configured to traverse the intra-frame prediction mode, and after determining the initial prediction value of the initial prediction block corresponding to the current block, use the current block Prediction mode, before performing intra-frame prediction on the current block, perform intra-frame prediction smoothing filtering processing on the initial prediction block respectively, to obtain the second type of prediction value; wherein, the intra-frame prediction smoothing filter adopts at least two A process of filtering the current block for multiple adjacent reference pixels in each adjacent reference pixel set in the adjacent reference pixel set;
所述第一确定部分10,还被配置为采用所述初始预测值和所述第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的所述当前预测模式。The first determining part 10 is further configured to use the initial predicted value and the second type of predicted value to perform rate-distortion cost calculation with the original pixel value of the current block, respectively, to determine the rate-distortion cost corresponding to the optimal rate-distortion cost. the current prediction mode.
在本申请的一些实施例中,所述第一滤波部分11,还被配置为所述遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值之后,所述采用所述当前预测模式,对所述当前块进行帧内预测之前,根据帧内预测模式的类型,确定出预测模式集合,所述预测模式集合为启用帧内预测平滑滤波技术的预测模式;针对所述初始预测值中,采用所述预测模式集合预测出的初始子预测值,进行帧内预测平滑滤波处理,得到第二类预测值;In some embodiments of the present application, the first filtering part 11 is further configured to traverse the intra-frame prediction mode, and after determining the initial prediction value of the initial prediction block corresponding to the current block, use the current block prediction mode, before performing intra prediction on the current block, determine a prediction mode set according to the type of intra prediction mode, and the prediction mode set is a prediction mode enabling intra prediction smoothing filtering technology; for the initial prediction In the value, the initial sub-prediction value predicted by the prediction mode set is used to perform intra-frame prediction smoothing filtering processing to obtain the second type of prediction value;
所述第一确定部分10,还被配置为采用所述初始预测值和所述第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的所述当前预测模式。The first determining part 10 is further configured to use the initial predicted value and the second type of predicted value to perform rate-distortion cost calculation with the original pixel value of the current block, respectively, to determine the rate-distortion cost corresponding to the optimal rate-distortion cost. the current prediction mode.
在本申请的一些实施例中,所述滤波标识包括:帧内预测平滑滤波允许标识和帧内预测平滑滤波使用标识;In some embodiments of the present application, the filtering flags include: an intra-frame prediction smoothing filtering permission flag and an intra-frame prediction smoothing filtering use flag;
所述写入部分13,还被配置为将所述当前预测模式的索引信息写入码流;确定所述帧内预测平滑滤波允许标识为有效,并将所述帧内预测平滑滤波允许标识写入码流;The writing part 13 is further configured to write the index information of the current prediction mode into the code stream; determine that the intra-frame prediction smoothing filtering permission flag is valid, and write the intra-frame prediction smoothing filtering permission flag incoming code stream;
当所述最优率失真代价为所述第三最小率失真代价时,确定所述帧内预测平滑滤波使用标识为有效,并将所述帧内预测平滑滤波使用标识写入码流。When the optimal rate-distortion cost is the third minimum rate-distortion cost, it is determined that the intra-frame prediction smoothing filter usage flag is valid, and the intra-frame prediction smoothing filter usage flag is written into the code stream.
当所述最优率失真代价为所述第一最小率失真代价时,确定所述帧内预测平滑滤波使用标识为无效,并将所述帧内预测平滑滤波使用标识写入码流。When the optimal rate-distortion cost is the first minimum rate-distortion cost, it is determined that the intra-frame prediction smoothing filter usage flag is invalid, and the intra-frame prediction smoothing filter usage flag is written into the code stream.
在本申请的一些实施例中,所述初始预测值的编码类型对应多个编码通道;In some embodiments of the present application, the encoding type of the initial prediction value corresponds to multiple encoding channels;
每个编码通道对应的滤波标识采用同一个标识,或者采用一一对应的标识。The filtering identifiers corresponding to each encoding channel use the same identifier, or use one-to-one corresponding identifiers.
在本申请的一些实施例中,所述第一滤波部分11,还被配置为当初始预测块的尺寸满足预测面积阈值范围时,允许使用帧内预测平滑滤波进行滤波处理;当初始预测块的尺寸大于预测面积阈值范围的上限时,将所述初始预测块进行划分,得到满足所述预测面积阈值范围的预测子块;针对所述预测子块实现所述帧内预测处理流程。In some embodiments of the present application, the first filtering part 11 is further configured to allow the use of intra-frame prediction smoothing to perform filtering when the size of the initial prediction block satisfies the prediction area threshold range; When the size is greater than the upper limit of the prediction area threshold range, the initial prediction block is divided to obtain prediction sub-blocks satisfying the prediction area threshold range; the intra prediction processing flow is implemented for the prediction sub-block.
在本申请的一些实施例中,所述第一滤波部分11,还被配置为所述遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值之后,所述采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式之前,对所述初始预测块分别进行帧内预测滤波,得到第一类预测值;遍历帧内预测模式,采用帧内预测平滑滤波处理对当前块进行预测估计,得到第二类预测值。In some embodiments of the present application, the first filtering part 11 is further configured to traverse the intra-frame prediction mode, and after determining the initial prediction value of the initial prediction block corresponding to the current block, use the initial prediction value , the first type of prediction value and the second type of prediction value, respectively carry out rate-distortion cost calculation with the original pixel value of the current block, and before determining the current prediction mode corresponding to the optimal rate-distortion cost, the initial prediction block is respectively framed The intra-prediction filtering is performed to obtain the first type of prediction value; the intra-frame prediction mode is traversed, and the intra-frame prediction smoothing filtering process is used to predict and estimate the current block to obtain the second type of prediction value.
在本申请的一些实施例中,所述第一滤波部分11,还被配置为遍历帧内预测模式,基于所述当前块中的每个像素对应的预设水平距离和预设垂直距离,对所述当前块进行帧内预测平滑滤波处理,得到所述第二类预测值。In some embodiments of the present application, the first filtering part 11 is further configured to traverse the intra prediction mode, and based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the current block, The current block is subjected to intra-frame prediction smoothing filtering to obtain the second type of prediction value.
在本申请的一些实施例中,所述第一确定部分10,还被配置为当预设水平距离大于所述初始预测块的宽度时,采用所述上侧相邻参考像素集合中的最左侧的参考像素向左填充,直至确定出上侧相邻参考块范围的第一边界限时为止,和/或,采用所述上侧相邻参考像素集合中的最右侧的参考像素向右填充,直至确定出上侧相邻参考块范围的第二边界限时为止;In some embodiments of the present application, the first determining part 10 is further configured to, when the preset horizontal distance is greater than the width of the initial prediction block, use the leftmost reference pixel set in the upper adjacent reference pixel set The reference pixels on the upper side are filled to the left until the first boundary limit of the range of the upper adjacent reference block is determined, and/or, the rightmost reference pixel in the upper adjacent reference pixel set is used to fill to the right , until the second boundary limit of the upper adjacent reference block range is determined;
所述预设垂直距离小于等于所述初始预测块的高度时,采用所述左侧相邻参考像素集合中的最下侧的参考像素向下填充,直至确定出左侧相邻参考块范围的第三边界限时为止,和/或,采用所述左侧相邻参考像素集合中的最上侧的参考像素向上填充,直至确定出左侧相邻参考块范围的第四边界限时为止。When the preset vertical distance is less than or equal to the height of the initial prediction block, the lowermost reference pixel in the set of adjacent reference pixels on the left side is used to fill down, until the range of the adjacent reference block on the left side is determined. Until the third boundary limit, and/or, use the uppermost reference pixel in the left adjacent reference pixel set to fill upwards until the fourth boundary limit of the left adjacent reference block range is determined.
可以理解的是,编码器采用帧内预测滤波实现了采用至少两个相邻参考像素集合中每个相邻参考像素集合中的一个相邻参考像素,对当前块进行滤波的过程。采用帧内预测平滑滤波由于可以参考一个相邻参考像素集合中的多个相邻参考像素,因此,这样的预测会更平滑一些,针对模糊图像的预测也会更精确一些,从而可以提高编码效率。It can be understood that the encoder implements the process of filtering the current block by using one adjacent reference pixel in each adjacent reference pixel set in at least two adjacent reference pixel sets by using intra-frame prediction filtering. Intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving coding efficiency. .
在实际应用中,如图13所示,本申请实施例还提供了一种编码器,包括:In practical applications, as shown in FIG. 13 , an embodiment of the present application further provides an encoder, including:
第一存储器15和第一处理器14;a first memory 15 and a first processor 14;
所述第一存储器15存储有可在第一处理器14上运行的计算机程序,所述第一处理器14执行所述程序时编码器侧的帧内预测方法。The first memory 15 stores a computer program that can be run on the first processor 14 , and the first processor 14 executes the program for an intra-frame prediction method on the encoder side.
如图14所示,本申请实施例提供一种解码器2,包括:As shown in FIG. 14, an embodiment of the present application provides a decoder 2, including:
解析部分20,被配置为获取码流,解析码流的头信息,得到所述滤波标识;以及当所述滤波标识为表征帧内预测滤波允许标识有效、且帧内预测平滑滤波允许标识有效时,至少从码流中获取当前预测模式和帧内预测滤波使用标识;The parsing part 20 is configured to obtain the code stream, parse the header information of the code stream, and obtain the filtering identification; and when the filtering identification indicates that the intra-frame prediction filtering permission flag is valid, and the intra-frame prediction smoothing filtering permission flag is valid , at least obtain the current prediction mode and intra prediction filtering use identifier from the code stream;
第二预测部分21,被配置为当所述帧内预测滤波使用标识为无效、且从码流中获取到有效的帧内预测平滑滤波使用标识时,基于所述当前预测模式,对当前块进行帧内预测平滑滤波处理,得到第一预测值。The second prediction part 21 is configured to, based on the current prediction mode, perform a prediction on the current block when the intra-frame prediction filtering use flag is invalid and a valid intra-frame prediction smoothing filter use flag is obtained from the code stream. The intra-frame prediction is smoothed and filtered to obtain the first predicted value.
在本申请的一些实施例中,所述解析部分20,还被配置为所述至少从码流中获取当前预测模式和帧内预测滤波使用标识之后,当所述帧内预测滤波使用标识为有效时,从码流中获取当前预测模式;In some embodiments of the present application, the parsing part 20 is further configured to at least acquire the current prediction mode and the intra-frame prediction filtering use flag from the code stream, when the intra-frame prediction filtering use flag is valid When , obtain the current prediction mode from the code stream;
所述第二预测部分21,还被配置为基于所述当前预测模式,对当前块进行帧内预测滤波处理,得到第二预测值。The second prediction part 21 is further configured to perform intra-frame prediction filtering processing on the current block based on the current prediction mode to obtain a second prediction value.
在本申请的一些实施例中,所述第二预测部分21,还被配置为基于所述当前块中的每个像素对应的预设水平距离和预设垂直距离,对所述当前块进行帧内预测平滑滤波处理,得到所述第一预测值。In some embodiments of the present application, the second prediction part 21 is further configured to frame the current block based on a preset horizontal distance and a preset vertical distance corresponding to each pixel in the current block The intra-prediction smoothing filtering process is performed to obtain the first predicted value.
在本申请的一些实施例中,所述第二预测部分21,还被配置为基于所述当前块中的每个像素对应的所述预设水平距离和所述预设垂直距离,确定与所述每个像素对应的至少两个相邻参考像素集合的至少两个相邻参考块范围;In some embodiments of the present application, the second prediction part 21 is further configured to, based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the current block, determine a at least two adjacent reference block ranges of at least two adjacent reference pixel sets corresponding to each pixel;
从所述至少两个相邻参考像素集合中,对应确定出属于所述至少两个相邻参考块范围内的至少两个目标参考像素集合;其中,每个目标参考像素集合中包含至少一个目标参考像素;From the at least two adjacent reference pixel sets, at least two target reference pixel sets belonging to the at least two adjacent reference blocks are correspondingly determined; wherein, each target reference pixel set includes at least one target reference pixel;
基于所述至少两个目标参考像素集合,对所述每个像素进行帧内预测平滑滤波处理,得到所述第一预测值。Based on the at least two target reference pixel sets, intra-frame prediction smoothing filtering is performed on each pixel to obtain the first predicted value.
在本申请的一些实施例中,所述第二预测部分21,还被配置为从所述至少两个相邻参考像素集合中,确定每个相邻参考块范围的两个边界像素位置的像素为一个目标参考像素集合,从而确定出所述至少两个目标参考像素集合。In some embodiments of the present application, the second prediction part 21 is further configured to determine, from the at least two adjacent reference pixel sets, pixels at two boundary pixel positions of each adjacent reference block range is one target reference pixel set, thereby determining the at least two target reference pixel sets.
在本申请的一些实施例中,所述第二预测部分21,还被配置为从所述至少两个相邻参考像素集合中,确定每个相邻参考块范围内的任意像素位置的M个像素为一个目标参考像素集合,从而确定出所述至少两个目标参考像素集合,其中,M为大于0,且不超过对应的相邻参考像素集合的最大像素数量。In some embodiments of the present application, the second prediction part 21 is further configured to determine, from the at least two adjacent reference pixel sets, M arbitrary pixel positions within the range of each adjacent reference block The pixel is one target reference pixel set, so that the at least two target reference pixel sets are determined, wherein M is greater than 0 and does not exceed the maximum number of pixels of the corresponding adjacent reference pixel sets.
在本申请的一些实施例中,所述至少两个相邻参考像素集合包括:左侧相邻参考像素集合和上侧相邻参考像素集合;In some embodiments of the present application, the at least two adjacent reference pixel sets include: a left adjacent reference pixel set and an upper adjacent reference pixel set;
所述至少两个相邻参考块范围包括:左侧相邻参考像素范围和上侧相邻参考像素范围;The at least two adjacent reference block ranges include: a left adjacent reference pixel range and an upper adjacent reference pixel range;
所述至少两个目标参考像素集合包括:左侧目标相邻参考像素集合和上侧目标相邻参考像素集合。The at least two target reference pixel sets include: a left target adjacent reference pixel set and an upper target adjacent reference pixel set.
在本申请的一些实施例中,所述预设水平距离小于等于所述初始预测块的宽度;所述预设垂直距离小于等于所述初始预测块的高度;In some embodiments of the present application, the preset horizontal distance is less than or equal to the width of the initial prediction block; the preset vertical distance is less than or equal to the height of the initial prediction block;
所述初始预测块的n行m列位置的第一类像素对应的预设水平距离和所述预设垂直距离,与所述初始预测块的除n行m列之外的其他类像素对应的预设水平距离和所述预设垂直距离不同;n和m为自然数;The preset horizontal distance and the preset vertical distance corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are the same as those corresponding to other types of pixels except n rows and m columns of the initial prediction block. The preset horizontal distance is different from the preset vertical distance; n and m are natural numbers;
所述第一类像素中的每个像素对应的预设水平距离和所述预设垂直距离至少部分相同,或者均不相同;The preset horizontal distance corresponding to each pixel in the first type of pixels is at least partially the same as the preset vertical distance, or both are different;
所述其他类像素中的每个像素对应的预设水平距离和所述预设垂直距离至少部分相同,或者均不相同。The preset horizontal distance and the preset vertical distance corresponding to each of the other types of pixels are at least partially the same, or both are different.
在本申请的一些实施例中,所述第二预测部分21,还被配置为确定滤波系数;基于所述至少两个目标参考像素集合和所述滤波系数,对所述每个像素进行帧内预测平滑滤波处理,得到所述第二类预测值。In some embodiments of the present application, the second prediction part 21 is further configured to determine filter coefficients; based on the at least two target reference pixel sets and the filter coefficients, perform intra-frame performance on each pixel A prediction smoothing filtering process is performed to obtain the second type of prediction value.
在本申请的一些实施例中,所述初始预测块的n行m列位置的第一类像素对应的滤波系数,与所述初始预测块的除n行m列之外的其他类像素对应的滤波系数不同;n和m为自然数;In some embodiments of the present application, the filter coefficients corresponding to the first type of pixels in the positions of n rows and m columns of the initial prediction block are corresponding to other types of pixels except for n rows and m columns of the initial prediction block. Different filter coefficients; n and m are natural numbers;
所述第一类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同;The filter coefficients corresponding to each pixel in the first type of pixels are at least partially the same, or all different;
所述其他类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同。The filter coefficients corresponding to each pixel in the other types of pixels are at least partially the same, or all different.
在本申请的一些实施例中,当预设水平距离大于所述初始预测块的宽度时,采用所述上侧相邻参考像素集合中的最左侧的参考像素向左填充,直至确定出上侧相邻参考块范围的第一边界限时为止,和/或,采用所述上侧相邻参考像素集合中的最右侧的参考像素向右填充,直至确定出上侧相邻参考块范围的第二边界限时为止;In some embodiments of the present application, when the preset horizontal distance is greater than the width of the initial prediction block, the leftmost reference pixel in the set of adjacent reference pixels on the upper side is used to pad to the left, until it is determined that the upper until the first boundary of the range of the adjacent reference blocks on the side, and/or, use the rightmost reference pixel in the set of adjacent reference pixels on the upper side to fill to the right, until the range of the adjacent reference blocks on the upper side is determined. until the second boundary;
所述预设垂直距离小于等于所述初始预测块的高度时,采用所述左侧相邻参考像素集合中的最下侧的参考像素向下填充,直至确定出左侧相邻参考块范围的第三边界限时为止,和/或,采用所述左侧相邻参考像素集合中的最上侧的参考像素向上填充,直至确定出左侧相邻参考块范围的第四边界限时为止。When the preset vertical distance is less than or equal to the height of the initial prediction block, the lowermost reference pixel in the set of adjacent reference pixels on the left side is used to fill down, until the range of the adjacent reference block on the left side is determined. Until the third boundary limit, and/or, use the uppermost reference pixel in the left adjacent reference pixel set to fill upwards until the fourth boundary limit of the left adjacent reference block range is determined.
可以理解的是,解码器采用帧内预测滤波实现了采用至少两个相邻参考像素集合中每个相邻参考像素集合中的一个相邻参考像素,对当前块进行滤波的过程。采用帧内预测平滑滤波由于可以参考一个相邻参考像素集合中的多个相邻参考像素,因此,这样的预测会更平滑一些,针对模糊图像的预测也会更精确一些,从而可以提高解码效率。It can be understood that the decoder implements the process of filtering the current block by using one adjacent reference pixel in each adjacent reference pixel set in at least two adjacent reference pixel sets by using intra-frame prediction filtering. Using intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in a set of adjacent reference pixels, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving decoding efficiency. .
在实际应用中,如图15所示,本申请实施例还提供了一种解码器,包括:In practical applications, as shown in FIG. 15 , an embodiment of the present application further provides a decoder, including:
第二存储器22和第二处理器23;a second memory 22 and a second processor 23;
所述第二存储器22存储有可在第二处理器23上运行的计算机程序,所述第二处理器23执行所述程序时实现解码器侧的帧内预测方法。The second memory 22 stores a computer program that can be executed on the second processor 23, and the second processor 23 implements the intra-frame prediction method on the decoder side when executing the program.
相应的,本申请实施例提供了一种存储介质,其上存储有计算机程序,该计算机程序被第一处理器执行时,实现编码器的帧内预测方法;或者,该计算机程序被第二处理器执行时,实现解码器的帧内预测方法。Correspondingly, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed by the first processor, an intra-frame prediction method of the encoder is implemented; or, the computer program is processed by the second processor. When the decoder executes, implements the decoder's intra prediction method.
以上所述,仅为本申请的实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only the embodiment of the present application, but the protection scope of the present application is not limited to this. Covered within the scope of protection of this application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
工业实用性Industrial Applicability
本申请实施例中,通过采用帧内预测滤波实现了采用至少两个相邻参考像素集合中每个相邻参考像素集合中的一个相邻参考像素,对当前块进行滤波的过程。采用帧内预测平滑滤波由于可以参考一个相邻参考像素集合中的多个相邻参考像素,因此,这样的预测会更平滑一些,针对模糊图像的预测也会更精确一些,从而可以提高编码效率。In the embodiment of the present application, the process of filtering the current block by using one adjacent reference pixel in each adjacent reference pixel set in at least two adjacent reference pixel sets is implemented by using intra-frame prediction filtering. Intra-frame prediction smoothing filtering can refer to multiple adjacent reference pixels in one adjacent reference pixel set, so such prediction will be smoother, and the prediction for blurred images will be more accurate, thereby improving coding efficiency. .

Claims (35)

  1. 一种帧内预测方法,应用于编码器,包括:An intra-frame prediction method, applied to an encoder, comprising:
    遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值;Traverse the intra-frame prediction mode to determine the initial prediction value of the initial prediction block corresponding to the current block;
    对所述初始预测块分别进行帧内预测滤波和帧内预测平滑滤波处理,得到第一类预测值和第二类预测值;其中,所述帧内预测平滑滤波为采用至少两个相邻参考像素集合中每个相邻参考像素集合中的多个相邻参考像素,对所述当前块进行滤波的过程;Perform intra-frame prediction filtering and intra-frame prediction smoothing filtering on the initial prediction block respectively, to obtain a first-type prediction value and a second-type prediction value; wherein, the intra-frame prediction smoothing filtering adopts at least two adjacent reference values A process of filtering the current block for multiple adjacent reference pixels in each adjacent reference pixel set in the pixel set;
    采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式;Using the initial predicted value, the first-type predicted value and the second-type predicted value, respectively, perform rate-distortion cost calculation with the original pixel value of the current block, and determine the current prediction mode corresponding to the optimal rate-distortion cost;
    采用所述当前预测模式,对所述当前块进行帧内预测;using the current prediction mode to perform intra prediction on the current block;
    将所述当前预测模式的索引信息,以及滤波标识写入码流,其中,滤波标识表征帧内预测滤波和/或帧内预测平滑滤波对应的标识。The index information of the current prediction mode and the filter identifier are written into the code stream, where the filter identifier represents an identifier corresponding to intra-frame prediction filtering and/or intra-frame prediction smoothing filtering.
  2. 根据权利要求1所述的方法,其中,所述对所述初始预测块分别进行帧内预测滤波和帧内预测平滑滤波处理,得到第一类预测值和第二类预测值,包括:The method according to claim 1, wherein the performing intra-frame prediction filtering and intra-frame prediction smoothing filtering processing on the initial prediction block respectively to obtain the first-type prediction value and the second-type prediction value, comprising:
    基于所述初始预测块中的每个像素的左侧相邻参考像素点和上侧相邻参考像素点,对所述初始预测块的每个像素进行帧内预测滤波,得到所述第一类预测值;Based on the left adjacent reference pixel point and the upper adjacent reference pixel point of each pixel in the initial prediction block, perform intra-frame prediction filtering on each pixel of the initial prediction block to obtain the first type Predictive value;
    基于所述初始预测块中的每个像素对应的预设水平距离和预设垂直距离,对所述初始预测块进行帧内预测平滑滤波处理,得到所述第二类预测值。Based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the initial prediction block, intra-frame prediction smoothing filtering is performed on the initial prediction block to obtain the second type of prediction value.
  3. 根据权利要求2所述的方法,其中,所述基于所述初始预测块中的每个像素对应的预设水平距离和预设垂直距离,对所述初始预测块进行帧内预测平滑滤波处理,得到所述第二类预测值,包括:The method according to claim 2, wherein, based on the preset horizontal distance and preset vertical distance corresponding to each pixel in the initial prediction block, performing intra prediction smoothing filtering processing on the initial prediction block, Obtain the second type of predicted value, including:
    基于所述初始预测块中的每个像素对应的所述预设水平距离和所述预设垂直距离,确定与所述每个像素对应的至少两个相邻参考像素集合的至少两个相邻参考块范围;Based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the initial prediction block, at least two adjacent sets of at least two adjacent reference pixels corresponding to each pixel are determined reference block range;
    从所述至少两个相邻参考像素集合中,对应确定出属于所述至少两个相邻参考块范围内的至少两个目标参考像素集合;其中,每个目标参考像素集合中包含至少一个目标参考像素;From the at least two adjacent reference pixel sets, at least two target reference pixel sets belonging to the at least two adjacent reference blocks are correspondingly determined; wherein each target reference pixel set includes at least one target reference pixel;
    基于所述至少两个目标参考像素集合,对所述每个像素进行帧内预测平滑滤波处理,得到所述第二类预测值。Based on the at least two target reference pixel sets, intra-frame prediction smoothing filtering is performed on each pixel to obtain the second type of prediction value.
  4. 根据权利要求3所述的方法,其中,所述从所述至少两个相邻参考像素集合中,对应确定出属于所述至少两个相邻参考块范围内的至少两个目标参考像素集合,包括:The method according to claim 3, wherein the at least two target reference pixel sets belonging to the range of the at least two adjacent reference blocks are correspondingly determined from the at least two adjacent reference pixel sets, include:
    从所述至少两个相邻参考像素集合中,确定每个相邻参考块范围的两个边界像素位置的像素为一个目标参考像素集合,从而确定出所述至少两个目标参考像素集合。From the at least two adjacent reference pixel sets, pixels at two boundary pixel positions of each adjacent reference block range are determined as a target reference pixel set, thereby determining the at least two target reference pixel sets.
  5. 根据权利要求3所述的方法,其中,所述从所述至少两个相邻参考像素集合中,对应确定出属于所述至少两个相邻参考块范围内的至少两个目标参考像素集合,包括:The method according to claim 3, wherein the at least two target reference pixel sets belonging to the range of the at least two adjacent reference blocks are correspondingly determined from the at least two adjacent reference pixel sets, include:
    从所述至少两个相邻参考像素集合中,确定每个相邻参考块范围内的任意像素位置的M个像素为一个目标参考像素集合,从而确定出所述至少两个目标参考像素集合,其中,M为大于0,且不超过对应的相邻参考像素集合的最大像素数量。From the at least two adjacent reference pixel sets, M pixels at any pixel position within the range of each adjacent reference block are determined as a target reference pixel set, thereby determining the at least two target reference pixel sets, Wherein, M is greater than 0 and does not exceed the maximum number of pixels in the corresponding adjacent reference pixel set.
  6. 根据权利要求3至5任一项所述的方法,其中,The method according to any one of claims 3 to 5, wherein,
    所述至少两个相邻参考像素集合包括:左侧相邻参考像素集合和上侧相邻参考像素集合;The at least two adjacent reference pixel sets include: a left adjacent reference pixel set and an upper adjacent reference pixel set;
    所述至少两个相邻参考块范围包括:左侧相邻参考像素范围和上侧相邻参考像素范围;The at least two adjacent reference block ranges include: a left adjacent reference pixel range and an upper adjacent reference pixel range;
    所述至少两个目标参考像素集合包括:左侧目标相邻参考像素集合和上侧目标相邻参考像素集合。The at least two target reference pixel sets include: a left target adjacent reference pixel set and an upper target adjacent reference pixel set.
  7. 根据权利要求3至6任一项所述的方法,其中,The method according to any one of claims 3 to 6, wherein,
    所述预设水平距离小于等于所述初始预测块的宽度;所述预设垂直距离小于等于所述初始预测块的高度;The preset horizontal distance is less than or equal to the width of the initial prediction block; the preset vertical distance is less than or equal to the height of the initial prediction block;
    所述初始预测块的n行m列位置的第一类像素对应的预设水平距离和所述预设垂直距离,与所述初始预测块的除n行m列之外的其他类像素对应的预设水平距离和所述预设垂直距离不同;n和m为自然数;The preset horizontal distance and the preset vertical distance corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are the same as those corresponding to other types of pixels except n rows and m columns of the initial prediction block. The preset horizontal distance is different from the preset vertical distance; n and m are natural numbers;
    所述第一类像素中的每个像素对应的预设水平距离和所述预设垂直距离至少部分相同,或者均不相同;The preset horizontal distance corresponding to each pixel in the first type of pixels is at least partially the same as the preset vertical distance, or both are different;
    所述其他类像素中的每个像素对应的预设水平距离和所述预设垂直距离至少部分相同,或者 均不相同。The preset horizontal distance and the preset vertical distance corresponding to each pixel in the other types of pixels are at least partially the same, or both are different.
  8. 根据权利要求3至7任一项所述的方法,其中,所述基于所述至少两个目标参考像素集合,对所述每个像素进行帧内预测平滑滤波处理,得到所述第二类预测值,包括:The method according to any one of claims 3 to 7, wherein, based on the at least two target reference pixel sets, performing intra-frame prediction smoothing filtering on each pixel to obtain the second type of prediction values, including:
    确定滤波系数;determine the filter coefficient;
    基于所述至少两个目标参考像素集合和所述滤波系数,对所述每个像素进行帧内预测平滑滤波处理,得到所述第二类预测值。Based on the at least two target reference pixel sets and the filter coefficients, intra-frame prediction smoothing filtering is performed on each pixel to obtain the second type of prediction value.
  9. 根据权利要求8所述的方法,其中,The method of claim 8, wherein,
    所述初始预测块的n行m列位置的第一类像素对应的滤波系数,与所述初始预测块的除n行m列之外的其他类像素对应的滤波系数不同;n和m为自然数;The filter coefficients corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are different from the filter coefficients corresponding to other types of pixels except for n rows and m columns of the initial prediction block; n and m are natural numbers ;
    所述第一类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同;The filter coefficients corresponding to each pixel in the first type of pixels are at least partially the same, or all different;
    所述其他类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同。The filter coefficients corresponding to each pixel in the other types of pixels are at least partially the same, or all different.
  10. 根据权利要求2至9任一项所述的方法,其中,所述采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式,包括:The method according to any one of claims 2 to 9, wherein the initial prediction value, the first type prediction value and the second type prediction value are used to calculate the rate-distortion cost with the original pixel value of the current block, respectively, to determine Get the current prediction mode corresponding to the optimal rate-distortion cost, including:
    采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出与所述初始预测值对应的第一最小率失真代价、与所述第一类预测值对应的第二最小率失真代价以及与所述第二类预测值对应的第三最小率失真代价;The initial predicted value, the first type of predicted value and the second type of predicted value are used to calculate the rate-distortion cost with the original pixel value of the current block, respectively, to determine the first minimum rate-distortion cost corresponding to the initial predicted value, a second minimum rate-distortion cost corresponding to the first type of prediction value and a third minimum rate-distortion cost corresponding to the second type of prediction value;
    从所述第一最小率失真代价、所述第二最小率失真代价以及所述第三最小率失真代价中,确定出最小的最优率失真代价;determining a minimum optimal rate-distortion cost from among the first minimum rate-distortion cost, the second minimum rate-distortion cost, and the third minimum rate-distortion cost;
    将得到所述最优率失真代价对应预测模式作为所述当前预测模式。The prediction mode corresponding to the optimal rate-distortion cost is obtained as the current prediction mode.
  11. 根据权利要求10所述的方法,其中,所述滤波标识包括:帧内预测滤波允许标识、帧内预测滤波使用标识、帧内预测平滑滤波允许标识和帧内预测平滑滤波使用标识;The method according to claim 10, wherein the filtering flags comprise: an intra prediction filtering permission flag, an intra prediction filtering use flag, an intra prediction smoothing filtering permission flag, and an intra prediction smoothing filtering use flag;
    所述将所述当前预测模式的索引信息,以及滤波标识写入码流,包括:The writing of the index information of the current prediction mode and the filter identification into the code stream includes:
    将所述当前预测模式的索引信息写入码流;writing the index information of the current prediction mode into the code stream;
    确定所述帧内预测滤波允许标识为有效,以及所述帧内预测平滑滤波允许标识为有效,并将所述帧内预测滤波允许标识和所述帧内预测平滑滤波允许标识写入码流;determining that the intra-frame prediction filtering permission flag is valid, and the intra-frame prediction smoothing filtering permission flag is valid, and writing the intra-frame prediction filtering permission flag and the intra-frame prediction smoothing filtering permission flag into a code stream;
    当所述最优率失真代价为所述第二最小率失真代价时,确定所述帧内预测滤波使用标识为有效,并将所述帧内预测滤波使用标识写入码流;When the optimal rate-distortion cost is the second minimum rate-distortion cost, determining that the intra-frame prediction filtering use flag is valid, and writing the intra-frame prediction filtering use flag into the code stream;
    当所述最优率失真代价为所述第三最小率失真代价时,确定所述帧内预测滤波使用标识为无效,且所述帧内预测平滑滤波使用标识为有效,并将所述帧内预测滤波使用标识和所述帧内预测平滑滤波使用标识写入码流;When the optimal rate-distortion cost is the third minimum rate-distortion cost, it is determined that the intra-frame prediction filtering use flag is invalid and the intra-frame prediction smoothing filter use flag is valid, and the intra-frame prediction filtering use flag is valid. The prediction filtering uses the flag and the intra-frame prediction smoothing filtering uses the flag to write the code stream;
    当所述最优率失真代价为所述第一最小率失真代价时,确定所述帧内预测滤波使用标识为无效,且所述帧内预测平滑滤波使用标识为无效,并将所述帧内预测滤波使用标识和所述帧内预测平滑滤波使用标识写入码流。When the optimal rate-distortion cost is the first minimum rate-distortion cost, it is determined that the intra-frame prediction filtering use flag is invalid, and the intra-frame prediction smoothing filter use flag is invalid, and the intra-frame prediction filtering use flag is invalid The predictive filtering uses the flag and the intra prediction smoothing filtering uses the flag to write the code stream.
  12. 根据权利要求10所述的方法,其中,所述遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值之后,所述采用所述当前预测模式,对所述当前块进行帧内预测之前,所述方法还包括:The method according to claim 10, wherein after the traversing the intra-frame prediction mode and determining the initial prediction value of the initial prediction block corresponding to the current block, the current block is framed by using the current prediction mode. Before intra-prediction, the method further includes:
    对所述初始预测块分别进行帧内预测平滑滤波处理,得到第二类预测值;其中,所述帧内预测平滑滤波为采用至少两个相邻参考像素集合中每个相邻参考像素集合中的多个相邻参考像素,对所述当前块进行滤波的过程;Intra-frame prediction smoothing filtering is performed on the initial prediction block respectively to obtain a second type of prediction value; wherein, the intra-frame prediction smoothing filtering is to use at least two adjacent reference pixel sets in each adjacent reference pixel set. A plurality of adjacent reference pixels of , the process of filtering the current block;
    采用所述初始预测值和所述第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的所述当前预测模式。Using the initial predicted value and the second type of predicted value, a rate-distortion cost calculation is performed with the original pixel value of the current block, respectively, to determine the current prediction mode corresponding to the optimal rate-distortion cost.
  13. 根据权利要求1所述的方法,其中,所述遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值之后,所述采用所述当前预测模式,对所述当前块进行帧内预测之前,所述方法还包括:The method according to claim 1, wherein after the traversing the intra-frame prediction mode and determining the initial prediction value of the initial prediction block corresponding to the current block, the current block is framed by using the current prediction mode. Before intra-prediction, the method further includes:
    根据帧内预测模式的类型,确定出预测模式集合,所述预测模式集合为启用帧内预测平滑滤波技术的预测模式;According to the type of the intra-frame prediction mode, a prediction mode set is determined, and the prediction mode set is a prediction mode enabling the intra-frame prediction smoothing filtering technique;
    针对所述初始预测值中,采用所述预测模式集合预测出的初始子预测值,进行帧内预测平滑滤波处理,得到第二类预测值;For the initial predicted value, use the initial sub-predicted value predicted by the prediction mode set to perform intra-frame prediction smoothing filtering to obtain the second type of predicted value;
    采用所述初始预测值和所述第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的所述当前预测模式。Using the initial predicted value and the second type of predicted value, a rate-distortion cost calculation is performed with the original pixel value of the current block, respectively, to determine the current prediction mode corresponding to the optimal rate-distortion cost.
  14. 根据权利要求12或13所述的方法,其中,所述滤波标识包括:帧内预测平滑滤波允许标识和帧内预测平滑滤波使用标识;The method according to claim 12 or 13, wherein the filtering flags comprise: an intra-frame prediction smoothing filtering permission flag and an intra-frame prediction smoothing filtering use flag;
    所述将所述当前预测模式的索引信息,以及滤波标识写入码流,包括:The writing of the index information of the current prediction mode and the filter identification into the code stream includes:
    将所述当前预测模式的索引信息写入码流;writing the index information of the current prediction mode into the code stream;
    确定所述帧内预测平滑滤波允许标识为有效,并将所述帧内预测平滑滤波允许标识写入码流;determining that the intra-frame prediction smoothing filtering permission flag is valid, and writing the intra-frame prediction smoothing filtering permission flag into the code stream;
    当所述最优率失真代价为所述第三最小率失真代价时,确定所述帧内预测平滑滤波使用标识为有效,并将所述帧内预测平滑滤波使用标识写入码流;When the optimal rate-distortion cost is the third minimum rate-distortion cost, determining that the intra-frame prediction smoothing filter usage flag is valid, and writing the intra-frame prediction smoothing filter usage flag into the code stream;
    当所述最优率失真代价为所述第一最小率失真代价时,确定所述帧内预测平滑滤波使用标识为无效,并将所述帧内预测平滑滤波使用标识写入码流。When the optimal rate-distortion cost is the first minimum rate-distortion cost, it is determined that the intra-frame prediction smoothing filter usage flag is invalid, and the intra-frame prediction smoothing filter usage flag is written into the code stream.
  15. 根据权利要求11所述的方法,其中,The method of claim 11, wherein,
    所述初始预测值的编码类型对应多个编码通道;The encoding type of the initial predicted value corresponds to multiple encoding channels;
    每个编码通道对应的滤波标识采用同一个标识,或者采用一一对应的标识。The filtering identifiers corresponding to each encoding channel use the same identifier, or use one-to-one corresponding identifiers.
  16. 根据权利要求1或12所述的方法,其中,所述方法还包括:The method of claim 1 or 12, wherein the method further comprises:
    当初始预测块的尺寸满足预测面积阈值范围时,允许使用帧内预测平滑滤波进行滤波处理;When the size of the initial prediction block satisfies the prediction area threshold range, it is allowed to use intra prediction smoothing filtering for filtering;
    当初始预测块的尺寸大于预测面积阈值范围的上限时,将所述初始预测块进行划分,得到满足所述预测面积阈值范围的预测子块;When the size of the initial prediction block is greater than the upper limit of the prediction area threshold range, dividing the initial prediction block to obtain a prediction sub-block that satisfies the prediction area threshold range;
    针对所述预测子块实现所述帧内预测处理流程。The intra prediction processing flow is implemented for the predicted sub-block.
  17. 根据权利要求1所述的方法,其中,所述遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值之后,所述采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式之前,所述方法还包括:The method according to claim 1, wherein after the traversing the intra prediction mode and determining the initial prediction value of the initial prediction block corresponding to the current block, the initial prediction value, the first type prediction value and the second type prediction value are used. The predicted value, respectively performing rate-distortion cost calculation with the original pixel value of the current block, and before determining the current prediction mode corresponding to the optimal rate-distortion cost, the method further includes:
    对所述初始预测块分别进行帧内预测滤波,得到第一类预测值;Perform intra-frame prediction filtering on the initial prediction block respectively to obtain the first type of prediction value;
    遍历帧内预测模式,采用帧内预测平滑滤波处理对当前块进行预测估计,得到第二类预测值。Traverse the intra-frame prediction mode, and use intra-frame prediction smoothing filtering to predict and estimate the current block to obtain the second type of prediction value.
  18. 根据权利要求17所述的方法,其中,所述遍历帧内预测模式,采用帧内预测平滑滤波处理对当前块进行预测估计,得到第二类预测值,包括:The method according to claim 17, wherein the traversing the intra-frame prediction mode, using intra-frame prediction smoothing filtering processing to perform prediction estimation on the current block, to obtain the second type of prediction value, comprising:
    遍历帧内预测模式,基于所述当前块中的每个像素对应的预设水平距离和预设垂直距离,对所述当前块进行帧内预测平滑滤波处理,得到所述第二类预测值。Traverse the intra prediction mode, perform intra prediction smoothing filtering processing on the current block based on the preset horizontal distance and preset vertical distance corresponding to each pixel in the current block, and obtain the second type of prediction value.
  19. 根据权利要求6所述的方法,其中,所述方法还包括:The method of claim 6, wherein the method further comprises:
    当预设水平距离大于所述初始预测块的宽度时,采用所述上侧相邻参考像素集合中的最左侧的参考像素向左填充,直至确定出上侧相邻参考块范围的第一边界限时为止,和/或,采用所述上侧相邻参考像素集合中的最右侧的参考像素向右填充,直至确定出上侧相邻参考块范围的第二边界限时为止;When the preset horizontal distance is greater than the width of the initial prediction block, use the leftmost reference pixel in the upper adjacent reference pixel set to fill to the left, until the first area of the upper adjacent reference block range is determined Until the boundary time limit, and/or, use the rightmost reference pixel in the upper adjacent reference pixel set to fill to the right, until the second boundary time limit of the upper adjacent reference block range is determined;
    所述预设垂直距离小于等于所述初始预测块的高度时,采用所述左侧相邻参考像素集合中的最下侧的参考像素向下填充,直至确定出左侧相邻参考块范围的第三边界限时为止,和/或,采用所述左侧相邻参考像素集合中的最上侧的参考像素向上填充,直至确定出左侧相邻参考块范围的第四边界限时为止。When the preset vertical distance is less than or equal to the height of the initial prediction block, the lowermost reference pixel in the set of adjacent reference pixels on the left side is used to fill down, until the range of the adjacent reference block on the left side is determined. Until the third boundary limit, and/or, use the uppermost reference pixel in the left adjacent reference pixel set to fill upwards until the fourth boundary limit of the left adjacent reference block range is determined.
  20. 一种帧内预测方法,应用于解码器,包括:An intra-frame prediction method, applied to a decoder, comprising:
    获取码流,解析码流的头信息,得到所述滤波标识;Obtain the code stream, parse the header information of the code stream, and obtain the filter identification;
    当所述滤波标识为表征帧内预测滤波允许标识有效、且帧内预测平滑滤波允许标识有效时,至少从码流中获取当前预测模式和帧内预测滤波使用标识;When the filtering flag indicates that the intra-frame prediction filtering permission flag is valid and the intra-frame prediction smoothing filtering permission flag is valid, at least obtain the current prediction mode and the intra-frame prediction filtering use flag from the code stream;
    当所述帧内预测滤波使用标识为无效、且从码流中获取到有效的帧内预测平滑滤波使用标识时,基于所述当前预测模式,对当前块进行帧内预测平滑滤波处理,得到第一预测值。When the intra-frame prediction filtering use flag is invalid and a valid intra-frame prediction smoothing filter use flag is obtained from the code stream, based on the current prediction mode, perform intra-frame prediction smoothing filtering processing on the current block to obtain the first a predicted value.
  21. 根据权利要求20所述的方法,其中,所述至少从码流中获取当前预测模式和帧内预测滤波使用标识之后,所述方法还包括:The method according to claim 20, wherein after obtaining at least the current prediction mode and the intra-frame prediction filtering use identifier from the code stream, the method further comprises:
    当所述帧内预测滤波使用标识为有效时,从码流中获取当前预测模式;When the intra-frame prediction filtering use flag is valid, obtain the current prediction mode from the code stream;
    基于所述当前预测模式,对当前块进行帧内预测滤波处理,得到第二预测值。Based on the current prediction mode, intra prediction filtering is performed on the current block to obtain a second prediction value.
  22. 根据权利要求20所述的方法,其中,所述基于所述当前预测模式,对当前块进行帧内预测平滑滤波处理,得到第一预测值,包括:The method according to claim 20, wherein, based on the current prediction mode, performing intra-frame prediction smoothing filtering processing on the current block to obtain the first predicted value, comprising:
    基于所述当前块中的每个像素对应的预设水平距离和预设垂直距离,对所述当前块进行帧内预测平滑滤波处理,得到所述第一预测值。Based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the current block, perform intra prediction smoothing filtering processing on the current block to obtain the first predicted value.
  23. 根据权利要求22所述的方法,其中,所述基于所述当前块中的每个像素对应的预设水 平距离和预设垂直距离,对所述当前块进行帧内预测平滑滤波处理,得到所述第一预测值,包括:The method according to claim 22, wherein, based on the preset horizontal distance and preset vertical distance corresponding to each pixel in the current block, performing intra-frame prediction smoothing filtering processing on the current block to obtain the The first predicted value, including:
    基于所述当前块中的每个像素对应的所述预设水平距离和所述预设垂直距离,确定与所述每个像素对应的至少两个相邻参考像素集合的至少两个相邻参考块范围;Based on the preset horizontal distance and the preset vertical distance corresponding to each pixel in the current block, at least two adjacent reference pixels of at least two adjacent reference pixel sets corresponding to each pixel are determined block range;
    从所述至少两个相邻参考像素集合中,对应确定出属于所述至少两个相邻参考块范围内的至少两个目标参考像素集合;其中,每个目标参考像素集合中包含至少一个目标参考像素;From the at least two adjacent reference pixel sets, at least two target reference pixel sets belonging to the at least two adjacent reference blocks are correspondingly determined; wherein, each target reference pixel set includes at least one target reference pixel;
    基于所述至少两个目标参考像素集合,对所述每个像素进行帧内预测平滑滤波处理,得到所述第一预测值。Based on the at least two target reference pixel sets, intra-frame prediction smoothing filtering is performed on each pixel to obtain the first predicted value.
  24. 根据权利要求23所述的方法,其中,所述从所述至少两个相邻参考像素集合中,对应确定出属于所述至少两个相邻参考块范围内的至少两个目标参考像素集合,包括:The method according to claim 23, wherein the at least two target reference pixel sets belonging to the range of the at least two adjacent reference blocks are correspondingly determined from the at least two adjacent reference pixel sets, include:
    从所述至少两个相邻参考像素集合中,确定每个相邻参考块范围的两个边界像素位置的像素为一个目标参考像素集合,从而确定出所述至少两个目标参考像素集合。From the at least two adjacent reference pixel sets, pixels at two boundary pixel positions of each adjacent reference block range are determined as a target reference pixel set, thereby determining the at least two target reference pixel sets.
  25. 根据权利要求23所述的方法,其中,所述从所述至少两个相邻参考像素集合中,对应确定出属于所述至少两个相邻参考块范围内的至少两个目标参考像素集合,包括:The method according to claim 23, wherein the at least two target reference pixel sets belonging to the range of the at least two adjacent reference blocks are correspondingly determined from the at least two adjacent reference pixel sets, include:
    从所述至少两个相邻参考像素集合中,确定每个相邻参考块范围内的任意像素位置的M个像素为一个目标参考像素集合,从而确定出所述至少两个目标参考像素集合,其中,M为大于0,且不超过对应的相邻参考像素集合的最大像素数量。From the at least two adjacent reference pixel sets, M pixels at any pixel position within the range of each adjacent reference block are determined as a target reference pixel set, thereby determining the at least two target reference pixel sets, Wherein, M is greater than 0 and does not exceed the maximum number of pixels in the corresponding adjacent reference pixel set.
  26. 根据权利要求23至25任一项所述的方法,其中,The method of any one of claims 23 to 25, wherein,
    所述至少两个相邻参考像素集合包括:左侧相邻参考像素集合和上侧相邻参考像素集合;The at least two adjacent reference pixel sets include: a left adjacent reference pixel set and an upper adjacent reference pixel set;
    所述至少两个相邻参考块范围包括:左侧相邻参考像素范围和上侧相邻参考像素范围;The at least two adjacent reference block ranges include: a left adjacent reference pixel range and an upper adjacent reference pixel range;
    所述至少两个目标参考像素集合包括:左侧目标相邻参考像素集合和上侧目标相邻参考像素集合。The at least two target reference pixel sets include: a left target adjacent reference pixel set and an upper target adjacent reference pixel set.
  27. 根据权利要求23至26任一项所述的方法,其中,The method of any one of claims 23 to 26, wherein,
    所述预设水平距离小于等于所述初始预测块的宽度;所述预设垂直距离小于等于所述初始预测块的高度;The preset horizontal distance is less than or equal to the width of the initial prediction block; the preset vertical distance is less than or equal to the height of the initial prediction block;
    所述初始预测块的n行m列位置的第一类像素对应的预设水平距离和所述预设垂直距离,与所述初始预测块的除n行m列之外的其他类像素对应的预设水平距离和所述预设垂直距离不同;n和m为自然数;The preset horizontal distance and the preset vertical distance corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are the same as those corresponding to other types of pixels except n rows and m columns of the initial prediction block. The preset horizontal distance is different from the preset vertical distance; n and m are natural numbers;
    所述第一类像素中的每个像素对应的预设水平距离和所述预设垂直距离至少部分相同,或者均不相同;The preset horizontal distance corresponding to each pixel in the first type of pixels is at least partially the same as the preset vertical distance, or both are different;
    所述其他类像素中的每个像素对应的预设水平距离和所述预设垂直距离至少部分相同,或者均不相同。The preset horizontal distance and the preset vertical distance corresponding to each of the other types of pixels are at least partially the same, or both are different.
  28. 根据权利要求23至27任一项所述的方法,其中,所述基于所述至少两个目标参考像素集合,对所述每个像素进行帧内预测平滑滤波处理,得到所述第二类预测值,包括:The method according to any one of claims 23 to 27, wherein, based on the at least two target reference pixel sets, performing intra-frame prediction smoothing filtering processing on each pixel to obtain the second type of prediction values, including:
    确定滤波系数;determine the filter coefficient;
    基于所述至少两个目标参考像素集合和所述滤波系数,对所述每个像素进行帧内预测平滑滤波处理,得到所述第二类预测值。Based on the at least two target reference pixel sets and the filter coefficients, intra-frame prediction smoothing filtering is performed on each pixel to obtain the second type of prediction value.
  29. 根据权利要求22所述的方法,其中,The method of claim 22, wherein,
    所述初始预测块的n行m列位置的第一类像素对应的滤波系数,与所述初始预测块的除n行m列之外的其他类像素对应的滤波系数不同;n和m为自然数;The filter coefficients corresponding to the first type of pixels in the position of n rows and m columns of the initial prediction block are different from the filter coefficients corresponding to other types of pixels except for n rows and m columns of the initial prediction block; n and m are natural numbers ;
    所述第一类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同;The filter coefficients corresponding to each pixel in the first type of pixels are at least partially the same, or all different;
    所述其他类像素中的每个像素对应的滤波系数至少部分相同,或者均不相同。The filter coefficients corresponding to each pixel in the other types of pixels are at least partially the same, or all different.
  30. 根据权利要求26所述的方法,其中,The method of claim 26, wherein,
    当预设水平距离大于所述初始预测块的宽度时,采用所述上侧相邻参考像素集合中的最左侧的参考像素向左填充,直至确定出上侧相邻参考块范围的第一边界限时为止,和/或,采用所述上侧相邻参考像素集合中的最右侧的参考像素向右填充,直至确定出上侧相邻参考块范围的第二边界限时为止;When the preset horizontal distance is greater than the width of the initial prediction block, use the leftmost reference pixel in the upper adjacent reference pixel set to fill to the left, until the first area of the upper adjacent reference block range is determined Until the boundary time limit, and/or, use the rightmost reference pixel in the upper adjacent reference pixel set to fill to the right, until the second boundary time limit of the upper adjacent reference block range is determined;
    所述预设垂直距离小于等于所述初始预测块的高度时,采用所述左侧相邻参考像素集合中的最下侧的参考像素向下填充,直至确定出左侧相邻参考块范围的第三边界限时为止,和/或,采用所述左侧相邻参考像素集合中的最上侧的参考像素向上填充,直至确定出左侧相邻参考块范围的第四边界限时为止。When the preset vertical distance is less than or equal to the height of the initial prediction block, the lowermost reference pixel in the set of adjacent reference pixels on the left side is used to fill down, until the range of the adjacent reference block on the left side is determined. Until the third boundary limit, and/or, use the uppermost reference pixel in the left adjacent reference pixel set to fill upwards until the fourth boundary limit of the left adjacent reference block range is determined.
  31. 一种编码器,包括:An encoder comprising:
    第一确定部分,被配置为遍历帧内预测模式,确定出当前块对应的初始预测块的初始预测值;The first determining part is configured to traverse the intra prediction mode, and determine the initial prediction value of the initial prediction block corresponding to the current block;
    第一滤波部分,被配置为对所述初始预测块分别进行帧内预测滤波和帧内预测平滑滤波处理,得到第一类预测值和第二类预测值;其中,所述帧内预测平滑滤波为采用至少两个相邻参考像素集合中每个相邻参考像素集合中的多个相邻参考像素,对所述当前块进行滤波的过程;The first filtering part is configured to perform intra-frame prediction filtering and intra-frame prediction smoothing filtering respectively on the initial prediction block to obtain a first-type prediction value and a second-type prediction value; wherein, the intra-frame prediction smoothing filtering process A process of filtering the current block for using a plurality of adjacent reference pixels in each adjacent reference pixel set in at least two adjacent reference pixel sets;
    所述第一确定部分,还被配置为采用初始预测值、第一类预测值和第二类预测值,分别与当前块的原始像素值进行率失真代价计算,确定出最优率失真代价对应的当前预测模式;The first determining part is further configured to use the initial prediction value, the first type prediction value and the second type prediction value to calculate the rate-distortion cost with the original pixel value of the current block, respectively, and determine the corresponding optimal rate-distortion cost. The current forecast mode of ;
    第一预测部分,被配置为采用所述当前预测模式,对所述当前块进行帧内预测;a first prediction part configured to use the current prediction mode to perform intra prediction on the current block;
    写入部分,被配置为将所述当前预测模式的索引信息,以及滤波标识写入码流,其中,滤波标识表征帧内预测滤波和/或帧内预测平滑滤波对应的标识。The writing part is configured to write the index information of the current prediction mode and the filter identifier into the code stream, wherein the filter identifier represents an identifier corresponding to intra-frame prediction filtering and/or intra-frame prediction smoothing filtering.
  32. 一种解码器,包括:A decoder including:
    解析部分,被配置为获取码流,解析码流的头信息,得到所述滤波标识;以及当所述滤波标识为表征帧内预测滤波允许标识有效、且帧内预测平滑滤波允许标识有效时,至少从码流中获取当前预测模式和帧内预测滤波使用标识;The parsing part is configured to obtain the code stream, parse the header information of the code stream, and obtain the filtering identifier; and when the filtering identifier is an indication that the intra-frame prediction filtering permission flag is valid, and the intra-frame prediction smoothing filtering permission flag is valid, Obtain at least the current prediction mode and intra-frame prediction filtering use identifier from the code stream;
    第二预测部分,被配置为当所述帧内预测滤波使用标识为无效、且从码流中获取到有效的帧内预测平滑滤波使用标识时,基于所述当前预测模式,对当前块进行帧内预测平滑滤波处理,得到第一预测值。The second prediction part is configured to, based on the current prediction mode, frame the current block when the intra-frame prediction filtering use flag is invalid and a valid intra-frame prediction smoothing filter use flag is obtained from the code stream The intra-prediction smoothing filtering process is performed to obtain the first predicted value.
  33. 一种编码器,包括:An encoder comprising:
    第一存储器和第一处理器;a first memory and a first processor;
    所述第一存储器存储有可在第一处理器上运行的计算机程序,所述第一处理器执行所述程序时实现权利要求1至19任一项所述帧内预测方法。The first memory stores a computer program executable on the first processor, and the first processor implements the intra prediction method of any one of claims 1 to 19 when the first processor executes the program.
  34. 一种解码器,包括:A decoder including:
    第二存储器和第二处理器;a second memory and a second processor;
    所述第二存储器存储有可在第二处理器上运行的计算机程序,所述第二处理器执行所述程序时实现权利要求20至30任一项所述帧内预测方法。The second memory stores a computer program executable on the second processor, and when the second processor executes the program, the intra prediction method of any one of claims 20 to 30 is implemented.
  35. 一种存储介质,其上存储有计算机程序,该计算机程序被第一处理器执行时,实现权利要求1至19任一项所述帧内预测方法;或者,该计算机程序被第二处理器执行时,实现权利要求20至30任一项所述帧内预测方法。A storage medium on which a computer program is stored, and when the computer program is executed by the first processor, the intra-frame prediction method of any one of claims 1 to 19 is implemented; or, the computer program is executed by the second processor When the intra-frame prediction method described in any one of claims 20 to 30 is implemented.
PCT/CN2020/121668 2020-10-16 2020-10-16 Intra prediction method, encoder, decoder, and storage medium WO2022077490A1 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN202080106028.7A CN116325727A (en) 2020-10-16 2020-10-16 Intra-frame prediction method, encoder, decoder and storage medium
CN202310996326.3A CN116980596A (en) 2020-10-16 2020-10-16 Intra-frame prediction method, encoder, decoder and storage medium
PCT/CN2020/121668 WO2022077490A1 (en) 2020-10-16 2020-10-16 Intra prediction method, encoder, decoder, and storage medium
MX2023000279A MX2023000279A (en) 2020-10-16 2020-10-16 Intra prediction method, encoder, decoder, and storage medium.

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/121668 WO2022077490A1 (en) 2020-10-16 2020-10-16 Intra prediction method, encoder, decoder, and storage medium

Publications (1)

Publication Number Publication Date
WO2022077490A1 true WO2022077490A1 (en) 2022-04-21

Family

ID=81208894

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/121668 WO2022077490A1 (en) 2020-10-16 2020-10-16 Intra prediction method, encoder, decoder, and storage medium

Country Status (3)

Country Link
CN (2) CN116325727A (en)
MX (1) MX2023000279A (en)
WO (1) WO2022077490A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114598880A (en) * 2022-05-07 2022-06-07 深圳传音控股股份有限公司 Image processing method, intelligent terminal and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016091122A1 (en) * 2014-12-11 2016-06-16 Mediatek Inc. Method and apparatus of intra prediction in video coding
CN107148778A (en) * 2014-10-31 2017-09-08 联发科技股份有限公司 Improved directional intra-prediction method for Video coding
CN109076237A (en) * 2015-11-18 2018-12-21 联发科技股份有限公司 The method and apparatus of the intra prediction mode of intra-frame prediction filtering device are used in video and compression of images
CN110166773A (en) * 2019-06-25 2019-08-23 浙江大华技术股份有限公司 Intra-frame prediction method, method for video coding, video process apparatus, storage medium
US20200007895A1 (en) * 2018-07-02 2020-01-02 Qualcomm Incorporated Combining mode dependent intra smoothing (mdis) with intra interpolation filter switching

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107148778A (en) * 2014-10-31 2017-09-08 联发科技股份有限公司 Improved directional intra-prediction method for Video coding
WO2016091122A1 (en) * 2014-12-11 2016-06-16 Mediatek Inc. Method and apparatus of intra prediction in video coding
CN109076237A (en) * 2015-11-18 2018-12-21 联发科技股份有限公司 The method and apparatus of the intra prediction mode of intra-frame prediction filtering device are used in video and compression of images
US20200007895A1 (en) * 2018-07-02 2020-01-02 Qualcomm Incorporated Combining mode dependent intra smoothing (mdis) with intra interpolation filter switching
CN110166773A (en) * 2019-06-25 2019-08-23 浙江大华技术股份有限公司 Intra-frame prediction method, method for video coding, video process apparatus, storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A. FILIPPOV (HUAWEI), V. RUFITSKIY (HUAWEI), E. ALSHINA (HUAWEI): "AHG9: On high-level syntax for smoothing intra prediction tools", 131. MPEG MEETING; 20200629 - 20200703; ONLINE; (MOTION PICTURE EXPERT GROUP OR ISO/IEC JTC1/SC29/WG11), 29 May 2020 (2020-05-29), pages 1 - 4, XP030285436 *
A. K. RAMASUBRAMONIAN (QUALCOMM), G. VAN DER AUWERA (QUALCOMM), M. KARCZEWICZ (QUALCOMM): "Non-CE3: Simplification of reference sample smoothing in intra prediction", 15. JVET MEETING; 20190703 - 20190712; GOTHENBURG; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 26 June 2019 (2019-06-26), Gothenburg SE, pages 1 - 3, XP030220156 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114598880A (en) * 2022-05-07 2022-06-07 深圳传音控股股份有限公司 Image processing method, intelligent terminal and storage medium

Also Published As

Publication number Publication date
CN116325727A (en) 2023-06-23
MX2023000279A (en) 2023-02-09
CN116980596A (en) 2023-10-31

Similar Documents

Publication Publication Date Title
JP7425241B2 (en) Video encoding and decoding based on bidirectional optical flow
US11523111B2 (en) Encoder, a decoder and corresponding methods using an adaptive loop filter
KR102123958B1 (en) Method for reducing real-time video noise in coding process, terminal, and computer-readable non-volatile storage medium
JP5937212B2 (en) Depth encoding
US11889102B2 (en) Filtering method for removing blocking artifact and apparatus
WO2021165018A1 (en) Neural network-based intra prediction for video encoding or decoding
CN114287133A (en) Weighting factors for predictive sampling filtering in intra mode
CN115336270A (en) Method and apparatus for video filtering
JP7481332B2 (en) Prediction method and apparatus for decoding, and computer storage medium - Patents.com
WO2022077490A1 (en) Intra prediction method, encoder, decoder, and storage medium
CN114223200B (en) Position dependent intra prediction sampling point filtering
KR20210070368A (en) Video image element prediction method and apparatus, computer storage medium
CN113489974B (en) Intra-frame prediction method, video/image encoding and decoding method and related devices
WO2022022622A1 (en) Image coding method, image decoding method, and related apparatus
CN114071161B (en) Image encoding method, image decoding method and related devices
US20210014511A1 (en) Image processing apparatus and method
WO2020258052A1 (en) Image component prediction method and device, and computer storage medium
EP3957073A1 (en) Method and apparatus for video encoding and decoding with optical flow based on boundary smoothed motion compensation
JP4719108B2 (en) VIDEO ENCODING METHOD, VIDEO ENCODING DEVICE, VIDEO ENCODING PROGRAM, AND COMPUTER-READABLE RECORDING MEDIUM CONTAINING THE PROGRAM
CN115398893B (en) Method for filtering in video codec and apparatus for video decoding
US10992942B2 (en) Coding method, decoding method, and coding device
WO2020258053A1 (en) Image component prediction method and apparatus, and computer storage medium
JP2023030585A (en) Image encoder, method and program
WO2022197326A1 (en) Method and apparatus for video coding
TW202406338A (en) Method and apparatus for adaptive loop filter with chroma classifier for video coding

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20957268

Country of ref document: EP

Kind code of ref document: A1