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

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

Info

Publication number
CN114830651A
CN114830651A CN202080083248.2A CN202080083248A CN114830651A CN 114830651 A CN114830651 A CN 114830651A CN 202080083248 A CN202080083248 A CN 202080083248A CN 114830651 A CN114830651 A CN 114830651A
Authority
CN
China
Prior art keywords
partition
block vector
block
determining
value
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202080083248.2A
Other languages
Chinese (zh)
Inventor
袁锜超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN114830651A publication Critical patent/CN114830651A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Landscapes

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

Abstract

The embodiment of the application discloses an intra-frame prediction method, an encoder, a decoder and a computer storage medium, wherein the method comprises the following steps: determining a prediction mode parameter of a current block; determining first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block when the prediction mode parameter indicates that the non-rectangular block copy, INBC, mode is used; determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information; determining a first weight value of the first partition and a second weight value of the second partition; and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block. In this way, when the intra prediction value of the current block is determined using the INBC mode, the coding efficiency of the video sequence may be improved.

Description

Intra prediction method, encoder, decoder, and computer storage medium Technical Field
The present disclosure relates to the field of encoding and decoding technologies, and in particular, to an intra prediction method, an encoder, a decoder, and a computer storage medium.
Background
With the rapid development of scientific technology, people have higher and higher requirements on Video viewing and processing, and especially people have an increasing demand on Screen Content Video (SCV). Among them, for the characteristics of high contrast, limited color data, and many repetitive areas of the Screen Content, an extended Coding standard, Screen Content Coding (SCC), has been proposed at present.
In the related art, Intra Block Copy (IBC) technology can be used to predict repeated/cyclic occurrence local image features, and is applied to screen content coding, but it copies a reference Block in its entirety, and does not consider some boundary information of local image features, limiting the coding efficiency of IBC technology and its application in common sequences; however, for the Angle Weighted Prediction (AWP) technique, it is applied to the inter-frame image to process the boundary information, but not applied to the processing of the intra-frame block, so that the intra-frame image cannot have the same tool as the inter-frame image for processing the edge information, and the coding and decoding efficiency of the video sequence is reduced.
Disclosure of Invention
The embodiment of the application provides an intra-frame prediction method, an encoder, a decoder and a computer storage medium, which can improve the coding and decoding efficiency of a video sequence.
The technical scheme of the embodiment of the application can be realized as follows:
in a first aspect, an embodiment of the present application provides an intra prediction method applied to an encoder, where the method includes:
determining a prediction mode parameter of a current block;
determining first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block when the prediction mode parameter indicates that the non-rectangular block copy, INBC, mode is used;
determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information;
determining a first weight value of the first partition and a second weight value of the second partition;
and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block.
In a second aspect, an embodiment of the present application provides an intra prediction method applied to a decoder, where the method includes:
analyzing the code stream to obtain the prediction mode parameter of the current block;
when the prediction mode parameter indicates that the INBC mode is used, analyzing a code stream to obtain a first block vector index sequence number and a second block vector index sequence number;
determining, based on a block vector candidate list, first target block vector information of a first partition of a current block corresponding to the first block vector index number in the block vector candidate list, and second target block vector information of a second partition of the current block corresponding to the second block vector index number in the block vector candidate list;
determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information;
determining a first weight value of the first partition and a second weight value of the second partition;
and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block.
In a third aspect, an embodiment of the present application provides an encoder, including a first determining unit, a first calculating unit, and a first predicting unit; wherein the content of the first and second substances,
the first determining unit is configured to determine a prediction mode parameter of the current block;
the first determination unit is further configured to determine first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block when the prediction mode parameter indicates that the INBC mode is used;
the first calculation unit is configured to determine a first prediction value of the first partition according to the first target block vector information, and determine a second prediction value of the second partition according to the second target block vector information; and determining a first weight value of the first partition and a second weight value of the second partition;
the first prediction unit is configured to perform weighted fusion by using the first prediction value, the first weight value, the second prediction value and the second weight value to determine an intra prediction value of the current block.
In a fourth aspect, an embodiment of the present application provides an encoder, including a first memory and a first processor; wherein the content of the first and second substances,
a first memory for storing a computer program operable on a first processor;
a first processor for performing the method according to the first aspect when running the computer program.
In a fifth aspect, an embodiment of the present application provides a decoder, where the decoder includes a parsing unit, a second determining unit, a second calculating unit, and a second predicting unit; wherein the content of the first and second substances,
the analysis unit is configured to analyze the code stream and obtain the prediction mode parameter of the current block; and further configured to parse the code stream to obtain a first block vector index sequence number and a second block vector index sequence number when the prediction mode parameter indicates that the INBC mode is used;
the second determining unit is configured to determine, based on a block vector candidate list, first target block vector information of a first partition of a current block corresponding to the first block vector index number in the block vector candidate list, and second target block vector information of a second partition of the current block corresponding to the second block vector index number in the block vector candidate list;
the second calculation unit is configured to determine a first prediction value of the first partition according to the first target block vector information, and determine a second prediction value of the second partition according to the second target block vector information; and determining a first weight value of the first partition and a second weight value of the second partition;
the second prediction unit is configured to perform weighted fusion by using the first prediction value, the first weight value, the second prediction value and the second weight value to determine an intra prediction value of the current block.
In a sixth aspect, an embodiment of the present application provides a decoder, which includes a second memory and a second processor; wherein, the first and the second end of the pipe are connected with each other,
a second memory for storing a computer program operable on a second processor;
a second processor for performing the method according to the second aspect when running the computer program.
In a seventh aspect, the present application provides a computer storage medium storing a computer program, where the computer program implements the method according to the first aspect when executed by a first processor or implements the method according to the second aspect when executed by a second processor.
The embodiment of the application provides an intra-frame prediction method, an encoder, a decoder and a computer storage medium, wherein on the encoder side, the prediction mode parameters of a current block are determined; determining first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block when the prediction mode parameter indicates that the INBC mode is used; determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information; determining a first weight value of the first partition and a second weight value of the second partition; and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block. On the decoder side, acquiring the prediction mode parameter of the current block by analyzing the code stream; when the prediction mode parameter indicates that an INBC mode is used, analyzing a code stream to obtain a first block vector index sequence number and a second block vector index sequence number; determining, based on a block vector candidate list, first target block vector information of a first partition of a current block corresponding to the first block vector index number in the block vector candidate list, and second target block vector information of a second partition of the current block corresponding to the second block vector index number in the block vector candidate list; determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information; determining a first weight value of the first partition and a second weight value of the second partition; and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block. Therefore, the boundary information in the image block is processed by using different angle weighting in the intra-frame prediction, and the edge information of two parts of different texture/color distribution in the same partition block, sharp object edges in the intra-frame image, the boundary between the foreground and the background, the boundary information of a common sequence and the like can be better processed, so that the intra-frame image and the inter-frame image have a tool for processing the edge information, and the coding and decoding efficiency of a video sequence is effectively improved.
Drawings
FIG. 1 is a diagram illustrating eight angles that can be supported by an angular weighted prediction mode provided in the related art;
FIG. 2 is a schematic diagram illustrating a configuration of reference weights supportable by an angular weighted prediction mode according to the related art;
FIG. 3A is a diagram illustrating angle numbers and corresponding partitions in an angle weighted prediction mode according to the related art;
FIG. 3B is a diagram illustrating angle numbers and corresponding slopes in an angle weighted prediction mode according to the related art;
FIG. 4 is a schematic diagram illustrating a position relationship between a current block and an adjacent block according to the related art;
fig. 5 is a schematic structural diagram of an application IBC technique provided in the related art;
FIG. 6 is a diagram illustrating a partial feature with boundary information in a normal sequence provided by the related art;
fig. 7A is a block diagram of a video coding system according to an embodiment of the present application;
fig. 7B is a block diagram illustrating a video decoding system according to an embodiment of the present application;
fig. 8 is a flowchart illustrating an intra prediction method according to an embodiment of the present application;
FIG. 9 is a flowchart illustrating another intra prediction method according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an encoder according to an embodiment of the present disclosure;
fig. 11 is a schematic hardware structure diagram of an encoder according to an embodiment of the present disclosure;
fig. 12 is a schematic structural diagram of a decoder according to an embodiment of the present application;
fig. 13 is a schematic hardware structure diagram of a decoder according to an embodiment of the present disclosure.
Detailed Description
So that the manner in which the features and elements of the present embodiments can be understood in detail, a more particular description of the embodiments, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings.
In a video image, a Coding Block (CB) is generally characterized by a first image component, a second image component, and a third image component; wherein the three image components are a luminance component, a blue chrominance component and a red chrominance component, respectively. In particular, the luminance component is typically represented using the symbol Y, the blue chrominance component is typically represented using the symbol Cb or U, and the red chrominance component is typically represented using the symbol Cr or V; thus, the video image can be represented in YCbCr format, and also in YUV format.
In the embodiment of the present application, the first image component may be a luminance component, the second image component may be a blue chrominance component, and the third image component may be a red chrominance component, but is not particularly limited herein.
Currently, as the demand for Video display quality increases, when encoding High-quality Video having one or more characteristics of High resolution, High frame rate, High bit depth, High dynamic range, wide color gamut, and omni-directional view, compared to the h.265/High Efficiency Video Coding (HEVC) standard, the performance of h.266/multi-function Video Coding (VVC) is improved by about 50%, a Joint Video Experts group (jmet) is responsible for the standardized project, and various intra prediction modes and inter prediction modes have been verified to achieve High compression Efficiency when encoding High-quality Video, and thus are adopted in VVC.
In order to capture the finer edge directions present in video, an Angular Weighted Prediction (AWP) mode is proposed in the video coding standard, by exploiting the idea of intra-frame Angular Prediction: the reference weight value of the peripheral position (including the integer pixel position and the sub-pixel position) of the current block can be set firstly, then the weight value corresponding to each pixel position is obtained by using an angle prediction method, and then the weighting of two different interframe predicted values is realized through the obtained weight value.
The minimum block size supported by the angle weighted prediction mode is 8 × 8, the maximum block size is 64 × 64, and here, 8 angles can be supported in total, the absolute values of weighted prediction slopes of the 8 angles are five, namely { Horizontal (HOR), Vertical (VER), 1,2, 1/2}, and since each angle can support 7 reference weight reconfigurations, the number of modes of the angle weighted prediction mode is 56 for each block. Referring to fig. 1, a diagram of eight angles that can be supported by one angle weighted prediction mode provided in the related art is shown. In fig. 1, the 8-bar arrowed diagonal lines indicate eight angles that can be supported.
Referring to fig. 2, a schematic diagram of a reference weight configuration that can be supported by an angular weighted prediction mode provided in the related art is shown. In fig. 2, it provides 7 predicted positions of reference weights. Specifically, the reference weight configuration may be a distribution function of reference weight values obtained according to the reference weight index values, and the non-strict monotone increasing function assignment is performed with 8 equal-point positions of the reference weight effective length as reference points, where the reference weight effective length may be calculated from the prediction angle and the current block size.
It should be understood that, for the 8 angles shown in fig. 1, they can be divided into 4 partitions, as shown in fig. 3A, which shows a schematic diagram of the angle numbers and the corresponding partitions in one angle weighted prediction mode provided by the related art. In fig. 3A, filled with left oblique lines is an angle partition 0, which includes two angles, angle 0 and angle 1; the angle subarea 1 is filled by grid oblique lines and comprises two angles, namely an angle 2 and an angle 3; filled with dots are angular sectors 2, which include two angles, angle 4 and angle 5; filled with right diagonal lines is an angular sector 3, which includes both angles 6 and 7. Fig. 3B is a schematic diagram illustrating angle numbers and corresponding slopes in an angle weighted prediction mode provided by the related art. In fig. 3B, the slope corresponding to angle 0 is 1, the slope corresponding to angle 1 is 1/2, the slope corresponding to angle 2 is horizontal, the slope corresponding to angle 3 is-1/2, the slope corresponding to angle 4 is-1, the slope corresponding to angle 5 is-2, the slope corresponding to angle 6 is vertical, and the slope corresponding to angle 7 is 2.
It should be noted that, the formula derived from the pixel-by-pixel weight at this time is slightly different according to the different regions in which the angles are located. Assume that the block size of the current block is mxn, where M is the width, N is the height, X is log2 (weight prediction angle slope absolute value), and Y is the weight prediction position.
In the following, taking the angle 0 and the angle 1 in the angle partition 0 as an example, the weight value is derived as follows:
(a) as for the weight value of the luminance component,
first, the effective length of the reference weight is calculated, which can be expressed by ValidLength, as shown below,
ValidLength=(N+(M>>X))<<1 (1)
secondly, a reference weight value is set and is expressed by ReferenceWeights [ x ], wherein the value range of x is 0 to (ValidLength-1). Here, the first and second liquid crystal display panels are,
FirstPos=(ValidLength>>1)-6+Y×((ValidLength-1)>>3) (2)
ReferenceWeights[x]=Clip3(0,8,x-FirstPos) (3)
again, the pixel-by-pixel derived luminance weights are denoted by SampleWeight [ x ] [ y ], as follows,
SampleWeight[x][y]=ReferenceWeights[(y<<1)+((x<<1)>>X)] (4)
(b) as for the weight values of the chrominance components,
the derivation of the chroma weight can directly take the position of the upper left corner corresponding to the 2x 2 luma weight, and assume that the block size of the current block is M x N, wherein M is the width and N is the height, then the value range of x is 0 to (M/2-1); the value of y ranges from 0 to (N/2-1). The pixel-by-pixel derived chroma weights are denoted by SampleWeightChroma [ x ] [ y ], as follows,
SampleWedghtChroma[x][y]=SampleWedght[x>>1][y>>1] (5)
here, ">" "denotes the right shift operator," < < "" denotes the left shift operator, Clip3 denotes the bit operator, and x-FirstPos is embedded between 0 and 8.
It should be further noted that the motion vector storage scheme of the angular weighted prediction mode is related to the angular partition. Here, it is assumed that the block size of the current block is M × N, where M is a width, N is a height, X is log2 (weight prediction angle slope absolute value), and Y is a weight prediction position. Still taking the angle 0 and the angle 1 in the angle partition 0 as an example, the motion vector storage scheme is as follows,
first, the effective length of the reference weight, denoted by ValidLenth, is calculated, as shown below,
ValidLength=(N+(M>>X))<<1 (6)
secondly, for each 4 x 4 block in the current block, the flag is marked with its center position (x, y), then
FirstPos=(ValidLength>>1)-6+Y×((ValidLength-1)>>3) (7)
Next, it is determined whether (y < 1) + ((X < 1) > X) is greater than or equal to FirstPos. Wherein if (y < 1) + ((X < 1) > X) is greater than or equal to FirstPos, storing the first motion information; otherwise, the second motion information is stored. Here, the current block is divided into two partitions (e.g., a first partition and a second partition) using an angular prediction weighting mode, where the first motion information refers to motion information corresponding to the first partition, and the second motion information refers to motion information corresponding to the second partition.
In addition, the angular weighted prediction mode needs two unidirectional motion vectors for weighted prediction, and the unidirectional motion vectors can be selected from the candidate motion vector list according to the index (index) in the code stream. Referring to fig. 4, a schematic diagram of a position relationship between a current block and a neighboring block provided in the related art is shown. As shown in fig. 4, the current block is filled with white and the neighboring blocks are filled with gray. Here, there may be a number of neighboring blocks, such as represented by A, B, C, D, F, G, for the current block.
Based on fig. 4, the process of constructing the candidate motion vector list is as follows,
the first step, F, G, C, A and D are neighboring blocks of the current block, requires determining F, G, C, A, D "availability":
i) f is "available" if F exists and inter prediction mode is employed; otherwise, F is "unavailable".
j) G is "available" if it exists and inter prediction mode is employed; otherwise, G is "unavailable".
k) C is "available" if C exists and inter prediction mode is employed; otherwise, C is "unavailable".
l) if A is present and inter prediction mode is employed, then A is "available"; otherwise, a is "unavailable".
n) if D is present and inter prediction mode is employed, D is "available"; otherwise, D is "unavailable".
In the second step, the motion vectors of these neighboring blocks are placed in the candidate motion vector list after being repeated in F, G, C, A and D. Wherein, the duplicate checking scheme is as follows: and (4) checking duplicate of G and F, checking duplicate of C and G, checking duplicate of A and F, and checking duplicate of D and G and A. If the number of the motion vectors which are subjected to the duplication checking and are put into the candidate motion vector list is more than 4, only the first four motion vectors are put into the candidate motion vector list.
And thirdly, putting the derived time domain bidirectional motion vector into a candidate motion vector list.
And fourthly, if the number of the motion vectors in the candidate motion vector list is less than 5, scaling the first motion vector according to different directions, and filling the scaled motion vectors into the candidate motion vector list until the number of the motion vectors in the candidate motion vector list is 5.
It can be understood that, according to the characteristics of the screen content, for the screen content sequences such as text, graphics, etc., many repeated textures exist in the same frame, i.e., the spatial correlation is strong. If the coded block in the current frame can be referred to when the current block is coded, the coding efficiency can be greatly improved. Specifically, for the characteristic of strong spatial correlation of screen images, the technique of referencing the coded blocks in the current frame and using the coded blocks in the current frame for predicting the current Block is called Intra Block Copy (IBC) technique. Here, IBC is similar to inter prediction, except that a predicted block of IBC is generated from a reconstructed block within a current image frame.
Referring to fig. 5, a schematic structural diagram of an application IBC technique provided in the related art is shown. As shown in fig. 5, for a current image frame, i.e. a Coding Tree Unit (CTU), a region filled with dots in the CTU is a search region (i.e. a coded region of the current image frame), black shaded blocks are respectively a current Coding Block (Coding Unit, CU) and a matching prediction Block (Block Predictor, also called a reference Block), and a distance from the current Coding Block to the matching reference Block is called a Block Vector (BV). Since the current block at the lower right is very similar to the reference block coded at the upper left, if the position of the reference block at the upper left is found by a searching method at the encoder side, only a position vector (BV) between two blocks needs to be transmitted in the code stream, and then the accurate prediction value can be obtained by the decoder through the information. Compared with a common intra-frame prediction mode, the IBC technology can better utilize intra-frame redundant information and obtain the improvement of coding performance.
However, in the related art, the IBC technique can be used to predict repeated/cyclic local image features for screen content coding, but it copies the reference block in its entirety and does not take into account some boundary information of the local image features, as shown by the rectangular box in fig. 6. In addition, the IBC technology is currently used only in Screen Content Coding (SCC), which limits the Coding efficiency of the IBC technology and its application in common sequences. However, for the AWP technique, it is applied to the inter-frame image to process the boundary information, but not applied to the processing of the intra-frame block, so that the intra-frame image cannot have a tool for processing the edge information as the inter-frame image, and the coding and decoding efficiency of the video sequence is reduced.
Based on this, the embodiments of the present application provide an intra prediction method, and the basic idea of the method is: determining a prediction mode parameter of a current block; determining first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block when the prediction mode parameter indicates that the INBC mode is used; determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information; determining a first weight value of the first partition and a second weight value of the second partition; and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block. Therefore, the boundary information in the image block is processed by using different angle weighting in the intra-frame prediction, and the edge information of two parts of different texture/color distribution in the same partition block, sharp object edges in the intra-frame image, the boundary between the foreground and the background, the boundary information of a common sequence and the like can be better processed, so that the intra-frame image and the inter-frame image have a tool for processing the edge information, and the coding and decoding efficiency of a video sequence is effectively improved.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 7A, a block diagram illustrating an example of a video coding system according to an embodiment of the present application is shown. As shown in fig. 7A, the video Coding system 10 includes a transform and quantization unit 101, an intra estimation unit 102, an intra prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, a Coding unit 109, a decoded image buffer unit 110, and the like, wherein the filtering unit 108 may implement deblocking filtering and Sample Adaptive 0 offset (SAO) filtering, and the Coding unit 109 may implement header information Coding and Context-based Adaptive Binary arithmetic Coding (CABAC). For an input original video signal, a video Coding block can be obtained by dividing a Coding Tree Unit (CTU), and then residual pixel information obtained by intra-frame or inter-frame prediction is transformed by a transformation and quantization Unit 101, including transforming the residual information from a pixel domain to a transformation domain and quantizing the obtained transformation coefficient, so as to further reduce the bit rate; the intra estimation unit 102 and the intra prediction unit 103 are used for intra prediction of the video coding block; in particular, intra estimation unit 102 and intra prediction unit 103 are used to determine the intra prediction mode to be used to encode the video coding block; motion compensation unit 104 and motion estimation unit 105 are to perform inter-prediction encoding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector that can estimate the motion of the video coding block, and then motion compensation is performed by the motion compensation unit 104 based on the motion vector determined by the motion estimation unit 105; after determining the intra prediction mode, the intra prediction unit 103 is also configured to supply the selected intra prediction data to the encoding unit 109, and the motion estimation unit 105 sends the calculated determined motion vector data to the encoding unit 109 as well; furthermore, the inverse transform and inverse quantization unit 106 is used for reconstruction of the video coding block, reconstructing a residual block in the pixel domain, the reconstructed residual block removing blocking artifacts through the filter control analysis unit 107 and the filtering unit 108, and then adding the reconstructed residual block to a predictive block in the frame of the decoded picture buffer unit 110 to generate a reconstructed video coding block; the encoding unit 109 is configured to encode various encoding parameters and quantized transform coefficients, and in a CABAC-based encoding algorithm, context content may be based on adjacent encoding blocks, and may be configured to encode information indicating the determined intra prediction mode and output a code stream of the video signal; the decoded picture buffer unit 110 is used to store reconstructed video coding blocks for prediction reference. As the video coding proceeds, new reconstructed video coding blocks are continuously generated, and these reconstructed video coding blocks are stored in the decoded picture buffer unit 110.
Referring to fig. 7B, a block diagram illustrating an example of a video decoding system according to an embodiment of the present application is shown. As shown in fig. 7B, the video decoding system 20 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205, a decoded image buffer unit 206, and the like, wherein the decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is subjected to the encoding processing of fig. 7A, a code stream of the video signal is output; the code stream is input into the video decoding system 20, and first passes through the decoding unit 201 to obtain a decoded transform coefficient; processes the transform coefficients by an inverse transform and inverse quantization unit 202 to produce a residual block in the pixel domain; intra-prediction unit 203 may be used to generate prediction data for a current video decoded block based on the determined intra-prediction mode and data from previously decoded blocks of the current frame or picture; motion compensation unit 204 is a predictive block that determines prediction information for a video decoded block by parsing motion vectors and other associated syntax elements and uses the prediction information to generate the video decoded block being decoded; forming a decoded video block by summing the residual block from inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by intra prediction unit 203 or motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove blocking artifacts, which may improve video quality; the decoded video blocks are then stored in the decoded picture buffer unit 206, and the decoded picture buffer unit 206 stores the reference pictures for subsequent intra prediction or motion compensation, and also for the output of the video signal, i.e. the restored original video signal is obtained.
It should be noted that the intra prediction method in the embodiment of the present application is mainly applied to the portion of the intra prediction unit 103 shown in fig. 7A and the portion of the intra prediction unit 203 shown in fig. 7B. That is to say, the intra prediction method in the embodiment of the present application may be applied to a video coding system, a video decoding system, or even applied to both the video coding system and the video decoding system, but the embodiment of the present application is not particularly limited. It should be noted that, when the intra prediction method is applied to the intra prediction unit 103 shown in fig. 7A, the "current block" specifically refers to the current coding block in intra prediction; when the intra prediction method is applied to the portion of the intra prediction unit 203 shown in fig. 7B, the "current block" specifically refers to a currently decoded block in intra prediction.
Before the detailed description is given, it should be noted that "first", "second", "third", etc. are mentioned throughout the specification only for distinguishing different features, and do not have functions of defining priority, precedence, magnitude relation, etc.
In an embodiment of the present application, the intra prediction method provided by the embodiment of the present application is applied to a video encoding apparatus, i.e., an encoder. The functions implemented by the method may be implemented by the first processor in the encoder calling the computer program, although the computer program may be stored in the first memory, and it is seen that the encoder comprises at least the first processor and the first memory.
Based on the above application scenario example of fig. 7A, refer to fig. 8, which shows a flowchart of an intra prediction method provided in an embodiment of the present application. As shown in fig. 8, the method may include:
s801: a prediction mode parameter of the current block is determined.
It should be noted that a video image may be divided into a plurality of image blocks, and each image Block to be currently encoded may be referred to as a Coding Block (CB). Here, each encoding block may include a first image component, a second image component, and a third image component; and the current block is an encoding block of the video image which is currently subjected to prediction of a first image component, a second image component or a third image component.
Wherein, assuming 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; alternatively, assuming that the current block performs the second image component prediction, and the second image component is a chroma component, that is, the image component to be predicted is a chroma component, the current block may also be referred to as a chroma block.
It should be noted that the prediction mode parameter is used to indicate the prediction mode used by the current block and the parameter related to the prediction mode. In general, the determination of the prediction mode parameters may be performed according to the magnitude of the distortion value. In a specific embodiment, the determination may be performed according to a cost result of Rate Distortion Optimization (RDO), or may be performed according to a cost result of Sum of Absolute Differences (SAD), or may be performed according to a cost result of Sum of Absolute Transformed Differences (SATD); however, the examples of the present application are not limited in any way.
In some embodiments, the determining the prediction mode parameter of the current block may include:
pre-coding the current block based on a plurality of candidate prediction modes, and determining pre-coding results corresponding to the candidate prediction modes;
and determining the prediction mode parameters of the current block from the plurality of candidate prediction modes according to the pre-coding result.
In a specific embodiment, the determining the prediction mode parameter of the current block from the plurality of candidate prediction modes according to the pre-coding result may include:
obtaining rate distortion cost results corresponding to the multiple candidate prediction modes based on the pre-coding result;
and selecting an optimal rate distortion cost result from the rate distortion cost results, and determining a candidate prediction mode corresponding to the optimal rate distortion cost result as the prediction mode parameter of the current block.
It should be noted that the multiple candidate prediction modes herein may refer to intra-frame prediction modes, and the precoding results corresponding to the multiple candidate prediction modes may be determined by precoding the current block according to the multiple candidate prediction modes. The pre-coding result may be a distortion value corresponding to the candidate prediction mode (or called as an encoding mode), or may also be a rate-distortion cost result corresponding to the candidate prediction mode, or may even be other cost results corresponding to the candidate prediction mode, such as an SAD cost result, an SATD cost result, and the like. Illustratively, after rate distortion cost results corresponding to the multiple candidate prediction modes are obtained according to the pre-coding result, an optimal rate distortion cost result may be selected from the rate distortion cost results, and the candidate prediction mode corresponding to the optimal rate distortion cost result is determined as the prediction mode parameter of the current block.
It should be noted that the present embodiment proposes a Non-rectangular Block Copy (INBC) mode, which combines an Intra Block Copy (IBC) technique with an Angle Weighted Prediction (AWP) technique. The IBC technology can be used for predicting repeated/cyclic local image characteristics and is applied to screen content coding; the AWP technique is applied to process boundary information in inter images. Therefore, the purpose of the INBC mode proposed in the embodiment of the present application is to expect that the INBC can better process edge information of two different texture/color distributions in the same partition block, a sharp object edge in an intra-frame image, a boundary between a foreground and a background, boundary information, and the like, so that the intra-frame image also has a tool for processing the edge information like an inter-frame image, thereby effectively improving the coding and decoding efficiency of a video sequence.
That is, the plurality of candidate prediction modes herein may include the INBC mode and the normal intra mode. The normal Intra mode may include an angle Prediction mode, a Position Dependent Intra Prediction Combination (PDPC) mode, a Matrix Dependent Intra Prediction (MIP) mode, and the like. Thus, the plurality of candidate prediction modes may include an INBC mode and a normal intra mode, at which time the INBC mode will compete with the normal intra mode in mode to determine the prediction mode parameters of the current block.
In some embodiments, the determining the prediction mode parameter of the current block may include:
setting an INBC mode flag bit to a first value if the prediction mode parameter indicates that an INBC mode is used;
setting the INBC mode flag bit to a second value if the prediction mode parameter indicates that a normal intra-mode is used.
It should be noted that, when the INBC mode flag bit is set to the first value, it is determined that the current block uses the INBC mode for intra prediction; when the INBC mode flag bit is set to a second value, it is determined that the current block is intra predicted using a normal intra mode.
It should be further noted that, in a specific implementation manner, the first value may be 1, and the second value may be 0; alternatively, the first value may be true and the second value may be false. In another specific implementation manner, the first value may be 0, and the second value may be 1; alternatively, the first value may be false and the second value may be true.
Thus, taking the first value as 1 and the second value as 0 as an example, in the encoder, if the prediction mode parameter indicates that the INBC mode is used, the INBC mode flag bit may be set to 1, and the INBC mode is used to determine the intra prediction value of the current block at this time; if the prediction mode parameter indicates that the INBC mode is not used, the INBC mode flag bit may be set to 0, at which time the intra prediction value of the current block is determined using the normal intra mode.
Further, in some embodiments, after determining the INBC mode flag bit, the method may further include:
and writing the INBC mode flag bit into a code stream.
That is, the encoder may also write the INBC mode flag bit into the code stream. Thus, on the decoder side, the prediction mode parameter of the current block, i.e. the prediction mode used by the current block, can be determined by parsing the code stream.
It can be understood that, for the INBC mode provided by the embodiment of the present application, it belongs to one of a plurality of candidate angle partition modes. In some embodiments, the method may further comprise:
determining three target candidate angle division modes from a plurality of candidate angle division modes;
performing intra-frame prediction on the current block by using the three target candidate angle division modes, and determining prediction cost results corresponding to the three target candidate angle division modes;
determining an INBC mode used by the current block from the three target candidate angular division modes based on the prediction cost result.
Generally speaking, there are 56 modes of the candidate angle-division modes, and the VVC extends to 65 modes currently. Among the plurality of candidate angle division modes, three target candidate angle division modes may be determined. And taking the three target candidate angle division modes as alternatives, performing intra-frame prediction on the current block by using the three target candidate angle division modes, and determining prediction cost results corresponding to the three target candidate angle division modes so as to determine the INBC mode used by the current block from the three target candidate angle division modes.
In a specific embodiment, the determining, from the three target candidate angular division modes, the INBC mode used by the current block based on the prediction cost result may include:
based on the prediction cost result, obtaining rate distortion cost results corresponding to the three target candidate angle division modes;
and selecting an optimal rate distortion cost result from the rate distortion cost results, and determining a target candidate angle partition mode corresponding to the optimal rate distortion cost result as the INBC mode used by the current block.
It should be noted that the predetermined rate distortion model can be regarded as a relation function between the distortion value, the code rate, and the lagrangian multiplier. Assuming that the distortion value is represented by D, the code rate is represented by R, and the lagrange multiplier is represented by λ, the predetermined rate distortion model can be represented by equation (8),
J=D+λ·R (8)
where J represents the rate-distortion cost result. Here, the calculation process is the same for the calculation of the rate-distortion cost result regardless of the prediction mode. The embodiment of the present application takes the first rate-distortion cost result of the current block in one of the target candidate angle partition modes as an example. Specifically, intra-frame prediction is carried out on the current block by utilizing the target candidate angle division mode to obtain a first prediction value of the current block; then, according to the first predicted value of the current block and the real value of the current block, a first distortion value (represented by D1) of the current block can be obtained by utilizing Mean Square Error (MSE) calculation; assuming that the code rate R is 1, a first rate-distortion cost result (denoted by RDC 1) in the target candidate angle partition mode can be calculated by using a preset rate-distortion model shown in equation (8), and is denoted as RDC1 ═ D1+ λ. Similarly, a second rate-distortion cost result (represented by RDC 2) and a third rate-distortion cost result (represented by RDC 3) in two other target angle partition candidate modes can be calculated, and the optimal rate-distortion cost result is selected from RDC1, RDC2 and RDC3, so that the target angle partition candidate mode corresponding to the optimal rate-distortion cost result is determined as the INBC mode used by the current block.
Further, for the determination of three target candidate angle partition modes, in some embodiments, the determining three target candidate angle partition modes from among the plurality of candidate angle partition modes may include:
pre-coding the current block based on the multiple candidate angle division modes, and determining pre-coding results corresponding to the multiple candidate angle division modes;
determining the three target candidate angle partition modes from the plurality of candidate angle partition modes based on the pre-coding result.
In a specific embodiment, the determining the three target candidate angle partition modes from the plurality of candidate angle partition modes based on the precoding result may include:
obtaining SATD cost results corresponding to the multiple candidate angle division modes based on the pre-coding result;
and selecting three relatively excellent SATD cost results from the SATD cost results, and determining the candidate angle division modes corresponding to the three SATD cost results as the three target candidate angle division modes.
It should be noted that, for these multiple candidate angle partition modes, three target candidate angle partition modes may be selected according to the Sum of Absolute Transformed Differences (SATD) cost result to perform the rate-distortion cost calculation.
That is to say, after the current block is precoded by using multiple candidate angle division modes and the precoding results corresponding to the multiple candidate angle division modes are determined, the SATD cost results corresponding to the multiple candidate angle division modes can be obtained according to the precoding results; and then selecting three relatively superior SATD cost results from the SATD cost results, and determining the candidate angle division modes corresponding to the three selected SATD cost results as the three target candidate angle division modes.
Specifically, in some embodiments, the pre-coding the current block based on the plurality of candidate angle partition modes, and determining pre-coding results corresponding to the plurality of candidate angle partition modes may include:
determining a first partition and a second partition of the current block in each candidate angular division mode based on a plurality of candidate angular division modes;
determining first target block vector information of the first partition and second target block vector information of the second partition in each candidate angle partition mode;
and precoding the current block according to the first target block vector information of the first partition and the second target block vector information of the second partition in each candidate angle partition mode to obtain precoding results corresponding to the multiple candidate angle partition modes.
It should be noted that, when the current block is divided based on each candidate angle division mode, the first partition and the second partition of the current block in the candidate angle division mode may be determined. Then, after determining the first target block vector information of the first partition and the second target block vector information of the second partition in the candidate angle partition mode, precoding the current block according to the first target block vector information of the first partition and the second target block vector information of the second partition in each candidate angle partition mode, so as to obtain precoding results corresponding to multiple candidate angle partition modes.
It should be further noted that, for the determination of the first target block vector information of the first partition and the second target block vector information of the second partition in the candidate angle partition mode, in some embodiments, when the prediction mode parameter indicates that the INBC mode is used, the method may further include:
constructing a block vector candidate list, the block vector candidate list comprising at least one block vector;
for the candidate angle division mode, traversing at least one block vector in the block vector candidate list, and calculating SAD cost results corresponding to the first partition and the second partition with respect to the at least one block vector;
selecting an optimal SAD cost result from the first SAD cost results, and determining a block vector corresponding to the optimal SAD cost result as first target block vector information of the first partition; and selecting an optimal SAD cost result from the second SAD cost results, and determining a block vector corresponding to the optimal SAD cost result as second target block vector information of the second partition.
Thus, based on multiple candidate angle partition modes (for example, 56 candidate angle partition modes), after determining the optimal block vector of the first partition (i.e., the first target block vector information) and the optimal block vector of the second partition (i.e., the second target block vector information) in each candidate angle partition mode according to the SAD cost, pre-coding the current block to determine pre-coding results corresponding to the multiple candidate angle partition modes; then, SATD cost results corresponding to the multiple candidate angle division modes can be obtained according to the pre-coding result, three relatively excellent SATD cost results are selected from the SATD cost results, and the candidate angle division modes corresponding to the three selected SATD cost results are determined as the three target candidate angle division modes. Further, after intra-frame prediction is performed on the current block by using the three target candidate angle partition modes, rate distortion cost results corresponding to the three target candidate angle partition modes can be obtained; and then selecting the optimal rate distortion cost result from the obtained rate distortion cost results, and determining a target candidate angle partition mode corresponding to the optimal rate distortion cost result as the INBC mode used by the current block.
Therefore, after the prediction mode parameters of the current block are determined, the determined prediction mode can be finally used for coding the current block, so that the prediction residual is smaller, and the coding efficiency can be improved.
S802: when the prediction mode parameter indicates that the INBC mode is used, first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block are determined.
It should be noted that, when the prediction mode parameter indicates that the INBC mode is used, at this time, the current block is divided based on the INBC mode, and at least two partitions may be obtained. Wherein the at least two partitions may be a first partition and a second partition.
It should be noted that, when the Prediction mode parameter indicates that the INBC mode is used, a Block Vector Prediction (BVP) list needs to be constructed at this time so as to determine the first target Block Vector information of the first partition and the second target Block Vector information of the second partition. In some embodiments, the method may further comprise:
a block vector candidate list is constructed, the block vector candidate list comprising at least one block vector.
Here, for the block vector candidate list, in a specific embodiment, the constructing the block vector candidate list may include:
obtaining historical block vector prediction information;
determining the block vector candidate list based on the historical block vector prediction information.
That is, the Block Vector candidate list may be determined based on historical Block Vector Prediction information (HBVP). The HBVP technique specifically copies 8 motion information candidates from previous coded blocks into a First-in-First-out (FIFO) queue, and the FIFO is kept continuously updated in a First-in-First-out manner. If the motion information candidate in the FIFO is the same as the motion information just encoded, this duplicate motion information candidate is first removed and then the motion information of the current coding unit is added at the end of the FIFO. If the motion information of the current coding unit is different from the motion information of any candidate in the FIFO, the first candidate in the FIFO is removed, and the latest motion information is added to the end of the FIFO, so as to ensure that 8 latest motion information candidates are always reserved in the FIFO. The motion information candidates in the HBVP are identified together with motion information candidates existing in a second generation AVS Standard (may be abbreviated as AVS2) proposed by the digital Audio Video coding Standard Workgroup of China, and binarized in an Unary manner. Five motion information candidates are included in AVS2, but the symmetry pattern is removed in the third generation AVS standard (which may be abbreviated as AVS3), and only 4 motion information candidates remain, plus 8 candidates in HBVP are a maximum of 12 motion information candidates. In short, the HBVP stores the block vectors of the encoded IBC blocks in a historical block vector information buffer with a maximum storage capacity of 12, so that history-based block vector prediction information can be obtained.
In a more specific embodiment, the determining the block vector candidate list based on the historical block vector prediction information may include:
if the size parameter of the coded block is larger than or equal to the preset size parameter, storing the block vector of the coded block in the zero position of the block vector candidate list; and
if the occurrence frequency of the coded block in the historical block vector prediction information is greater than or equal to a preset frequency, storing the block vector of the coded block in the first position of the block vector candidate list; and
storing block vectors of a left encoded neighboring block, an upper left encoded neighboring block, an upper right encoded neighboring block, and a lower left encoded neighboring block of a current block in a second bit, a third bit, a fourth bit, a fifth bit, and a sixth bit of the block vector candidate list, respectively;
and obtaining the block vector candidate list based on the block vectors stored in the zero bit, the first bit, the second bit, the third bit, the fourth bit, the fifth bit and the sixth bit in the block vector candidate list.
Note that, at most 7 block vectors are stored in the block vector candidate list (BVP); here, the ith block vector candidate list may be represented by cbvp _ cands [ i ], where i is 0,1,2, …, 6.
That is, BV may be allocated from the acquired historical block vector prediction information as one of the candidate BVPs (cbvp _ cands [ i ], where 7 BVs are stored at maximum). Specifically, as follows, the following description will be given,
BV buffer with size parameter W × H ≧ 64 of coded block to cbvp _ cands [0 ];
BV buffer memory of coded block appearing times more than 2 times in historical block vector prediction information to cbvp _ cands [1 ];
the encoded blocks are cached to cbvp _ cands [2], cbvp _ cands [3], cbvp _ cands [4], cbvp _ cands [5], cbvp _ cands [6] respectively in BV of the adjacent blocks of the current block, left, top right and bottom left;
up to this point, the block vector candidate list (cbvp _ cands) filling is completed.
In this way, after obtaining the block vector candidate list, first target block vector information of the first partition of the current block and second target block vector information of the second partition of the current block may be determined according to the block vector candidate list. In the embodiment of the present application, if Adaptive Block Vector Resolution (ABVR) is turned on, a BV of full-pel precision or quadruple-pel precision is tried; otherwise, only BV of integer pixel precision is used. First, BV with integer pixel precision is taken as an example and explained in detail.
In a specific embodiment, the determining first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block may include:
determining the first partition and the second partition after the current block is divided based on the INBC mode;
traversing at least one block vector in the block vector candidate list, and calculating a first SAD cost result corresponding to the first partition with respect to the at least one block vector and a second SAD cost result corresponding to the second partition with respect to the at least one block vector;
selecting an optimal SAD cost result from the first SAD cost results, and determining a block vector corresponding to the optimal SAD cost result as first target block vector information of the first partition; and selecting an optimal SAD cost result from the second SAD cost results, and determining a block vector corresponding to the optimal SAD cost result as second target block vector information of the second partition.
It should be noted that, when the current block uses the INBC mode, the optimal block vector (i.e., the first target block vector information and the second target block vector information) can be extracted for the first partition and the second partition of the current block by comparing the Sum of Absolute Difference (SAD) cost results at this time.
In another specific embodiment, the determining the first target block vector information of the first partition of the current block and the second target block vector information of the second partition of the current block may include:
determining the first partition and the second partition after the current block is divided based on the INBC mode;
establishing a preset hash table, performing intra block copy search on the first partition and the second partition, and selecting first block vector information matched with the hash key value of the first partition and second block vector information matched with the hash key value of the second partition from the block vector candidate list;
traversing at least one block vector in the block vector candidate list, and calculating a first price result corresponding to the first partition with respect to the at least one block vector and a second price result corresponding to the second partition with respect to the at least one block vector;
selecting an optimal cost result from the first cost result, and determining a block vector corresponding to the optimal cost result as first two-block vector information of the first partition; selecting an optimal cost result from the second cost results, and determining a block vector corresponding to the optimal cost result as second block vector information of the second partition;
determining the block vector information with the optimal cost result as first target block vector information of the first partition from the first one-block vector information and the first two-block vector information; and
and determining the block vector information with the optimal cost result as second target block vector information of the second partition from the second block vector information and the second block vector information.
It should be noted that, first, two preset Hash (Hash) tables, i.e., m _ Hash2Pos and m _ Pos2Hash, are established, and then the hit prediction reference block and BV are searched. Here, the setting of the preset search range may include:
determining a proportion value of the same Hash value which appears at a position exceeding twice;
judging whether the determined proportional value is larger than a preset proportional value or not;
if the judgment result is yes, setting the preset search range to be 64 multiplied by 64;
if the judgment result is negative, the preset search range is set to be 32 multiplied by 32.
In the embodiment of the present application, the preset ratio may be set to 5%, but is not particularly limited. Thus, the size range of the IBC search can be set according to whether the proportion value of the position where the same Hash value appears is more than two times is more than 5%, and if the judgment result is yes, the size range is set to be 64 multiplied by 64; otherwise it is set to 32 x 32. After searching the hit prediction reference block and BV, a Hash-searched BV (including first block vector information of the first partition and second block vector information of the second partition) may be obtained. Then trying all BVs in the block vector candidate list, and selecting first two-block vector information of the first partition and second two-block vector information of the second partition according to the optimal cost result by calculating the cost result; and comparing the BV with the BV searched by the Hash, and selecting a more optimal BV according to the cost result to obtain the final first target block vector information of the first partition and the final second target block vector information of the second partition. Here, for the block vector candidate list, if a plurality of block vector candidate lists are constructed, the block vector candidate list corresponding to the optimal cost result may be determined as the block vector candidate list described in the embodiment of the present application by calculating the cost result, and the index number corresponding to the block vector candidate list is stored in bvp _ idx.
It should be noted that if the obtained first target block vector information (which can be represented by BV [0 ]) and the obtained second target block vector information (which can be represented by BV [1 ]) both belong to legal block vector information, i.e. BV [0] ≠ 0& & BV [1] ≠ 0, then motion estimation is finished; if at least one of the obtained first target block vector information and the obtained second target block vector information belongs to legal block vector information, that is, BV [0] ═ 0| | BV [1] ═ 0, the first target block vector information and the second target block vector information need to be determined again. In another specific embodiment, the determining the first target block vector information of the first partition of the current block and the second target block vector information of the second partition of the current block may include:
if at least one of the first target block vector information and the second target block vector information belongs to non-legal block vector information, determining a preset search range; in the block vector candidate list, respectively carrying out pixel-by-pixel block vector search on the first partition and the second partition according to the preset search range in sequence to obtain first block vector information and second block vector information;
determining the obtained first block vector information and second block vector information as the first target block vector information and the second target block vector information.
It should be noted that a search starting point BV with SAD < 1000 is selected from the block vector candidate list (cbvp _ cands), otherwise, the starting point BV may be set to (0, 0). The best BVP (bvpasbv _ idx) is recorded, and then the BV full search process is performed, as follows,
a preset search range is first set. Then, according to the above-obtained bvpasbv _ idx, SAD is calculated according to the corresponding BV and is placed in SAD _ best _ cand and mv _ cand. Then according to the set preset search range, BV search updating is carried out on the right upper side (bvx is 0, bvy pixel-by-pixel conversion) and the right left side (bvy is 0, bvx pixel-by-pixel conversion) in sequence; note that bvx ═ 0, and bvy ═ 0, refers to BV relative to the search starting point. And for the coding blocks with W < 16& & H < 16, one round of search is performed, so that the prediction precision is improved. At this time, other BVs, except for right above and right left, are tried at integer pixel or twice pixel intervals within the preset search range to pick the optimal BV (i.e., the first target block vector information and the second target block vector information).
It should be further noted that, after obtaining a legal block vector according to a hash search or a full search, the flag bit skip _ me may be set to 1, and then a cost result is calculated and the currently obtained optimal BV (i.e., the first target block vector information and the second target block vector information) is stored.
In addition, in the embodiment of the present application, for BV with quadruple pixel precision, firstly, BV prediction is performed to determine a block vector candidate list; then, because the flag skip _ me is 1, the original motion estimation process can be skipped, the BV obtained by the integer pixel precision is still used as the optimal BV, and then the BV is adjusted to be an integral multiple of four according to the quadruple precision requirement; finally, a cost result (e.g., a rate distortion cost result) may be computed to update the optimal BV (i.e., the first target block vector information and the second target block vector information) based on the cost result.
In some embodiments, after determining the first target block vector information and the second target block vector information, the method may further comprise:
determining a first block vector index sequence number, where the first block vector index sequence number is used to indicate an index sequence number corresponding to the first target block vector information in the block vector candidate list;
determining a second block vector index sequence number, where the second block vector index sequence number is used to indicate a corresponding index sequence number of the second target block vector information in the block vector candidate list;
and writing the first block vector index sequence number and the second block vector index sequence number into a code stream.
That is, after the first target block vector information and the second target block vector information are obtained, the first block vector index sequence number and the second block vector index sequence number may be determined, and the first block vector index sequence number and the second block vector index sequence number may be written into the code stream. In this way, the decoder side obtains the first block vector index sequence number and the second block vector index sequence number by analyzing the code stream, and the first target block vector information and the second target block vector information can be determined by combining the constructed block vector candidate list.
S803: determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information.
It should be noted that the determining the first prediction value of the first partition according to the first target block vector information may include: and performing motion compensation on the first partition according to the first target block vector information to obtain a predicted value of the first partition.
It should be further noted that the determining a second prediction value of the second partition according to the second target block vector information may include: and performing motion compensation on the second partition according to the second target block vector information to obtain a predicted value of the second partition.
That is, after obtaining the first target block vector information, motion compensation may be performed on the first partition according to the first target block vector information, so as to obtain a prediction value (or referred to as a motion compensation prediction value) of the first partition; after the second target block vector information is obtained, motion compensation may be performed on the second partition according to the second target block vector information, so that a prediction value (or referred to as a motion compensation prediction value) of the second partition may be obtained.
S804: determining a first weight value of the first partition and a second weight value of the second partition.
It should be noted that the first weight value of the first partition and the second weight value of the second partition are mainly related to the angle division pattern index number (denoted by awppidx). In some embodiments, the determining the first weight value of the first partition and the second weight value of the second partition may include:
determining an angle partition mode index sequence number based on the INBC mode;
obtaining a mapping angle value by utilizing a first calculation model according to the angle division mode index sequence number;
obtaining a slope classification index value by utilizing a second calculation model according to the mapping angle value;
obtaining a partition value of the angle by using a third calculation model according to the mapping angle value;
and obtaining a first weight value of the first partition and a second weight value of the second partition by utilizing a preset weight calculation model based on the slope classification index value and the partition value to which the angle belongs.
It should be noted that after the determination of awpid, a mapping angle value (expressed by ModAngNum) can be obtained; according to ModAngNum, a slope classification index value (represented by angleIdx) and a partition value (represented by subAngleIdx) to which the angle belongs can be further determined. In addition, the first weight value and the second weight value may include a luminance weight (represented by AwpWeightArrayY [ x ] [ y ]) and a chrominance weight (represented by AwpWeightArrayUV [ x ] [ y ]).
In the examples of the present application, after determining AwpIdx, intermediate values (using stepIdx), angleIdx and subAngleIdx can be obtained. A specific calculation model is as follows,
stepIdx=(AwpIdx>>3)-3 (9)
modAngNum=AwpIdx%8 (10)
here, ">" represents a right shift operator, and "%" represents a remainder operator. In addition, the value of stepIdx can be-3, -2, -1, 0,1,2 and 3; modAngNum can take on a value of 0-7.
Further, if modAngNum is equal to 2, angleIdx is 7; if modAngNum is equal to 6, angleIdx is 8; otherwise, angleIdx ═ modAngNum% 2. The specific formula is shown in the following formula,
Figure PCTCN2020129266-APPB-000001
wherein, the value comparison table between AwpIdx and stepIdx and modAngNum is shown in Table 1.
TABLE 1
AwpIdx AwpIdx>>3 stepIdx=(AwpIdx>>3)-3 ModAngNum
0~7 0 -3 Corresponds to 0 to 7
8~15 1 -2 Corresponds to 0 to 7
16~23 2 -1 Corresponds to 0 to 7
24~31 3 0 Corresponds to 0 to 7
32~39 4 1 Corresponds to 0 to 7
40~47 5 2 Corresponds to 0 to 7
48~55 6 3 Corresponds to 0 to 7
In addition, after obtaining ModAngNum, for subAngleIdx, the calculation model is as follows,
subAngleIdx=modAngNum>>1 (12)
here, the subAngleIdx may take values of 0,1,2, and 3.
That is, stepIdx and modAngNum can be obtained from AwpIdx, and the value of modAngNum determines angleIdx and subAngleIdx.
With reference to fig. 3A and 3B, the value comparison table between modAngNum, awpid and subangleldx is shown in table 2.
TABLE 2
ModAngNum angleIdx subAngleIdx
0 0 0
1 1 0
2 7 1
3 1 1
4 0 2
5 1 2
6 8 3
7 1 3
Thus, an accurate mapping angle value (ModAngNum) can be obtained according to the partition value (subingleidx) to which the angle belongs and the slope classification index value (angleIdx).
Further, a reference weight list is configured according to the related parameters, and the reference weight list can be represented by ReferenceWeight [ x ]. Here, the width of the current block is denoted by M and the height is denoted by N.
ValidLength_W=(M+(N>>angleIdx))<<1
ValidLength_H=(N+(M>>angleIdx))<<1
DeltaPos_W=stepIdx*((ValidLength_W>>3)-1)
DeltaPos_H=stepIdx*((ValidLength_H>>3)-1)
FirstPos=(ValidLength_H>>1)-6+DeltaPos_H
ReferenceWeights[x]=Clip3(0,8,x-FirstPos);
Wherein, ">" "represents a right shift operator," < < "> represents a left shift operator,", Clip3 represents an embedding operator, Clip3(0,8, x-FirstPos) represents that (x-FirstPos) embedding is between 0 and 8, and the value range of x is 0 to ValidLength _ H-1.
In the following, assuming that the angular division mode index number is 24, modAngNum is 0, angleIdx is 0, stepIdx is 0, and subAngleIdx is 0, taking 8 × 8, angleIdx is 0, and stepIdx is 0 as an example, the following calculation is performed:
ValidLength_W=(8+8)<<1=16*2=32
ValidLength_H=(8+8)<<1=16*2=32
DeltaPos_W=0
DeltaPos_H=0
FirstPos=16-6+0=10
ReferenceWeights [ x ] ═ Clip3(0,8, x-10); wherein, for the 8 x 8 current block, the value range of x is 0-31.
Thus, the luminance weight of the (x, y) pixel location in the current block is represented by AwpWeightArrayY [ x ] [ y ], and the calculation formula of AwpWeightArrayY [ x ] [ y ] is as follows,
AwpWeightArrayY[x][y]=ReferenceWeights[(y<<1)+((x<<1)>>angleIdx)] (13)
wherein, the value range of x is 0-M-1; the value range of y is 0 to N-1.
Taking subAngleIdx ═ 0 and angleIdx ═ 0 as an example, then wpweightarrayy [ x ] [ y ] ═ ReferenceWeights [ (2y) + (2x) ].
The chroma weight of the (x, y) pixel location in the current block is represented by AwpWeightArrayUV [ x ] [ y ], and the formula for calculation of AwpWeightArrayUV [ x ] [ y ] is as follows,
AwpWeightArrayUV[x][y]=AwpWeightArrayY[x<<1][y<<1] (14)
wherein, the value range of x is 0-M/2-1; the value range of y is 0-N/2-1.
Thus, according to the luminance weight (AwpweightArrayY [ x ] [ y ]) and the corresponding chrominance weight AwpweightArrayUV [ x ] [ y ]) of each pixel position in the current block, the first weighting value of the first partition and the second weighting value of the second partition can be determined.
In addition, it should be further noted that, after determining the angle partition mode index number, the method may further include: and writing the index sequence number of the angle division mode into a code stream.
That is, after obtaining the angle partition mode index number, the angle partition mode index number may be written into the codestream. Therefore, the index sequence number of the angle division mode can be acquired by analyzing the code stream at the decoder side, so that a first weight value of the first partition and a second weight value of the second partition can be determined.
S805: and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block.
It should be noted that after the first prediction value, the first weight value, the second prediction value, and the second weight value are obtained, the first prediction value, the first weight value, the second prediction value, and the second weight value may be weighted and fused, so as to determine the intra-frame prediction value of the current block in the INBC mode.
The embodiment provides an intra prediction method applied to an encoder. Determining a prediction mode parameter of a current block; determining first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block when the prediction mode parameter indicates that the INBC mode is used; determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information; determining a first weight value of the first partition and a second weight value of the second partition; and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block. Therefore, the boundary information in the image block is processed by using different angle weighting in intra-frame prediction, and the edge information of two parts of different texture/color distribution in the same partition block, sharp object edges in an intra-frame image, the boundary between a foreground and a background, the boundary information of a common sequence and the like can be better processed, so that the intra-frame image and the inter-frame image have a tool for processing the edge information, and the coding efficiency of a video sequence is effectively improved.
In another embodiment of the present application, the present application provides an INBC intra prediction technique that combines IBC techniques with AWP techniques. The IBC technology can be used for predicting repeated/cyclic local image characteristics and is applied to screen content coding; the AWP technique is applied to process boundary information in inter images. Thus, the purpose of the research of the INBC is to expect that the INBC can better process edge information of two different texture/color distributions in the same partition block, a sharp object edge in an intra-frame image, a boundary between a foreground and a background, boundary information and the like, so that the intra-frame image has a tool for processing the edge information as the inter-frame image, and thus the coding efficiency of a video sequence is effectively improved.
Thus, in the encoder, the INBC mode is implemented as follows:
the mode, motion information, and flag of the CU are identified in units of a 4 × 4 current block. Here, the Prediction mode is encoded, and in a specific implementation, when a String Prediction (SP) mode is turned on, it is required to encode whether the mode is an INBC mode, encode whether the mode is an SP mode, and encode whether the mode is an IBC mode.
The intra prediction steps of the encoder are as follows:
(1) the block vector candidate list (i.e., BVP list) is derived.
(2) 56 partition modes are traversed, the BVP list is traversed for each mode, and the optimal BV is selected for the two partitions of each mode by comparing SAD.
(3) Of the 56 partition modes, 3 modes are selected by comparing the SATDs to enter the process of rate-distortion optimization.
(4) And (3) respectively performing motion compensation on the two partitions according to the optimal BV combination determined in the step (1) to determine respective target block vector information of the two partitions.
(5) And respectively determining the motion compensation predicted values of the two partitions according to the target block vector information of the two partitions.
(6) For these 3 modes, weighting weights are calculated from different mode information.
(7) For the 3 modes, the final intra prediction value of the current block is obtained through weighted fusion.
(8) For the 3 modes, the optimal INBC mode in the 3 modes is decided through a rate distortion optimization process.
(9) The optimal INBC mode competes with other modes (e.g., normal intra mode).
(10) Relevant information (flag, BV index number, etc.) of the optimal mode is encoded.
It should be noted that, in the encoder, the rate-distortion optimization process is as follows: firstly, respectively determining optimal BV candidates for two partitions of each partition in 56 partition modes of an AWP (active wavelet packet) along with a historical BV candidate list of IBC (IBC); and then selecting three optimal division modes from the 56 division modes, respectively performing motion compensation on the three division modes according to the BV of the two partitions decided in the previous step to obtain predicted values, performing weighted fusion on the predicted values of the two partitions to realize a rate-distortion optimization process, selecting an optimal INBC mode, and then competing with other modes (such as a common intra-frame mode).
It should be noted that, in the encoder, the Flag bit (Flag) needs to be set: namely, flag is set at the Sequence (Sequence) level, frame level, and CU level to control the use of INBC. Here, the CU size restriction range to which the INBC mode is applied is: 4 × 4 to 16 × 16.
For the derivation of BVP list in step (1), in the embodiment of the present application, if ABVR is turned on, integer-pixel-precision or quadruple-pixel-precision Block Vector (BV) is tried, otherwise, only integer-pixel-precision BV is used. The specific process is as follows:
(a) first try full pixel precision BV.
(1.1) BV prediction Using HBVP technique
(1.1.1) the HBVP technique copies 8 motion information candidates from previous coding blocks into a FIFO, which is kept constantly updated in a first-in-first-out manner. If the motion information candidate in the FIFO is the same as the motion information just encoded, the duplicate motion information candidate is removed first, and the motion information of the current coding unit is added at the tail of the FIFO. If the motion information of the current coding unit is different from the motion information of any candidate in the FIFO, the first candidate in the FIFO is removed, and the latest motion information is added to the tail of the FIFO, so that 8 latest motion information candidates are always reserved in the FIFO. The motion information candidates in the HBVP are identified together with the motion information candidates already in the AVS2, and binarized using the Unary method. Five motion information candidates are included in AVS2, but the symmetry pattern is removed in AVS3, leaving only 4 motion information candidates, plus 8 candidates for HBVP for a maximum of 12 candidates. In short, the HBVP will store the BV of the encoded IBC encoding block in a historical BV information cache with a maximum storage capacity of 12, so that historical block vector prediction information can be obtained.
(1.1.2) then allocate BV from the above-mentioned historical BV information cache as one of the candidate BVPs (denoted by cbvp _ cands [ i ], i is 0,1,2, …,6, i.e. BVPs storing up to 7 BVs) according to the following attributes:
BV buffer with size parameter W × H ≧ 64 of coded block to cbvp _ cands [0 ];
BV cache to cbvp _ cands [1] with the number of times of occurrence of coded blocks in historical BV information cache being more than or equal to 2;
the encoded blocks are cached to cbvp _ cands [2], cbvp _ cands [3], cbvp _ cands [4], cbvp _ cands [5], cbvp _ cands [6] respectively in BV of the adjacent blocks of the current block, left, top right and bottom left;
by this time, the filling of the candidate BVP (cbvp _ cands) is completed.
(1.1.3) the BVP number filled in the cbvp _ cands is recorded in cnt _ class _ cands.
And (1.2) carrying out motion estimation and selecting a proper BV.
(1.2.1) firstly establishing two Hash tables, namely m _ Hash2Pos and m _ Pos2Hash, searching hit prediction reference blocks and BV, setting the size range of IBC search according to whether the ratio of the position of the same Hash value appearing twice is more than 5%, if so, setting the size range to be 64 x 64, otherwise, setting the size range to be 32 x 32. The BVP with the lowest cost result (cost) in cbvp _ cans is then selected and stored in BVP _ idx. Then all BVPs are tried as BVs in cbvp _ cands, cost is calculated, and the BVs are compared with the BVs searched by Hash before, the best BV is selected, and the Block Vector (BV), the index number (BV _ idx) of the block vector and the cost result (cost) are recorded.
(1.2.2) if the search in step (1.2.1) yields a legally reasonable BV (i.e., BV [0] ≠ 0& & BV [1] ≠ 0). The motion estimation is finished, and the step (1.3) is executed; otherwise, executing (1.2.3) step.
(1.2.3) selecting a search starting point BV with SAD < 1000 in cbvp _ cands, otherwise setting the starting point BV to (0, 0). Recording the optimal BVP (bvpasbv _ idx), and then performing BV local search, wherein the process is as follows:
firstly, setting a preset search range;
secondly, calculating SAD according to the just obtained bvpasbv _ idx and the corresponding BV, and storing the SAD in SAD _ best _ cand and mv _ cand;
then, BV search update is performed directly above (bvx is 0, bvy pixel by pixel conversion) and directly to the left (bvy is 0, bvx pixel by pixel conversion), respectively, in this order according to the set preset search range. (note: bvx-0, bvy-0 refers to BV relative to the search starting point);
and thirdly, for the coding blocks with W < 16& & H < 16, performing one round of search to improve the prediction accuracy. Other BVs, other than directly above, directly to the left, are tried at full or double pixel intervals within the search range to choose the optimal BV.
And (1.3) after obtaining a legal and reasonable BV according to Hash search or full search in the steps (1.1) and (1.2), making skip _ me equal to 1, calculating a rate-distortion cost result (RDcost), and storing the current optimal BV.
(b) Then try four times the BV of pixel precision.
(2.1) performing BV prediction, which is the same as the step (1.1), and will not be described herein again.
(2.2) because skip _ me is 1, the original motion estimation process can be skipped, and BV obtained by adopting integer pixel precision is still the optimal BV; then according to the four-time precision requirement, the BV is adjusted to be the integral multiple of four.
And (2.3) calculating a rate-distortion cost result (RDcost) and updating the optimal BV.
To this end, first target block vector information of a first partition and second target block vector information of a second partition in the current block may be obtained.
Thus, after determining the first target block vector information of the first partition and the second target block vector information of the second partition in the current block, performing motion compensation according to the first target block vector information to determine a first predicted value of the first partition, and performing motion compensation according to the second target block vector information to determine a second predicted value of the second partition; according to the angle partition mode index sequence number (AwpIdx), a first weight value of a first partition and a second weight value of a second partition can be determined; and finally, performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value so as to obtain the intra-frame predicted value of the current block.
The embodiment provides an intra prediction method applied to an encoder. The specific implementation of the foregoing embodiment is described in detail through this embodiment, and it can be seen that, based on the technical solution of this embodiment, different angle weights are used in intra prediction to process boundary information in an image block, and edge information of two different texture/color distributions in the same partition block, a sharp object edge in an intra image, a boundary between a foreground and a background, and boundary information of a common sequence, etc. can be better processed, so that the intra image and the inter image have a tool for processing the edge information, and thus encoding efficiency of a video sequence is effectively improved.
In another embodiment of the present application, the intra prediction method provided by the embodiment of the present application is applied to a video decoding device, i.e., a decoder. The functions performed by the method may be implemented by the second processor in the decoder calling the computer program, although the computer program may be stored in the second memory, and it is understood that the decoder comprises at least the second processor and the second memory.
Based on the above application scenario example of fig. 7B, refer to fig. 9, which shows a flowchart of another intra prediction method provided in an embodiment of the present application. As shown in fig. 9, the method may include:
s901: and analyzing the code stream to obtain the prediction mode parameter of the current block.
It should be noted that a video image may be divided into a plurality of image blocks, and each image block to be currently decoded may be referred to as a decoded block. Here, each decoding block may also include a first image component, a second image component, and a third image component; and the current block is a decoding block to be subjected to prediction of a first image component, a second image component or a third image component in the video image.
In some embodiments, the parsing the code stream to obtain the prediction mode parameter of the current block may include:
analyzing the code stream to obtain an INBC mode flag bit;
if the INBC mode flag bit is a first value, determining that the current block uses an INBC mode;
and if the INBC mode flag bit is a second value, determining that the current block uses a normal intra-mode.
It should be noted that, in a specific implementation manner, the first value may be 1, and the second value may be 0; alternatively, the first value may be true and the second value may be false. In another specific implementation manner, the first value may be 0, and the second value may be 1; alternatively, the first value may be false and the second value may be true.
It should be further noted that, after the encoder determines the prediction mode parameter, the encoder may write an INBC mode flag bit into the code stream. Therefore, the decoder can obtain the INBC mode flag bit of the current block by analyzing the code stream, and then can determine whether the current block uses the INBC mode or not according to the INBC mode flag bit.
S902: and when the prediction mode parameter indicates that the INBC mode is used, analyzing the code stream to obtain a first block vector index sequence number and a second block vector index sequence number.
S903: and determining first target block vector information of a first partition of the current block corresponding to the first block vector index sequence number in the block vector candidate list and second target block vector information of a second partition of the current block corresponding to the second block vector index sequence number in the block vector candidate list based on the block vector candidate list.
It should be noted that, when the prediction mode parameter indicates that the INBC mode is used, at this time, the current block is divided based on the INBC mode, and at least two partitions may be obtained. Wherein the at least two partitions may be a first partition and a second partition.
It should be further noted that the first block vector index number is used to indicate the index number corresponding to the first target block vector information in the block vector candidate list, and the second block vector index number is used to indicate the index number corresponding to the second target block vector information in the block vector candidate list. Thus, in some embodiments, the method may further comprise:
a block vector candidate list is constructed, the block vector candidate list comprising at least one block vector.
Here, for the block vector candidate list, in a specific embodiment, the constructing the block vector candidate list may include:
obtaining historical block vector prediction information;
determining the block vector candidate list based on the historical block vector prediction information.
That is, the Block Vector candidate list may be determined based on historical Block Vector Prediction information (HBVP). In a more specific embodiment, the determining the block vector candidate list based on the historical block vector prediction information may include:
if the size parameter of the decoded block is larger than or equal to a preset size parameter, storing the block vector of the decoded block in the first zero position of the block vector candidate list; and
if the occurrence frequency of the decoded block in the historical block vector prediction information is greater than or equal to a preset frequency, storing the block vector of the decoded block in the first position of the block vector candidate list; and
storing block vectors of a left decoded neighboring block, an upper left decoded neighboring block, an upper right decoded neighboring block, and a lower left decoded neighboring block of the current block in a second bit, a third bit, a fourth bit, a fifth bit, and a sixth bit of the block vector candidate list, respectively;
and obtaining the block vector candidate list based on the block vectors stored in the zero bit, the first bit, the second bit, the third bit, the fourth bit, the fifth bit and the sixth bit in the block vector candidate list.
Note that, at most 7 block vectors are stored in the block vector candidate list (BVP); here, the ith block vector candidate list may be represented by cbvp _ cands [ i ], where i is 0,1,2, …, 6.
It should be noted that the construction of the block vector candidate list in the decoder is the same as the construction of the block vector candidate list in the encoder, and is not described in detail here.
After the encoder determines the first target block vector information and the second target block vector information, the encoder writes a first block vector index sequence number corresponding to the first target block vector information and a second block vector index sequence number corresponding to the second target block vector information into a code stream, and transmits the code stream to the decoder. Therefore, in the decoder, the first target block vector information and the second target block vector information do not need to be determined as in the encoder, and at this time, the decoder can obtain the first block vector index serial number and the second block vector index serial number by analyzing the code stream, and then can obtain the first target block vector information and the second target block vector information based on the constructed block vector candidate list. Wherein the first target block vector information represents an optimal block vector of a first partition of the current block, and the second target block vector information represents an optimal block vector of a second partition of the current block.
S904: determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information.
It should be noted that the determining the first prediction value of the first partition according to the first target block vector information may include: and performing motion compensation on the first partition according to the first target block vector information to obtain a predicted value of the first partition.
It should be further noted that the determining a second prediction value of the second partition according to the second target block vector information may include: and performing motion compensation on the second partition according to the second target block vector information to obtain a predicted value of the second partition.
That is, after obtaining the first target block vector information, motion compensation may be performed on the first partition according to the first target block vector information, so as to obtain a prediction value (or referred to as a motion compensation prediction value) of the first partition; after the second target block vector information is obtained, motion compensation may be performed on the second partition according to the second target block vector information, so that a prediction value (or referred to as a motion compensation prediction value) of the second partition may be obtained.
S905: determining a first weight value of the first partition and a second weight value of the second partition.
It should be noted that the first weight value of the first partition and the second weight value of the second partition are mainly related to the angle division pattern index number (denoted by awppidx). In some embodiments, the determining the first weight value of the first partition and the second weight value of the second partition may include:
analyzing the code stream to obtain an index sequence number of the angle division mode;
obtaining a mapping angle value by utilizing a first calculation model according to the angle division mode index sequence number;
obtaining a slope classification index value by utilizing a second calculation model according to the mapping angle value;
obtaining a partition value of the angle by using a third calculation model according to the mapping angle value;
and obtaining a first weight value of the first partition and a second weight value of the second partition by utilizing a preset weight calculation model based on the slope classification index value and the partition value to which the angle belongs.
It should be noted that, since the encoder writes the awpid to the code stream, it is possible for the decoder to obtain the awpid by parsing the code stream. Then according to the AwpIdx, a mapping angle value (expressed by ModAngNum) can be further obtained; according to ModAngNum, a slope classification index value (represented by angleIdx) and a partition value (represented by subAngleIdx) to which an angle belongs can be further obtained. In addition, the first weight value and the second weight value may include a luminance weight (represented by AwpWeightArrayY [ x ] [ y ]) and a chrominance weight (represented by AwpWeightArrayUV [ x ] [ y ]).
It should be further noted that, after the ahpdix is obtained, the determination of the first weight value and the second weight value in the decoder is the same as the determination of the first weight value and the second weight value in the encoder, and the details are not described here.
S906: and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block.
It should be noted that after the first prediction value, the first weight value, the second prediction value, and the second weight value are obtained, the first prediction value, the first weight value, the second prediction value, and the second weight value are weighted and fused, and the intra-frame prediction value of the current block in the INBC mode can be determined.
In short, in the decoder, the same block vector candidate list as the encoder side is constructed, coefficients related to decision weighting and target block vector information corresponding to two partitions (a first partition and a second partition) are respectively determined according to a mode index (i.e., an angle partition mode index number) and a BV index (i.e., a first block vector index number and a second block vector index number) transmitted by the encoder side, and then the motion compensation prediction values of the two partitions are weighted to obtain a final intra prediction value.
The intra prediction step of the decoder is as follows:
(1) and analyzing the code stream to obtain flag information, an index sequence number of an angle division mode of the INBC mode and BV indexes of two partitions.
(2) The block vector candidate list (i.e., BVP list) is derived.
(3) Based on the BV index and the BVP list, BV information for both partitions (i.e., the respective target block vector information for both partitions, including the first target block vector information and the second target block vector information) may be determined.
(4) And respectively determining the motion compensation predicted values of the two partitions according to the target block vector information of the two partitions.
(5) Analyzing the code stream to obtain mode information; a weighting weight is calculated based on the pattern information.
(6) And obtaining the final intra-frame prediction value of the current block through weighted fusion.
The embodiment provides an intra-frame prediction method applied to a decoder. Acquiring a prediction mode parameter of the current block by analyzing the code stream; when the prediction mode parameter indicates that the INBC mode is used, analyzing a code stream to obtain a first block vector index sequence number and a second block vector index sequence number; determining, based on a block vector candidate list, first target block vector information of a first partition of a current block corresponding to the first block vector index number in the block vector candidate list, and second target block vector information of a second partition of the current block corresponding to the second block vector index number in the block vector candidate list; determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information; determining a first weight value of the first partition and a second weight value of the second partition; and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block. Therefore, the boundary information in the image block is processed by using different angle weighting in intra-frame prediction, and the edge information of two parts of different texture/color distribution in the same partition block, sharp object edges in an intra-frame image, the boundary between a foreground and a background, the boundary information of a common sequence and the like can be better processed, so that the intra-frame image and the inter-frame image have a tool for processing the edge information, and the decoding efficiency of a video sequence is effectively improved.
In still another embodiment of the present application, based on the same inventive concept as the foregoing embodiment, referring to fig. 10, a schematic structural diagram of a component of an encoder 100 provided in an embodiment of the present application is shown. As shown in fig. 10, the encoder 100 may include: a first determination unit 1001, a first calculation unit 1002, and a first prediction unit 1003; wherein the content of the first and second substances,
a first determining unit 1001 configured to determine a prediction mode parameter of a current block;
a first determining unit 1001 further configured to determine first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block when the prediction mode parameter indicates that the INBC mode is used;
a first calculation unit 1002 configured to determine a first prediction value of the first partition according to the first target block vector information, and determine a second prediction value of the second partition according to the second target block vector information; and determining a first weight value of the first partition and a second weight value of the second partition;
a first prediction unit 1003, configured to perform weighted fusion on the first prediction value, the first weight value, the second prediction value, and the second weight value, to determine an intra prediction value of the current block.
In some embodiments, referring to fig. 10, the encoder 100 may further include a pre-coding unit 1004 configured to pre-code the current block based on a plurality of candidate prediction modes, and determine pre-coding results corresponding to the plurality of candidate prediction modes;
the first determining unit 1001 is further configured to determine a prediction mode parameter of the current block from the plurality of candidate prediction modes according to the pre-encoding result.
Further, the first determining unit 1001 is specifically configured to obtain rate-distortion cost results corresponding to the multiple candidate prediction modes based on the precoding result; and selecting an optimal rate distortion cost result from the rate distortion cost results, and determining a candidate prediction mode corresponding to the optimal rate distortion cost result as the prediction mode parameter of the current block.
In some embodiments, referring to fig. 10, the encoder 100 may further include a setting unit 1005; wherein the plurality of candidate prediction modes comprise an INBC mode and a normal intra mode;
a setting unit 1005 configured to set an INBC mode flag bit to a first value if the prediction mode parameter indicates that the INBC mode is used; setting the INBC mode flag bit to a second value if the prediction mode parameter indicates that a normal intra-mode is used.
In some embodiments, the first value is 1 and the second value is 0; or, the first value is true, and the second value is a flash.
In some embodiments, referring to fig. 10, the encoder 100 may further include a writing unit 1006 configured to write the INBC mode flag bit into the code stream.
In some embodiments, the first determining unit 1001 is further configured to determine three target candidate angle partition modes from among the plurality of candidate angle partition modes; performing intra-frame prediction on the current block by using the three target candidate angle division modes, and determining prediction cost results corresponding to the three target candidate angle division modes; and determining an INBC mode used by the current block from the three target candidate angle division modes based on the prediction cost result.
Further, the first determining unit 1001 is specifically configured to obtain rate-distortion cost results corresponding to the three target candidate angle partition modes based on the prediction cost result; and selecting an optimal rate distortion cost result from the rate distortion cost results, and determining a target candidate angle partition mode corresponding to the optimal rate distortion cost result as the INBC mode used by the current block.
In some embodiments, the pre-coding unit 1004 is further configured to pre-code the current block based on the plurality of candidate angle partition modes, and determine pre-coding results corresponding to the plurality of candidate angle partition modes;
the first determining unit 1001 is further configured to determine the three target candidate angle division modes from the plurality of candidate angle division modes based on the precoding result.
Further, the first determining unit 1001 is specifically configured to obtain SATD cost results corresponding to the multiple candidate angle partition modes based on the precoding result; and selecting three relatively superior SATD cost results from the SATD cost results, and determining the candidate angle division modes corresponding to the three SATD cost results as the three target candidate angle division modes.
In some embodiments, the first determining unit 1001 is further configured to determine a first partition and a second partition of the current block in each candidate angle partition mode based on a plurality of candidate angle partition modes; determining first target block vector information of the first partition and second target block vector information of the second partition in each candidate angle partition mode;
the pre-coding unit 1004 is specifically configured to pre-code the current block according to the first target block vector information of the first partition and the second target block vector information of the second partition in each candidate angle partition mode, so as to obtain pre-coding results corresponding to the multiple candidate angle partition modes.
In some embodiments, referring to fig. 10, the encoder 100 may further include a first constructing unit 1007 configured to construct a block vector candidate list including at least one block vector.
In some embodiments, the first constructing unit 1007 is specifically configured to obtain historical block vector prediction information; and determining the block vector candidate list based on the historical block vector prediction information.
Further, the first constructing unit 1007 is specifically configured to store the block vector of the encoded block in the zero-th bit of the block vector candidate list if the size parameter of the encoded block is greater than or equal to the preset size parameter; if the occurrence frequency of the coded block in the historical block vector prediction information is larger than or equal to a preset frequency, storing the block vector of the coded block in the first position of the block vector candidate list; and storing block vectors of a left encoded neighboring block, an upper left encoded neighboring block, an upper right encoded neighboring block, and a lower left encoded neighboring block of the current block in a second bit, a third bit, a fourth bit, a fifth bit, and a sixth bit of the block vector candidate list, respectively; and obtaining the block vector candidate list based on the block vectors stored in the zero bit, the first bit, the second bit, the third bit, the fourth bit, the fifth bit and the sixth bit in the block vector candidate list.
In some embodiments, the first determining unit 1001 is specifically configured to determine the first partition and the second partition after the current block is divided based on the INBC mode; establishing a preset hash table, performing intra block copy search on the first partition and the second partition, and selecting first block vector information matched with the hash key value of the first partition and second block vector information matched with the hash key value of the second partition from the block vector candidate list; traversing at least one block vector in the block vector candidate list, and calculating a first price result corresponding to the first partition relative to the at least one block vector and a second price result corresponding to the second partition relative to the at least one block vector; selecting an optimal cost result from the first cost result, and determining a block vector corresponding to the optimal cost result as first two-block vector information of the first partition; selecting an optimal cost result from the second cost results, and determining a block vector corresponding to the optimal cost result as second block vector information of the second partition; determining the block vector information with the optimal cost result as first target block vector information of the first partition from the first one-block vector information and the first two-block vector information; and determining the block vector information with the optimal cost result as second target block vector information of the second partition from the second block vector information and the second block vector information.
In some embodiments, the first determining unit 1001 is further configured to determine a preset search range if at least one of the first target block vector information and the second target block vector information belongs to non-legal block vector information; in the block vector candidate list, respectively carrying out pixel-by-pixel block vector search on the first partition and the second partition according to the preset search range in sequence to obtain first block vector information and second block vector information; and determining the obtained first block vector information and second block vector information as the first target block vector information and the second target block vector information.
In some embodiments, the first determining unit 1001 is further configured to determine a first block vector index number, where the first block vector index number is used to indicate an index number corresponding to the first target block vector information in the block vector candidate list; determining a second block vector index sequence number, wherein the second block vector index sequence number is used for indicating a corresponding index sequence number of second target block vector information in the block vector candidate list;
a writing unit 1006, further configured to write the first block vector index sequence number and the second block vector index sequence number into a code stream.
In some embodiments, the first calculating unit 1002 is specifically configured to perform motion compensation on the first partition according to the first target block vector information, so as to obtain a prediction value of the first partition.
In some embodiments, the first calculating unit 1002 is specifically configured to perform motion compensation on the second partition according to the second target block vector information to obtain a prediction value of the second partition.
In some embodiments, the first determining unit 1001 is further configured to determine an angle partition mode index number based on the INBC mode;
the first calculating unit 1002 is further configured to obtain a mapping angle value by using a first calculation model according to the angle partition mode index sequence number; obtaining a slope classification index value by utilizing a second calculation model according to the mapping angle value; obtaining a partition value of the angle by using a third calculation model according to the mapping angle value; and obtaining a first weight value of the first partition and a second weight value of the second partition by using a preset weight calculation model based on the slope classification index value and the partition value to which the angle belongs.
In some embodiments, the writing unit 1006 is further configured to write the angle partition mode index sequence number into the code stream.
It is understood that in the embodiments of the present application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, and the like, and may also be a module, and may also be non-modular. Moreover, each component in the embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware or a form of a software functional module.
Based on the understanding that the technical solution of the present embodiment essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method of the present embodiment. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Accordingly, the present embodiment provides a computer storage medium applied to the encoder 100, wherein the computer storage medium stores an intra-frame prediction program, and the intra-frame prediction program realizes the method of any one of the foregoing embodiments when executed by a first processor.
Based on the above-mentioned composition of the encoder 100 and the computer storage medium, refer to fig. 11, which shows a specific hardware structure diagram of the encoder 100 provided in the embodiment of the present application. As shown in fig. 11, may include: a first communication interface 1101, a first memory 1102 and a first processor 1103; the various components are coupled together by a first bus system 1104. It is understood that the first bus system 1104 is used to enable communications for connections between these components. The first bus system 1104 includes a power bus, a control bus, and a status signal bus in addition to the data bus. For clarity of illustration, however, the various buses are labeled as first bus system 1104 in fig. 11. Wherein the content of the first and second substances,
a first communication interface 1101 for receiving and transmitting signals during information transmission and reception with other external network elements;
a first memory 1102 for storing a computer program operable on the first processor 1103;
a first processor 1103, configured to, when running the computer program, perform:
determining a prediction mode parameter of a current block;
determining first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block when the prediction mode parameter indicates that the INBC mode is used;
determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information;
determining a first weight value of the first partition and a second weight value of the second partition;
and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block.
It will be appreciated that the first memory 1102 in the subject embodiment can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (ddr Data Rate SDRAM, ddr SDRAM), Enhanced Synchronous SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 1102 of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
The first processor 1103 may be an integrated circuit chip having signal processing capability. In implementation, the steps of the method may be implemented by an integrated logic circuit of hardware or an instruction in the form of software in the first processor 1103. The first Processor 1103 may be a general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the first memory 1102, and the first processor 1103 reads information in the first memory 1102 and completes the steps of the method in combination with hardware thereof.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof. For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Optionally, as another embodiment, the first processor 1103 is further configured to, when running the computer program, perform the method of any of the preceding embodiments.
The present embodiment provides an encoder that may include a first determination unit, a first calculation unit, and a first prediction unit. Therefore, the boundary information in the image block is processed by using different angle weighting in intra-frame prediction, and the edge information of two parts of different texture/color distribution in the same partition block, sharp object edges in an intra-frame image, the boundary between a foreground and a background, the boundary information of a common sequence and the like can be better processed, so that the intra-frame image and the inter-frame image have a tool for processing the edge information, and the coding efficiency of a video sequence is effectively improved.
In yet another embodiment of the present application, based on the same inventive concept as the foregoing embodiment, refer to fig. 12, which shows a schematic structural diagram of a decoder 120 provided in an embodiment of the present application. As shown in fig. 12, the decoder 120 may include: an analysis unit 1201, a second determination unit 1202, a second calculation unit 1203, and a second prediction unit 1204; wherein the content of the first and second substances,
the analysis unit 1201 is configured to analyze the code stream and obtain a prediction mode parameter of the current block; and further configured to parse the code stream to obtain a first block vector index sequence number and a second block vector index sequence number when the prediction mode parameter indicates that the INBC mode is used;
a second determining unit 1202 configured to determine, based on a block vector candidate list, first target block vector information of a first partition of a current block corresponding to the first block vector index number in the block vector candidate list, and second target block vector information of a second partition of the current block corresponding to the second block vector index number in the block vector candidate list;
a second calculation unit 1203 configured to determine a first prediction value of the first partition according to the first target block vector information, and determine a second prediction value of the second partition according to the second target block vector information; and determining a first weight value of the first partition and a second weight value of the second partition;
a second prediction unit 1204, configured to perform weighted fusion on the first prediction value, the first weight value, the second prediction value, and the second weight value, and determine an intra prediction value of the current block.
In some embodiments, the parsing unit 1201 is further configured to parse the code stream to obtain an INBC mode flag bit;
a second determining unit 1202, further configured to determine that the current block uses the INBC mode if the INBC mode flag is a first value; if the INBC mode flag bit is a second value, determining that the current block uses a normal intra-mode.
In some embodiments, the first value is 1 and the second value is 0; or, the first value is true, and the second value is a flash.
In some embodiments, referring to fig. 12, the decoder 120 may further comprise a second construction unit 1205 configured to construct a block vector candidate list comprising at least one block vector.
In some embodiments, the second constructing unit 1205 is specifically configured to obtain historical block vector prediction information; and determining the block vector candidate list based on the historical block vector prediction information.
Further, the second constructing unit 1205 is specifically configured to store the block vector of the decoded block in the zero-th bit of the block vector candidate list if the size parameter of the decoded block is greater than or equal to the preset size parameter; and if the number of times of occurrence of a decoded block in the historical block vector prediction information is greater than or equal to a preset number of times, storing the block vector of the decoded block in the first bit of the block vector candidate list; and storing block vectors of a left decoded neighboring block, an upper left decoded neighboring block, an upper right decoded neighboring block, and a lower left decoded neighboring block of the current block in second, third, fourth, fifth, and sixth bits of the block vector candidate list, respectively; and obtaining the block vector candidate list based on the block vectors stored in the zero bit, the first bit, the second bit, the third bit, the fourth bit, the fifth bit and the sixth bit in the block vector candidate list.
In some embodiments, the second calculating unit 1203 is specifically configured to perform motion compensation on the first partition according to the first target block vector information, so as to obtain a prediction value of the first partition.
In some embodiments, the second calculating unit 1203 is specifically configured to perform motion compensation on the second partition according to the second target block vector information, so as to obtain a prediction value of the second partition.
In some embodiments, the parsing unit 1201 is further configured to parse the code stream to obtain an index number of the angle partition mode;
the second calculating unit 1203 is further configured to obtain a mapping angle value by using the first calculation model according to the angle partition mode index sequence number; obtaining a slope classification index value by utilizing a second calculation model according to the mapping angle value; obtaining a partition value of the angle by using a third calculation model according to the mapping angle value; and obtaining a first weight value of the first partition and a second weight value of the second partition by using a preset weight calculation model based on the slope classification index value and the partition value to which the angle belongs.
It is understood that in this embodiment, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and may also be a module, or may also be non-modular. Moreover, each component in the embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware or a form of a software functional module.
The integrated unit, if implemented in the form of a software functional module and not sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the present embodiment provides a computer storage medium applied to the decoder 120, the computer storage medium storing an intra prediction program, which when executed by the second processor implements the method of any one of the preceding embodiments.
Based on the above-mentioned composition of the decoder 120 and the computer storage medium, refer to fig. 13, which shows a specific hardware structure diagram of the decoder 120 provided in the embodiment of the present application. As shown in fig. 13, may include: a second communication interface 1301, a second memory 1302, and a second processor 1303; the various components are coupled together by a second bus system 1304. It will be appreciated that the second bus system 1304 is used to enable communications among these components. The second bus system 1304 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as the second bus system 1304 in fig. 13. Wherein the content of the first and second substances,
a second communication interface 1301, which is used for receiving and sending signals during the process of receiving and sending information with other external network elements;
a second memory 1302 for storing a computer program capable of running on the second processor 1303;
a second processor 1303, configured to execute, when the computer program runs, the following steps:
analyzing the code stream to obtain the prediction mode parameter of the current block;
when the prediction mode parameter indicates that an INBC mode is used, analyzing a code stream to obtain a first block vector index sequence number and a second block vector index sequence number;
determining, based on a block vector candidate list, first target block vector information of a first partition of a current block corresponding to the first block vector index number in the block vector candidate list, and second target block vector information of a second partition of the current block corresponding to the second block vector index number in the block vector candidate list;
determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information;
determining a first weight value of the first partition and a second weight value of the second partition;
and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block.
Optionally, as another embodiment, the second processor 1303 is further configured to execute the method in any one of the foregoing embodiments when the computer program is executed.
It is understood that the second memory 1302 has hardware functions similar to those of the first memory 1102, and the second processor 1303 has hardware functions similar to those of the first processor 1103; and will not be described in detail herein.
The present embodiment provides a decoder, which may include a parsing unit, a second determining unit, a second calculating unit, and a second predicting unit. Therefore, the boundary information in the image block is processed by using different angle weighting in intra-frame prediction, and the edge information of two parts of different texture/color distribution in the same partition block, sharp object edges in an intra-frame image, the boundary between a foreground and a background, the boundary information of a common sequence and the like can be better processed, so that the intra-frame image and the inter-frame image have a tool for processing the edge information, and the decoding efficiency of a video sequence is effectively improved.
It should be noted that, in the present application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present application are merely for description, and do not represent the advantages and disadvantages of the embodiments.
The methods disclosed in the several method embodiments provided in the present application may be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in several of the product embodiments provided in the present application may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or apparatus embodiments provided in the present application may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Industrial applicability
In the embodiment of the application, after the prediction mode parameter of the current block is obtained, when the prediction mode parameter indicates that an INBC mode is used, first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block are determined; determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information; determining a first weight value of the first partition and a second weight value of the second partition; and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block. Therefore, the boundary information in the image block is processed by using different angle weighting in the intra-frame prediction, and the edge information of two parts of different texture/color distribution in the same partition block, sharp object edges in the intra-frame image, the boundary between the foreground and the background, the boundary information of a common sequence and the like can be better processed, so that the intra-frame image and the inter-frame image have a tool for processing the edge information, and the coding and decoding efficiency of a video sequence is effectively improved.

Claims (35)

  1. An intra prediction method applied to an encoder, the method comprising:
    determining a prediction mode parameter of a current block;
    determining first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block when the prediction mode parameter indicates that the non-rectangular block copy, INBC, mode is used;
    determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information;
    determining a first weight value of the first partition and a second weight value of the second partition;
    and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block.
  2. The method of claim 1, wherein the determining the prediction mode parameter for the current block comprises:
    pre-coding the current block based on a plurality of candidate prediction modes, and determining pre-coding results corresponding to the candidate prediction modes;
    and determining the prediction mode parameters of the current block from the plurality of candidate prediction modes according to the pre-coding result.
  3. The method of claim 2, wherein the determining the prediction mode parameter of the current block from the plurality of candidate prediction modes according to the pre-coding result comprises:
    obtaining rate distortion cost results corresponding to the multiple candidate prediction modes based on the pre-coding result;
    and selecting an optimal rate distortion cost result from the rate distortion cost results, and determining a candidate prediction mode corresponding to the optimal rate distortion cost result as the prediction mode parameter of the current block.
  4. The method of claim 2 or 3, wherein the plurality of candidate prediction modes comprises an INBC mode and a normal intra-mode, and the determining the prediction mode parameters for the current block comprises:
    setting an INBC mode flag bit to a first value if the prediction mode parameter indicates that an INBC mode is used;
    setting the INBC mode flag bit to a second value if the prediction mode parameter indicates that a normal intra-mode is used.
  5. The method of claim 4, wherein the first value is 1 and the second value is 0; or, the first value is true, and the second value is a flash.
  6. The method of claim 4, wherein the method further comprises:
    and writing the INBC mode flag bit into a code stream.
  7. The method of claim 1, wherein prior to said determining the prediction mode parameter for the current block, the method further comprises:
    determining three target candidate angle division modes from a plurality of candidate angle division modes;
    performing intra-frame prediction on the current block by using the three target candidate angle division modes, and determining prediction cost results corresponding to the three target candidate angle division modes;
    determining an INBC mode used by the current block from the three target candidate angular division modes based on the prediction cost result.
  8. The method of claim 7, wherein the determining the INBC mode used by the current block from the three target candidate angular partition modes based on the prediction cost result comprises:
    based on the prediction cost result, obtaining rate distortion cost results corresponding to the three target candidate angle division modes;
    and selecting an optimal rate distortion cost result from the rate distortion cost results, and determining a target candidate angle partition mode corresponding to the optimal rate distortion cost result as the INBC mode used by the current block.
  9. The method of claim 7, wherein said determining three target candidate angular division modes from among a plurality of candidate angular division modes comprises:
    pre-coding the current block based on the multiple candidate angle division modes, and determining pre-coding results corresponding to the multiple candidate angle division modes;
    determining the three target candidate angle partition modes from the plurality of candidate angle partition modes based on the pre-coding result.
  10. The method of claim 9, wherein the determining the three target candidate angular division modes from the plurality of candidate angular division modes based on the precoding result comprises:
    obtaining absolute transformation differences and SATD cost results corresponding to the multiple candidate angle division modes based on the pre-coding result;
    and selecting three relatively excellent SATD cost results from the SATD cost results, and determining the candidate angle division modes corresponding to the three SATD cost results as the three target candidate angle division modes.
  11. The method of claim 9, wherein the pre-coding the current block based on the plurality of candidate angle partition modes and determining pre-coding results corresponding to the plurality of candidate angle partition modes comprises:
    determining a first partition and a second partition of the current block in each candidate angular division mode based on a plurality of candidate angular division modes;
    determining first target block vector information of the first partition and second target block vector information of the second partition in each candidate angle partition mode;
    and precoding the current block according to the first target block vector information of the first partition and the second target block vector information of the second partition in each candidate angle partition mode to obtain precoding results corresponding to the multiple candidate angle partition modes.
  12. The method of claim 1, wherein the method further comprises:
    a block vector candidate list is constructed, the block vector candidate list comprising at least one block vector.
  13. The method of claim 12, wherein said constructing a block vector candidate list comprises:
    obtaining historical block vector prediction information;
    determining the block vector candidate list based on the historical block vector prediction information.
  14. The method of claim 13, wherein the determining the block vector candidate list based on the historical block vector prediction information comprises:
    if the size parameter of the coded block is larger than or equal to the preset size parameter, storing the block vector of the coded block in the zero position of the block vector candidate list; and
    if the occurrence frequency of the coded block in the historical block vector prediction information is greater than or equal to a preset frequency, storing the block vector of the coded block in the first position of the block vector candidate list; and
    storing block vectors of a left encoded neighboring block, an upper left encoded neighboring block, an upper right encoded neighboring block, and a lower left encoded neighboring block of the current block in a second bit, a third bit, a fourth bit, a fifth bit, and a sixth bit of the block vector candidate list, respectively;
    and obtaining the block vector candidate list based on the block vectors stored in the zero bit, the first bit, the second bit, the third bit, the fourth bit, the fifth bit and the sixth bit in the block vector candidate list.
  15. The method of claim 12, wherein the determining first target block vector information for a first partition of the current block and second target block vector information for a second partition of the current block comprises:
    determining the first partition and the second partition after the current block is divided based on the INBC mode;
    establishing a preset hash table, performing intra block copy search on the first partition and the second partition, and selecting first block vector information matched with the hash key value of the first partition and second block vector information matched with the hash key value of the second partition from the block vector candidate list;
    traversing at least one block vector in the block vector candidate list, and calculating a first price result corresponding to the first partition with respect to the at least one block vector and a second price result corresponding to the second partition with respect to the at least one block vector;
    selecting an optimal cost result from the first cost result, and determining a block vector corresponding to the optimal cost result as first two-block vector information of the first partition; selecting an optimal cost result from the second cost results, and determining a block vector corresponding to the optimal cost result as second block vector information of the second partition;
    determining the block vector information with the optimal cost result as first target block vector information of the first partition from the first one-block vector information and the first two-block vector information; and
    and determining the block vector information with the optimal cost result as second target block vector information of the second partition from the second block vector information and the second block vector information.
  16. The method of claim 15, wherein the determining first target block vector information for a first partition of the current block and second target block vector information for a second partition of the current block comprises:
    if at least one of the first target block vector information and the second target block vector information belongs to non-legal block vector information, determining a preset search range; in the block vector candidate list, respectively carrying out pixel-by-pixel block vector search on the first partition and the second partition according to the preset search range in sequence to obtain first block vector information and second block vector information;
    determining the obtained first block vector information and second block vector information as the first target block vector information and the second target block vector information.
  17. The method of claim 1, wherein after determining the first target block vector information and the second target block vector information, the method further comprises:
    determining a first block vector index sequence number, where the first block vector index sequence number is used to indicate an index sequence number corresponding to the first target block vector information in the block vector candidate list;
    determining a second block vector index sequence number, where the second block vector index sequence number is used to indicate a corresponding index sequence number of the second target block vector information in the block vector candidate list;
    and writing the first block vector index sequence number and the second block vector index sequence number into a code stream.
  18. The method of any of claims 1 to 17, wherein said determining a first predictor of the first partition from the first target block vector information comprises:
    and performing motion compensation on the first partition according to the first target block vector information to obtain a predicted value of the first partition.
  19. The method of any of claims 1 to 17, wherein said determining a second predictor of the second partition from the second target block vector information comprises:
    and performing motion compensation on the second partition according to the second target block vector information to obtain a predicted value of the second partition.
  20. The method of any of claims 1 to 17, wherein the determining a first weight value for the first partition and a second weight value for the second partition comprises:
    determining an angle partition mode index sequence number based on the INBC mode;
    obtaining a mapping angle value by utilizing a first calculation model according to the angle division mode index sequence number;
    obtaining a slope classification index value by utilizing a second calculation model according to the mapping angle value;
    obtaining a partition value of the angle by using a third calculation model according to the mapping angle value;
    and obtaining a first weight value of the first partition and a second weight value of the second partition by utilizing a preset weight calculation model based on the slope classification index value and the partition value to which the angle belongs.
  21. The method of claim 20, wherein after determining an angle partition mode index order number, the method further comprises:
    and writing the index sequence number of the angle division mode into a code stream.
  22. An intra prediction method applied to a decoder, the method comprising:
    analyzing the code stream to obtain the prediction mode parameter of the current block;
    when the prediction mode parameter indicates that the INBC mode is used, analyzing a code stream to obtain a first block vector index sequence number and a second block vector index sequence number;
    determining, based on a block vector candidate list, first target block vector information of a first partition of a current block corresponding to the first block vector index number in the block vector candidate list, and second target block vector information of a second partition of the current block corresponding to the second block vector index number in the block vector candidate list;
    determining a first predictor of the first partition according to the first target block vector information, and determining a second predictor of the second partition according to the second target block vector information;
    determining a first weight value of the first partition and a second weight value of the second partition;
    and performing weighted fusion by using the first predicted value, the first weight value, the second predicted value and the second weight value to determine the intra-frame predicted value of the current block.
  23. The method of claim 22, wherein the parsing the code stream to obtain the prediction mode parameter of the current block comprises:
    analyzing the code stream to obtain an INBC mode flag bit;
    determining that the current block uses an INBC mode if the INBC mode flag bit is a first value;
    if the INBC mode flag bit is a second value, determining that the current block uses a normal intra-mode.
  24. The method of claim 23, wherein the first value is 1 and the second value is 0; or, the first value is true, and the second value is a flash.
  25. The method of claim 22, wherein the method further comprises:
    constructing the block vector candidate list, the block vector candidate list comprising at least one block vector.
  26. The method of claim 25, wherein said constructing the block vector candidate list comprises:
    obtaining historical block vector prediction information;
    determining the block vector candidate list based on the historical block vector prediction information.
  27. The method of claim 26, wherein said determining the block vector candidate list based on the historical block vector prediction information comprises:
    if the size parameter of the decoded block is larger than or equal to a preset size parameter, storing the block vector of the decoded block in the first zero position of the block vector candidate list; and
    if the occurrence frequency of the decoded block in the historical block vector prediction information is greater than or equal to a preset frequency, storing the block vector of the decoded block in the first position of the block vector candidate list; and
    storing block vectors of a left decoded neighboring block, an upper left decoded neighboring block, an upper right decoded neighboring block, and a lower left decoded neighboring block of the current block in a second bit, a third bit, a fourth bit, a fifth bit, and a sixth bit of the block vector candidate list, respectively;
    and obtaining the block vector candidate list based on the block vectors stored in the zero bit, the first bit, the second bit, the third bit, the fourth bit, the fifth bit and the sixth bit in the block vector candidate list.
  28. The method of any of claims 22 to 27, wherein said determining a first predictor of the first partition from the first target block vector information comprises:
    and performing motion compensation on the first partition according to the first target block vector information to obtain a predicted value of the first partition.
  29. The method of any of claims 22 to 27, wherein said determining a second predictor of the second partition from the second target block vector information comprises:
    and performing motion compensation on the second partition according to the second target block vector information to obtain a predicted value of the second partition.
  30. The method of any of claims 22 to 27, wherein the determining a first weight value for the first partition and a second weight value for the second partition comprises:
    analyzing the code stream to obtain an index sequence number of the angle division mode;
    obtaining a mapping angle value by utilizing a first calculation model according to the angle division mode index sequence number;
    obtaining a slope classification index value by utilizing a second calculation model according to the mapping angle value;
    according to the mapping angle value, obtaining a partition value of the angle by using a third calculation model;
    and obtaining a first weight value of the first partition and a second weight value of the second partition by utilizing a preset weight calculation model based on the slope classification index value and the partition value to which the angle belongs.
  31. An encoder comprising a first determination unit, a first calculation unit, and a first prediction unit; wherein the content of the first and second substances,
    the first determining unit is configured to determine a prediction mode parameter of the current block;
    the first determination unit is further configured to determine first target block vector information of a first partition of the current block and second target block vector information of a second partition of the current block when the prediction mode parameter indicates that the INBC mode is used;
    the first calculation unit is configured to determine a first prediction value of the first partition according to the first target block vector information, and determine a second prediction value of the second partition according to the second target block vector information; and determining a first weight value of the first partition and a second weight value of the second partition;
    the first prediction unit is configured to perform weighted fusion by using the first prediction value, the first weight value, the second prediction value and the second weight value to determine an intra prediction value of the current block.
  32. An encoder comprising a first memory and a first processor; wherein the content of the first and second substances,
    the first memory for storing a computer program operable on the first processor;
    the first processor, when executing the computer program, is configured to perform the method of any of claims 1 to 21.
  33. A decoder comprising a parsing unit, a second determining unit, a second calculating unit and a second predicting unit; wherein the content of the first and second substances,
    the analysis unit is configured to analyze the code stream and obtain a prediction mode parameter of the current block; and further configured to parse the code stream to obtain a first block vector index sequence number and a second block vector index sequence number when the prediction mode parameter indicates that the INBC mode is used;
    the second determining unit is configured to determine, based on a block vector candidate list, first target block vector information of a first partition of a current block corresponding to the first block vector index number in the block vector candidate list, and second target block vector information of a second partition of the current block corresponding to the second block vector index number in the block vector candidate list;
    the second calculation unit is configured to determine a first prediction value of the first partition according to the first target block vector information, and determine a second prediction value of the second partition according to the second target block vector information; and determining a first weight value of the first partition and a second weight value of the second partition;
    the second prediction unit is configured to perform weighted fusion by using the first prediction value, the first weight value, the second prediction value and the second weight value to determine an intra prediction value of the current block.
  34. A decoder comprising a second memory and a second processor; wherein the content of the first and second substances,
    the second memory for storing a computer program operable on the second processor;
    the second processor, when executing the computer program, is configured to perform the method of any of claims 22 to 30.
  35. A computer storage medium, wherein the computer storage medium stores a computer program which, when executed by a first processor, implements the method of any of claims 1 to 21, or which, when executed by a second processor, implements the method of any of claims 22 to 30.
CN202080083248.2A 2020-11-17 2020-11-17 Intra prediction method, encoder, decoder, and computer storage medium Pending CN114830651A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/129266 WO2022104498A1 (en) 2020-11-17 2020-11-17 Intra-frame prediction method, encoder, decoder and computer storage medium

Publications (1)

Publication Number Publication Date
CN114830651A true CN114830651A (en) 2022-07-29

Family

ID=81707936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202080083248.2A Pending CN114830651A (en) 2020-11-17 2020-11-17 Intra prediction method, encoder, decoder, and computer storage medium

Country Status (2)

Country Link
CN (1) CN114830651A (en)
WO (1) WO2022104498A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024007128A1 (en) * 2022-07-04 2024-01-11 Oppo广东移动通信有限公司 Video encoding and decoding methods, apparatus, and devices, system, and storage medium
CN114885164B (en) * 2022-07-12 2022-09-30 深圳比特微电子科技有限公司 Method and device for determining intra-frame prediction mode, electronic equipment and storage medium
WO2024022325A1 (en) * 2022-07-27 2024-02-01 Mediatek Inc. Method and apparatus of improving performance of convolutional cross-component model in video coding system
CN116156174B (en) * 2023-02-23 2024-02-13 格兰菲智能科技有限公司 Data encoding processing method, device, computer equipment and storage medium
CN116456100B (en) * 2023-06-16 2023-08-29 深流微智能科技(深圳)有限公司 Inter-frame coding tree unit division method and device
CN116668704B (en) * 2023-08-02 2024-02-06 深圳传音控股股份有限公司 Processing method, processing apparatus, and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106375764B (en) * 2016-08-31 2018-04-10 中国科学技术大学 A kind of bonding position prediction and block replicate the video intra-frame encoding method of prediction
CN117041558A (en) * 2016-12-07 2023-11-10 株式会社Kt Method for decoding or encoding video and apparatus for storing video data
US11284066B2 (en) * 2018-10-10 2022-03-22 Tencent America LLC Method and apparatus for intra block copy in intra-inter blending mode and triangle prediction unit mode
KR20210089149A (en) * 2018-11-16 2021-07-15 베이징 바이트댄스 네트워크 테크놀로지 컴퍼니, 리미티드 Inter- and intra-integrated prediction mode weights

Also Published As

Publication number Publication date
WO2022104498A1 (en) 2022-05-27

Similar Documents

Publication Publication Date Title
KR102130821B1 (en) Method for video decoding and computer readable redording meduim thereof
KR101651595B1 (en) Method for video decoding and computer readable redording meduim thereof
CN114830651A (en) Intra prediction method, encoder, decoder, and computer storage medium
US11350125B2 (en) Method and device for intra-prediction
TW201808011A (en) Geometry transformation-based adaptive loop filtering
CN112369021A (en) Image encoding/decoding method and apparatus for throughput enhancement and recording medium storing bitstream
WO2022117089A1 (en) Prediction method, encoder, decoder and storage medium
US11962803B2 (en) Method and device for intra-prediction
CN112585976A (en) Method and apparatus for encoding/decoding image and recording medium for storing bitstream
CN113841399A (en) Image encoding/decoding method and apparatus
CN113841404A (en) Video encoding/decoding method and apparatus, and recording medium storing bitstream
KR20190140820A (en) A method and an apparatus for processing a video signal based on reference between components
WO2022140905A1 (en) Prediction methods, encoder, decoder, and storage medium
JP4697802B2 (en) Video predictive coding method and apparatus
KR20150061618A (en) Method and apparatus for video encoding and decoding dependent on hierarchical structure of coding unit
WO2023154574A1 (en) Methods and devices for geometric partitioning mode with adaptive blending
CN118042136A (en) Encoding and decoding method and device
KR20140087137A (en) Method and apparratus of adaptive bi-prediction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination