Intra-frame prediction method, encoder, decoder and computer storage medium
By combining INBC mode and angle weighting processing in intra prediction, the problem of insufficient processing of intra image boundary information is solved, and the encoding and decoding efficiency of video sequences is improved.
Patent Information
- Application Number
- CN202080083248.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-17
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2040-11-17
AI Technical Summary
The existing intra-block copy (IBC) technology and angle-weighted prediction (AWP) technology have problems with inefficient encoding in video encoding, and fail to effectively process the boundary information of intra-images, limiting the encoding and decoding performance of video sequences.
A intra prediction method is proposed, combining the non-rectangular block copy (INBC) mode, by determining the prediction mode parameters of the current block, using angle weighting to process the boundary information of the image block, and using the target block vector information and weighting value for weighting to improve Accuracy of intra prediction.
The encoding and decoding efficiency of video sequences is improved, so that intra-frame images can have tools to process edge information like inter-frame images, and the encoding performance is improved.
Smart Images

Figure CN114830651B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of coding and decoding technology, and in particular to an intra-frame prediction method, an encoder, a decoder, and a computer storage medium. Background Art
[0002] With the rapid development of science and technology, people have higher and higher requirements for video viewing and processing, especially the increasing demand for screen content video (SCV). Among them, in view of the characteristics of screen content such as high contrast, limited color data and more repeated areas, an extended coding standard - Screen Content Coding (SCC) has been proposed.
[0003] In the related art, the Intra Block Copy (IBC) technology can be used to predict repeated / cyclic local image features and is applied to screen content encoding. However, it copies the entire reference block and does not take into account the boundary information of some local image features, which limits the encoding efficiency of the IBC technology and its application in ordinary sequences. As for the Angular Weighted Prediction (AWP) technology, it is used to process boundary information in inter-frame images, but is not applied to the processing of intra-frame blocks, so that the intra-frame image cannot have the same tools for processing edge information as the inter-frame image, which reduces the encoding and decoding efficiency of the video sequence. Summary of the invention
[0004] The embodiments of the present application provide an intra-frame prediction method, an encoder, a decoder, and a computer storage medium, which can improve the encoding and decoding efficiency of video sequences.
[0005] The technical solution of the embodiment of the present application can be implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides an intra-frame prediction method, which is applied to an encoder. The method includes:
[0007] Determining prediction mode parameters for the current block;
[0008] When the prediction mode parameter indicates that the non-rectangular block copying (INBC) mode is used, 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;
[0009] 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;
[0010] Determining a first weight value of the first partition and a second weight value of the second partition;
[0011] The first prediction value, the first weight value, the second prediction value and the second weight value are used for weighted fusion to determine the intra-frame prediction value of the current block.
[0012] In a second aspect, an embodiment of the present application provides an intra-frame prediction method, which is applied to a decoder, and the method includes:
[0013] Parse the bitstream and obtain the prediction mode parameters of the current block;
[0014] When the prediction mode parameter indicates that the INBC mode is used, parsing the bitstream to obtain the first block vector index number and the second block vector index number;
[0015] Based on the block vector candidate list, determine first target block vector information of a first partition of the 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;
[0016] 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;
[0017] Determining a first weight value of the first partition and a second weight value of the second partition;
[0018] The first prediction value, the first weight value, the second prediction value and the second weight value are used for weighted fusion to determine the intra-frame prediction value of the current block.
[0019] In a third aspect, an embodiment of the present application provides an encoder, the encoder comprising a first determination unit, a first calculation unit and a first prediction unit; wherein,
[0020] The first determining unit is configured to determine a prediction mode parameter of a current block;
[0021] The first determining 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 to use the INBC mode;
[0022] 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 determine a first weight value of the first partition and a second weight value of the second partition;
[0023] The first prediction unit is configured to perform weighted fusion using the first prediction value, the first weight value, the second prediction value and the second weight value to determine the intra-frame prediction value of the current block.
[0024] In a fourth aspect, an embodiment of the present application provides an encoder, the encoder comprising a first memory and a first processor; wherein:
[0025] A first memory, for storing a computer program that can be run on the first processor;
[0026] The first processor is configured to execute the method according to the first aspect when running the computer program.
[0027] In a fifth aspect, an embodiment of the present application provides a decoder, the decoder comprising a parsing unit, a second determining unit, a second calculating unit, and a second predicting unit; wherein,
[0028] The parsing unit is configured to parse the bitstream to obtain a prediction mode parameter of the current block; and is further configured to parse the bitstream to obtain a first block vector index number and a second block vector index number when the prediction mode parameter indicates that the INBC mode is used;
[0029] The second determining unit is configured to determine, based on the block vector candidate list, first target block vector information of a first partition of the 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;
[0030] 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 determine a first weight value of the first partition and a second weight value of the second partition;
[0031] The second prediction unit is configured to perform weighted fusion using the first prediction value, the first weight value, the second prediction value and the second weight value to determine the intra-frame prediction value of the current block.
[0032] In a sixth aspect, an embodiment of the present application provides a decoder, the decoder comprising a second memory and a second processor; wherein:
[0033] A second memory for storing a computer program that can be run on a second processor;
[0034] The second processor is used to execute the method described in the second aspect when running the computer program.
[0035] In a seventh aspect, an embodiment of the present application provides a computer storage medium storing a computer program, wherein the computer program implements the method described in the first aspect when executed by a first processor, or implements the method described in the second aspect when executed by a second processor.
[0036] The embodiment of the present application provides an intra-frame prediction method, an encoder, a decoder and a computer storage medium. On the encoder side, a prediction mode parameter of a current block is determined; when the prediction mode parameter indicates the use of the INBC mode, 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; a first prediction value of the first partition is determined according to the first target block vector information, and a second prediction value of the second partition is determined according to the second target block vector information; a first weight value of the first partition and a second weight value of the second partition are determined; and the first prediction value, the first weight value, the second prediction value and the second weight value are used for weighted fusion to determine the intra-frame prediction value of the current block. At the decoder side, by parsing the bitstream, a prediction mode parameter of the current block is obtained; when the prediction mode parameter indicates that the INBC mode is used, the bitstream is parsed to obtain a first block vector index number and a second block vector index number; based on a block vector candidate list, first target block vector information of a first partition of the 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 are determined; a first prediction value of the first partition is determined according to the first target block vector information, and a second prediction value of the second partition is determined according to the second target block vector information; a first weight value of the first partition and a second weight value of the second partition are determined; and the first prediction value, the first weight value, the second prediction value and the second weight value are weightedly fused to determine an intra-frame prediction value of the current block. In this way, using different angle weights to process the boundary information in the image block in intra-frame prediction can better process the edge information of two parts with different texture / color distributions in the same divided block, the sharp edges of objects in the intra-frame image, the junction of the foreground and the background, and the boundary information of ordinary sequences, etc., so that the intra-frame image has a tool for processing edge information like the inter-frame image, thereby effectively improving the encoding and decoding efficiency of the video sequence. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of eight angles supported by an angle-weighted prediction mode provided in the related art;
[0038] Figure 2A schematic diagram of reference weight configuration supported by an angle-weighted prediction mode provided for related technologies;
[0039] Figure 3A A schematic diagram of angle numbers and corresponding partitions in an angle weighted prediction mode provided by the related technology;
[0040] Figure 3B A schematic diagram of angle numbers and corresponding slopes in an angle weighted prediction mode provided by the related technology;
[0041] Figure 4 A schematic diagram of the position relationship between a current block and adjacent blocks provided for related technologies;
[0042] Figure 5 A structural diagram of an application of IBC technology provided for related technologies;
[0043] Figure 6 A schematic diagram of local features with boundary information in a common sequence provided for related technologies;
[0044] Fig. 7A A block diagram of a video encoding system provided in an embodiment of the present application;
[0045] Figure 7B A block diagram of a video decoding system provided in an embodiment of the present application;
[0046] Figure 8 A schematic diagram of a flow chart of an intra-frame prediction method provided in an embodiment of the present application;
[0047] Fig. 9 A schematic diagram of a flow chart of another intra-frame prediction method provided in an embodiment of the present application;
[0048] Fig.10 A schematic diagram of the structure of an encoder provided in an embodiment of the present application;
[0049] Fig.11 A schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;
[0050] Fig.12 A schematic diagram of the structure of a decoder provided in an embodiment of the present application;
[0051] Fig.13 A schematic diagram of the specific hardware structure of a decoder provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.
[0053] In a video image, a first image component, a second image component, and a third image component are generally used to represent a coding block (CB); wherein the three image components are a brightness component, a blue chroma component, and a red chroma component. Specifically, the brightness component is usually represented by the symbol Y, the blue chroma component is usually represented by the symbol Cb or U, and the red chroma component is usually represented by the symbol Cr or V; thus, a video image can be represented in the YCbCr format or in the YUV format.
[0054] In the embodiment of the present application, the first image component may be a brightness component, the second image component may be a blue chrominance component, and the third image component may be a red chrominance component, but this is not specifically limited here.
[0055] At present, with the increasing requirements for video display quality, when encoding high-quality videos with one or more characteristics of high resolution, high frame rate, high bit depth, high dynamic range, wide color gamut and omnidirectional viewing angle, the performance of H.266 / Versatile Video Coding (VVC) is improved by about 50% compared with the H.265 / High Efficiency Video Coding (HEVC) standard. The Joint Video Experts Team (JVET) is responsible for the standardization project. Various intra-frame prediction modes and inter-frame prediction modes have been verified to achieve high compression efficiency when encoding high-quality videos, and therefore have been adopted in VVC.
[0056] In order to capture more detailed edge directions in the video, the Angular Weighted Prediction (AWP) mode is proposed in the video coding standard. By using the idea of intra-frame angle prediction, the reference weight value of the surrounding position of the current block (including integer pixel position and sub-pixel position) can be set first, and then the weight value corresponding to each pixel position can be obtained by the angle prediction method, and then the obtained weight value can be used to realize the weighting of the prediction values between two different frames.
[0057] The minimum block size supported by the angle weighted prediction mode is 8×8, and the maximum block size is 64×64. A total of 8 angles are supported, and the absolute values of the weighted prediction slopes of these 8 angles are five, namely {horizontal (HOR), vertical (VER), 1, 2, 1 / 2}. Since each angle can support 7 reference weight configurations, for each block, the angle weighted prediction mode has a total of 56 modes. See Figure 1 , which shows a schematic diagram of eight angles supported by an angle weighted prediction mode provided by the related art. Figure 1 In the figure, the eight diagonal lines with arrows represent the eight supported angles.
[0058] See also Figure 2 , which shows a schematic diagram of a reference weight configuration supported by an angle weighted prediction mode provided by the related art. Figure 2 In it, 7 prediction positions of reference weights are provided. Specifically, the reference weight configuration can be a distribution function of the reference weight value obtained according to the reference weight index value, and a non-strictly monotonically increasing function is assigned with the 8-equally divided point position of the reference weight effective length as the reference point. Here, the reference weight effective length can be calculated from the prediction angle and the current block size.
[0059] It should be understood that Figure 1 The 8 angles shown can be divided into 4 areas, such as Figure 3A As shown, it shows a schematic diagram of angle numbers and corresponding partitions in an angle weighted prediction mode provided by the related art. Figure 3A In the figure, the left-hand slash fills the angle partition 0, which includes two angles: angle 0 and angle 1; the grid slash fills the angle partition 1, which includes two angles: angle 2 and angle 3; the dot fills the angle partition 2, which includes two angles: angle 4 and angle 5; the right-hand slash fills the angle partition 3, which includes two angles: angle 6 and angle 7. Figure 3B As shown, it shows a schematic diagram of angle numbers and corresponding slopes in an angle weighted prediction mode provided by the related art. Figure 3B In the figure, angle 0 corresponds to a slope of 1, angle 1 corresponds to a slope of 1 / 2, angle 2 corresponds to a horizontal slope, angle 3 corresponds to a slope of -1 / 2, angle 4 corresponds to a slope of -1, angle 5 corresponds to a slope of -2, angle 6 corresponds to a vertical slope, and angle 7 corresponds to a slope of 2.
[0060] It should be noted that the formula for deriving pixel-by-pixel weights is slightly different depending on the partition area where the angle is located. Assume that the block size of the current block is M×N, where M is the width, N is the height, X is log2 (the absolute value of the slope of the weighted prediction angle), and Y is the weighted prediction position.
[0061] The following describes the angle 0 and angle 1 in angle partition 0 as an example, and the derivation process of the weight value is as follows:
[0062] (a) For the weight value of the brightness component,
[0063] First, calculate the reference weight effective length, which can be expressed as ValidLength, as shown below:
[0064] ValidLength=(N+(M>>X))<<1 (1)
[0065] Next, set the reference weight value, expressed as ReferenceWeights[x], where the value range of x is 0 to (ValidLength-1). Here,
[0066] FirstPos=(ValidLength>>1)-6+Y×((ValidLength-1)>>3) (2)
[0067] ReferenceWeights[x]=Clip3(0, 8, x-FirstPos) (3)
[0068] Again, the brightness weight derived pixel by pixel is represented by SampleWeight[x][y], as follows:
[0069] SampleWeight[x][y]=ReferenceWeights[(y<<1)+((x<<1)>>X)] (4)
[0070] (b) For the weight value of the chrominance component,
[0071] The chromaticity weight can be derived directly from the upper left corner of the corresponding 2×2 brightness weight. Assuming that the block size of the current block is M×N, where M is the width and N is the height, the value range of x is 0 to (M / 2-1); the value range of y is 0 to (N / 2-1). The chromaticity weight derived pixel by pixel is represented by SampleWeightChroma[x][y], as follows:
[0072] SampleWedghtChroma[x][y]=SampleWedght[x>>1][y>>1] (5)
[0073] Here, “>>” represents the right shift operator, “<<” represents the left shift operator, and Clip3 represents the positional embedding operator, which embeds x-FirstPos between 0 and 8.
[0074] It should also be noted that the motion vector storage scheme of the angle weighted prediction mode is related to the angle partition. Here, it is assumed that the block size of the current block is M×N, where M is the width, N is the height, X is log2 (the absolute value of the weighted prediction angle slope), and Y is the weighted prediction position. Taking angle 0 and angle 1 located in angle partition 0 as an example, the motion vector storage scheme is as follows:
[0075] First, calculate the reference weight effective length, represented by ValidLenth, as shown below:
[0076] ValidLength=(N+(M>>X))<<1 (6)
[0077] Secondly, for each 4×4 block in the current block, mark its center position as (x, y), then
[0078] FirstPos=(ValidLength>>1)-6+Y×((ValidLength-1)>>3) (7)
[0079] Again, determine whether (y<<1)+((x<<1)>>X) is greater than or equal to FirstPos. If (y<<1)+((x<<1)>>X) is greater than or equal to FirstPos, the first motion information is stored; otherwise, the second motion information is stored. Here, the current block will be divided into two partitions (such as the first partition and the second partition) using the angle prediction weighting mode, wherein the first motion information refers to the motion information corresponding to the first partition, and the second motion information refers to the motion information corresponding to the second partition.
[0080] In addition, the angle weighted prediction mode requires two unidirectional motion vectors for weighted prediction. The unidirectional motion vector can be selected from the candidate motion vector list according to the index number in the bitstream. Figure 4 , which shows a schematic diagram of the position relationship between a current block and adjacent blocks provided by the related art. Figure 4 As shown, the current block is filled with white and the adjacent blocks are filled with gray. Here, for the current block, there may be multiple adjacent blocks, such as A, B, C, D, F, G.
[0081] based on Figure 4 ,The process of constructing the candidate motion vector list is as follows,
[0082] In the first step, F, G, C, A, and D are adjacent blocks of the current block, and the "availability" of F, G, C, A, and D needs to be determined:
[0083] i) If F exists and uses inter-frame prediction mode, then F is "available"; otherwise, F is "unavailable".
[0084] j) If G exists and uses inter-frame prediction mode, G is "available"; otherwise, G is "unavailable".
[0085] k) If C exists and uses inter-frame prediction mode, C is "available"; otherwise, C is "unavailable".
[0086] l) If A exists and uses inter-frame prediction mode, A is "available"; otherwise, A is "unavailable".
[0087] n) If D exists and uses inter-frame prediction mode, D is "available"; otherwise, D is "unavailable".
[0088] In the second step, the motion vectors of these adjacent blocks are checked for duplication and put into the candidate motion vector list in the order of F, G, C, A and D. The checking scheme is: check for duplication between G and F, check for duplication between C and G, check for duplication between A and F, check for duplication between D and G and A. If the number of motion vectors put into the candidate motion vector list after checking for duplication is greater than 4, only the first four are put into the list.
[0089] The third step is to put the derived time-domain bidirectional motion vector into a candidate motion vector list.
[0090] In the fourth step, if the number of motion vectors in the candidate motion vector list is less than 5, the first motion vector is scaled in different directions, and then the scaled motion vector is filled into the candidate motion vector list until the number of motion vectors in the candidate motion vector list is 5.
[0091] It can be understood that according to the characteristics of the screen content, for screen content sequences such as text and graphics, there are many repeated textures in the same frame, that is, there is a strong spatial correlation. At this time, if the encoded block in the current frame can be referenced when encoding the current block, the encoding efficiency will be greatly improved. Specifically, in view of the strong spatial correlation of screen images, this technology that refers to the encoded block in the current frame and uses it for the current block prediction value can be called Intra Block Copy (IBC) technology. Here, IBC is similar to inter-frame prediction, except that the prediction block of IBC is generated by the reconstructed block in the current image frame.
[0092] See also Figure 5 , which shows a structural diagram of an application of IBC technology provided by the related art. Figure 5As shown, for the current image frame, that is, a coding tree unit (CTU), the dot-filled area in the CTU is the search area (that is, the encoded area of the current image frame), and the black shadow blocks are the current coding block (CU) and the matching prediction block (Block Predictor, also called reference block). The distance from the current coding block to the matching reference block is called the block vector (BV). Since the current block in the lower right is very similar to the encoded reference block in the upper left, if the position of the reference block in the upper left is found by searching on the encoder side, only the position vector (BV) between the two blocks needs to be transmitted in the bitstream, and the decoder can obtain accurate prediction values through this information later. Compared with the ordinary intra-frame prediction mode, IBC technology can better utilize the redundant information within the frame to improve the coding performance.
[0093] However, in the related art, the IBC technology can be used to predict repeated / cyclic local image features and applied to screen content coding, but it copies the entire reference block and does not take into account the boundary information of some local image features, such as Figure 6 In addition, the IBC technology is currently only used in screen content coding (Screen Content Coding, SCC), which limits the coding efficiency of the IBC technology and its application in ordinary sequences. However, for the AWP technology, it can process boundary information when applied to inter-frame images, but it is not applied to the processing of intra-frame blocks, resulting in the inability to make intra-frame images have the same tools for processing edge information as inter-frame images, which reduces the encoding and decoding efficiency of video sequences.
[0094] Based on this, an embodiment of the present application provides an intra-frame prediction method, the basic idea of which is: determining the prediction mode parameters of the current block; when the prediction mode parameters indicate the use of the INBC mode, 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; determining the first prediction value of the first partition according to the first target block vector information, and determining the second prediction value of the second partition according to the second target block vector information; determining the first weight value of the first partition and the second weight value of the second partition; using the first prediction value, the first weight value, the second prediction value and the second weight value for weighted fusion to determine the intra-frame prediction value of the current block. In this way, using different angle weightings to process the boundary information in the image block in intra-frame prediction can better process the edge information of two parts with different textures / color distributions in the same partition block, the sharp edge of objects in the intra-frame image, the junction of the foreground and the background, and the boundary information of the ordinary sequence, so that the intra-frame image has a tool for processing edge information like the inter-frame image, thereby effectively improving the encoding and decoding efficiency of the video sequence.
[0095] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0096] See also Fig. 7A , which shows an example of a block diagram of a video encoding system provided by an embodiment of the present application. Fig. 7AAs shown, the video coding system 10 includes a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame 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 and a decoded image cache unit 110, etc., wherein the filtering unit 108 can implement deblocking filtering and sample adaptive offset (Sample Adaptive Offset, SAO) filtering, and the coding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (Context-based Adaptive Binary Arithmatic Coding, CABAC). For the input original video signal, through the coding tree block (Coding A video coding block can be obtained by dividing the video coding block into a plurality of blocks (CTUs) by a plurality of tree units (CTUs). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by a transform and quantization unit 101, including transforming the residual information from a pixel domain to a transform domain, and quantizing the obtained transform coefficients to further reduce the bit rate. An intra-frame estimation unit 102 and an intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block. Specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine an intra-frame prediction mode to be used for encoding the video coding block. A motion compensation unit 104 and a motion estimation unit 105 are used to perform inter-frame prediction coding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information. The motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector, which can estimate the motion of the video coding block. Then, the motion compensation unit 104 calculates the motion vector based on the motion vector determined by the motion estimation unit 105. The motion vector performs motion compensation; after determining the intra-frame prediction mode, the intra-frame prediction unit 103 is also used to provide the selected intra-frame prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block, reconstruct the residual block in the pixel domain, and the reconstructed residual block is removed by the filter control analysis unit 107 and the filtering unit 108. The block effect artifacts are then removed, and the reconstructed residual block is then added to a predictive block in the frame of the decoded image cache unit 110 to generate a reconstructed video coding block; the encoding unit 109 is used to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-frame prediction mode and output the code stream of the video signal; the decoded image cache unit 110 is used to store the reconstructed video coding block for prediction reference.As the video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoded image buffer unit 110 .
[0097] See also Figure 7B , which shows an example of a block diagram of a video decoding system provided by an embodiment of the present application. Figure 7B As shown, the video decoding system 20 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206, etc., wherein the decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. The input video signal is Fig. 7A After the encoding process, the code stream of the video signal is output; the code stream is input into the video decoding system 20, and first passes through the decoding unit 201 to obtain the decoded transform coefficient; the transform coefficient is processed by the inverse transform and inverse quantization unit 202 to generate a residual block in the pixel domain; the intra-frame prediction unit 203 can be used to generate prediction data of the current video decoding block based on the determined intra-frame prediction mode and the data of the previously decoded block from the current frame or picture; the motion compensation unit 204 determines the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses the prediction information The decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 and the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal is passed through the filtering unit 205 to remove the block effect artifacts, which can improve the video quality; the decoded video block is then stored in the decoded image cache unit 206, which stores the reference image used for subsequent intra-frame prediction or motion compensation, and is also used for the output of the video signal, that is, the restored original video signal is obtained.
[0098] It should be noted that the intra-frame prediction method in the embodiment of the present application is mainly used in Fig. 7A The intra-frame prediction unit 103 shown in FIG. Figure 7B In other words, the intra-frame prediction method in the embodiment of the present application can be applied to both the video encoding system and the video decoding system, or even to both the video encoding system and the video decoding system at the same time, but the embodiment of the present application does not specifically limit this. It should also be noted that when the intra-frame prediction method is applied to Fig. 7A In the intra-frame prediction unit 103 shown in FIG. 1 , the “current block” specifically refers to the current coding block in the intra-frame prediction; when the intra-frame prediction method is applied to Figure 7BWhen the intra prediction unit 203 is shown, the "current block" specifically refers to the current decoded block in the intra prediction.
[0099] It should also be noted that before elaborating in detail, the "first", "second", "third", etc. mentioned throughout the specification are only for distinguishing different features and do not have the function of limiting priority, order, size relationship, etc.
[0100] In one embodiment of the present application, the intra-frame prediction method provided in the embodiment of the present application is applied to a video encoding device, that is, an encoder. The function implemented by the method can be implemented by calling a computer program by a first processor in the encoder, and of course the computer program can be stored in a first memory. It can be seen that the encoder includes at least a first processor and a first memory.
[0101] Based on the above Fig. 7A For an example of an application scenario, see Figure 8 , which shows a schematic flow chart of an intra-frame prediction method provided by an embodiment of the present application. Figure 8 As shown, the method may include:
[0102] S801: Determine prediction mode parameters of the current block.
[0103] It should be noted that the video image can be divided into multiple image blocks, and each image block currently to be encoded can be called a coding block (Coding Block, CB). Here, each coding block may include a first image component, a second image component, and a third image component; and the current block is a coding block in the video image that is currently to be predicted for the first image component, the second image component, or the third image component.
[0104] Among them, assuming that the current block predicts the first image component, 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 can also be called a luminance block; or, assuming that the current block predicts the second image component, and the second image component is a chrominance component, that is, the image component to be predicted is a chrominance component, then the current block can also be called a chrominance block.
[0105] It should also be noted that the prediction mode parameters are used to indicate the prediction mode used by the current block and the parameters related to the prediction mode. Generally, the prediction mode parameters can be determined based on the size of the distortion value. In a specific embodiment, it can be determined based on the cost result of rate distortion optimization (RDO), or based on the cost result of the sum of absolute difference (SAD), or even based on the cost result of the sum of absolute transformed difference (SATD); however, this embodiment of the present application does not impose any limitation.
[0106] In some embodiments, determining the prediction mode parameters of the current block may include:
[0107] Precoding the current block based on multiple candidate prediction modes, and determining precoding results corresponding to the multiple candidate prediction modes;
[0108] According to the pre-encoding result, a prediction mode parameter of the current block is determined from the multiple candidate prediction modes.
[0109] In a specific embodiment, determining the prediction mode parameter of the current block from the multiple candidate prediction modes according to the precoding result may include:
[0110] Based on the precoding result, obtaining rate-distortion cost results corresponding to the multiple candidate prediction modes;
[0111] An optimal rate-distortion cost result is selected from the rate-distortion cost results, and a candidate prediction mode corresponding to the optimal rate-distortion cost result is determined as a prediction mode parameter of the current block.
[0112] It should be noted that the multiple candidate prediction modes here may refer to intra-frame prediction modes, and the current block is pre-encoded according to the multiple candidate prediction modes, and the pre-coding results corresponding to the multiple candidate prediction modes can be determined. Among them, the pre-coding result can be the distortion value corresponding to the candidate prediction mode (or called encoding mode), or it can be the rate-distortion cost result corresponding to the candidate prediction mode, or even other cost results corresponding to the candidate prediction mode, such as SAD cost result, SATD cost result, etc. Exemplarily, after the rate-distortion cost results corresponding to the multiple candidate prediction modes are obtained according to the pre-coding results, the optimal rate-distortion cost result can 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.
[0113] It should also be noted that the embodiment of the present application proposes an Intra Non-rectangle Block Copy (INBC) mode, which combines the Intra Block Copy (IBC) technology with the Angular Weighted Prediction (AWP) technology. Among them, the IBC technology can be used to predict repeated / cyclic local image features and applied to screen content encoding; the AWP technology is applied to process boundary information in inter-frame images. In this way, the purpose of proposing the INBC mode in the embodiment of the present application is to expect that INBC can better process the edge information of two parts with different textures / color distributions in the same divided block, the sharp edges of objects in the intra-frame image, the junction of the foreground and the background, and the boundary information, etc., so that the intra-frame image also has a tool for processing edge information like the inter-frame image, thereby effectively improving the encoding and decoding efficiency of the video sequence.
[0114] That is to say, the multiple candidate prediction modes here may include INBC mode and normal intra mode. Among them, the normal intra mode may include angle prediction mode, position-dependent intra prediction combination (PDPC) mode, matrix-based intra prediction (MIP) mode, etc. In this way, the multiple candidate prediction modes may include INBC mode and normal intra mode. At this time, the INBC mode will compete with the normal intra mode to determine the prediction mode parameters of the current block.
[0115] In some embodiments, determining the prediction mode parameters of the current block may include:
[0116] If the prediction mode parameter indicates to use the INBC mode, setting the INBC mode flag bit to a first value;
[0117] If the prediction mode parameter indicates to use the normal intra mode, the INBC mode flag is set to a second value.
[0118] It should be noted that when the INBC mode flag is set to the first value, it is determined that the current block uses the INBC mode for intra-frame prediction; when the INBC mode flag is set to the second value, it is determined that the current block uses the normal intra-frame mode for intra-frame prediction.
[0119] It should also be noted that, in a specific implementation, the first value may be 1, and the second value may be 0; or, the first value may be true, and the second value may be false. In another specific implementation, the first value may be 0, and the second value may be 1; or, the first value may be false, and the second value may be true.
[0120] In this way, taking the first value being 1 and the second value being 0 as an example, in the encoder, if the prediction mode parameter indicates the use of the INBC mode, the INBC mode flag can be set to 1, and the INBC mode is used to determine the intra-frame prediction value of the current block; if the prediction mode parameter indicates that the INBC mode is not used, the INBC mode flag can be set to 0, and the normal intra-frame mode is used to determine the intra-frame prediction value of the current block.
[0121] Furthermore, in some embodiments, after determining the INBC mode flag, the method may further include:
[0122] The INBC mode flag is written into the bit stream.
[0123] That is to say, the encoder can also write the INBC mode flag into the bitstream. In this way, on the decoder side, the prediction mode parameters of the current block, that is, the prediction mode used by the current block, can be determined by parsing the bitstream.
[0124] It can be understood that the INBC mode provided in the embodiment of the present application is one of a plurality of candidate angle division modes. In some embodiments, the method may further include:
[0125] Determine three target candidate angle division modes from a plurality of candidate angle division modes;
[0126] Performing intra-frame prediction on the current block using the three target candidate angle division modes, and determining prediction cost results corresponding to the three target candidate angle division modes;
[0127] Based on the prediction cost result, the INBC mode used by the current block is determined from the three target candidate angle division modes.
[0128] Generally speaking, there are 56 candidate angle division modes, which are currently expanded to 65 modes in VVC. Among these multiple candidate angle division modes, three target candidate angle division modes can be determined. These three target candidate angle division modes are used as alternatives, and the three target candidate angle division modes are used to perform intra-frame prediction on the current block to determine the 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 these three target candidate angle division modes.
[0129] In a specific embodiment, determining the INBC mode used by the current block from the three target candidate angle division modes based on the prediction cost result may include:
[0130] Based on the prediction cost result, obtaining rate-distortion cost results corresponding to the three target candidate angle division modes;
[0131] An optimal rate-distortion cost result is selected from the rate-distortion cost results, and a target candidate angle division mode corresponding to the optimal rate-distortion cost result is determined as the INBC mode used by the current block.
[0132] It should be noted that the preset rate-distortion model can be regarded as a function of the relationship between the distortion value, the bit rate and the Lagrange multiplier. Assuming that the distortion value is represented by D, the bit rate is represented by R, and the Lagrange multiplier is represented by λ, then the preset rate-distortion model can be shown as formula (8):
[0133] J=D+λ·R (8)
[0134] Wherein, J represents the rate-distortion cost result. Here, for the calculation of the rate-distortion cost result, no matter what prediction mode is used, the calculation process is the same. The embodiment of the present application takes the first rate-distortion cost result of the current block under one of the target candidate angle division modes as an example for explanation. Specifically, the target candidate angle division mode is used to perform intra-frame prediction on the current block to obtain the first prediction value of the current block; then, based on the first prediction value of the current block and the true value of the current block, the mean square error (MSE) can be used to calculate the first distortion value of the current block (expressed as D1); at this time, assuming that the bit rate R is 1, the preset rate-distortion model shown in formula (8) can be used to calculate the first rate-distortion cost result under the target candidate angle division mode (expressed as RDC1), recorded as RDC1=D1+λ. Similarly, the second rate-distortion cost result (expressed as RDC2) and the third rate-distortion cost result (expressed as RDC3) under the other two target candidate angle division modes can also be calculated, and the optimal rate-distortion cost result is selected from RDC1, RDC2 and RDC3 to determine the target candidate angle division mode corresponding to the optimal rate-distortion cost result as the INBC mode used by the current block.
[0135] Further, regarding the determination of three target candidate angle division modes, in some embodiments, determining three target candidate angle division modes from a plurality of candidate angle division modes may include:
[0136] Pre-encoding the current block based on the multiple candidate angle division modes, and determining pre-encoding results corresponding to the multiple candidate angle division modes;
[0137] Based on the precoding result, the three target candidate angle division modes are determined from the multiple candidate angle division modes.
[0138] In a specific embodiment, determining the three target candidate angle division modes from the multiple candidate angle division modes based on the precoding result may include:
[0139] Based on the precoding result, obtaining SATD cost results corresponding to the multiple candidate angle division modes;
[0140] Three relatively better SATD cost results are selected from the SATD cost results, and the candidate angle division modes corresponding to the three SATD cost results are determined as the three target candidate angle division modes.
[0141] It should be noted that, for the multiple candidate angle division modes, three target candidate angle division modes can be selected according to the Sum of Absolute Transformed Difference (SATD) cost result to perform rate-distortion cost calculation.
[0142] That is to say, after pre-encoding the current block using multiple candidate angle division modes and determining the pre-coding results corresponding to these multiple candidate angle division modes, the SATD cost results corresponding to these multiple candidate angle division modes can be obtained based on the pre-coding results; then, three relatively better SATD cost results are selected from the SATD cost results, and the candidate angle division modes corresponding to the selected three SATD cost results are determined as the three target candidate angle division modes.
[0143] Specifically, in some embodiments, the precoding the current block based on the multiple candidate angle division modes and determining the precoding results corresponding to the multiple candidate angle division modes may include:
[0144] Based on a plurality of candidate angle partition modes, determine a first partition and a second partition of the current block under each candidate angle partition mode;
[0145] Determine first target block vector information of the first partition and second target block vector information of the second partition under each candidate angle division mode;
[0146] The current block is pre-encoded according to the first target block vector information of the first partition and the second target block vector information of the second partition under each candidate angle partition mode to obtain pre-coding results corresponding to the multiple candidate angle partition modes.
[0147] It should be noted that by dividing the current block based on each candidate angle division mode, the first partition and the second partition of the current block under the candidate angle division mode can 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 under the candidate angle division mode, the current block can be pre-encoded according to the first target block vector information of the first partition and the second target block vector information of the second partition under each candidate angle division mode, so as to obtain pre-coding results corresponding to multiple candidate angle division modes.
[0148] It should also be noted that, with respect to 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 the use of the INBC mode, the method may further include:
[0149] constructing a block vector candidate list, the block vector candidate list comprising at least one block vector;
[0150] For the candidate angle partition mode, traverse at least one block vector in the block vector candidate list, and calculate a SAD cost result corresponding to the at least one block vector by the first partition and a SAD cost result corresponding to the at least one block vector by the second partition;
[0151] The optimal SAD cost result is selected from the first SAD cost results, and the block vector corresponding to the optimal SAD cost result is determined as the first target block vector information of the first partition; and the optimal SAD cost result is selected from the second SAD cost result, and the block vector corresponding to the optimal SAD cost result is determined as the second target block vector information of the second partition.
[0152] In this way, based on multiple candidate angle division modes (such as 56 candidate angle division modes), after determining the optimal block vector (i.e., the first target block vector information) of the first partition and the optimal block vector (i.e., the second target block vector information) of the second partition under each candidate angle division mode according to the SAD cost, the precoding results corresponding to the multiple candidate angle division modes are determined by precoding the current block; then, the SATD cost results corresponding to the multiple candidate angle division modes can be obtained according to the precoding results, and three relatively superior SATD cost results are selected from the SATD cost results, and the candidate angle division modes corresponding to the selected three SATD cost results are determined as the three target candidate angle division modes. Further, after performing intra-frame prediction on the current block using the three target candidate angle division modes, the rate-distortion cost results corresponding to the three target candidate angle division modes can be obtained; then, the optimal rate-distortion cost result is selected from the obtained rate-distortion cost results, and the target candidate angle division mode corresponding to the optimal rate-distortion cost result is determined as the INBC mode used by the current block.
[0153] In this way, after the prediction mode parameters of the current block are determined, the current block can be encoded using the determined prediction mode, thereby making the prediction residual smaller and improving the encoding efficiency.
[0154] S802: When the prediction mode parameter indicates to use the INBC mode, 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.
[0155] It should be noted that when the prediction mode parameter indicates to use the INBC mode, the current block is divided based on the INBC mode to obtain at least two partitions, wherein the at least two partitions may be a first partition and a second partition.
[0156] It should also be noted that when the prediction mode parameter indicates that the INBC mode is used, a block vector candidate list (Block Vector Prediction, BVP) needs to be constructed at this time 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 also include:
[0157] A block vector candidate list is constructed, wherein the block vector candidate list includes at least one block vector.
[0158] Here, for the block vector candidate list, in a specific embodiment, the building block vector candidate list may include:
[0159] Obtain historical block vector prediction information;
[0160] The block vector candidate list is determined based on the historical block vector prediction information.
[0161] That is to say, the block vector candidate list can be determined based on the history block vector prediction information (History based Block Vector Prediction, HBVP). Among them, the HBVP technology specifically copies 8 motion information candidates from the previously encoded block to the first-in-first-out queue (First Input First Output, FIFO), and the FIFO is kept 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, then the duplicate motion information candidate will be removed first, and then the motion information of the current coding unit will be added to 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, then the first candidate in the FIFO will be removed, and then the latest motion information will be added to the end of the FIFO to ensure that the 8 latest motion information candidates are always retained in the FIFO. The motion information candidates in the HBVP are identified together with the existing motion information candidates in the second-generation AVS standard (abbreviated as AVS2) proposed by the Audio Video coding Standard Workgroup of China (AVS), and binarized using a unary method. AVS2 contains five motion information candidates, but the symmetric mode is removed in the third generation AVS standard (abbreviated as AVS3), leaving only 4 motion information candidates, plus the 8 candidates in HBVP, a total of up to 12 motion information candidates. In short, HBVP stores the block vectors of the encoded IBC coding blocks in a historical block vector information cache, which has a maximum storage capacity of 12, so that historical block vector prediction information can be obtained.
[0162] In a more specific embodiment, determining the block vector candidate list based on the historical block vector prediction information may include:
[0163] If the size parameter of the encoded block is greater than or greater than the preset size parameter, storing the block vector of the encoded block at the zeroth position of the block vector candidate list; and
[0164] If the number of times that the coded block appears in the historical block vector prediction information is greater than or equal to a preset number, storing the block vector of the coded block at the first position of the block vector candidate list; and
[0165] The block vectors of the left coded neighboring block, the upper coded neighboring block, the upper left coded neighboring block, the upper right coded neighboring block and the lower left coded neighboring block of the current block are stored in the second, third, fourth, fifth and sixth positions of the block vector candidate list respectively;
[0166] The block vector candidate list is obtained based on the block vectors stored at the zeroth, first, second, third, fourth, fifth and sixth positions in the block vector candidate list.
[0167] It should be noted that a maximum of 7 block vectors are stored in the block vector candidate list (BVP); wherein the i-th block vector candidate list can be represented by cbvp_cands[i], where i=0, 1, 2, ..., 6.
[0168] That is, a BV can be allocated from the acquired historical block vector prediction information as one of the candidate BVPs (cbvp_cands[i], with a maximum of 7 BVs stored).
[0169] The BV of the coded block size parameter W×H≥64 is cached to cbvp_cands[0];
[0170] The BVs of the coded blocks that appear ≥ 2 times in the historical block vector prediction information are cached to cbvp_cands[1];
[0171] The BVs of the neighboring blocks of the coded block to the left, top, top-left, top-right, and bottom-left of the current block are cached in cbvp_cands[2], cbvp_cands[3], cbvp_cands[4], cbvp_cands[5], and cbvp_cands[6] respectively;
[0172] At this point, the block vector candidate list (cbvp_cands) is filled.
[0173] In this way, after obtaining the block vector candidate list, 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 can be determined according to the block vector candidate list. In the embodiment of the present application, if the adaptive pixel precision (Adaptive Block Vector Resolution, ABVR) is turned on, then the BV with integer pixel precision or quadruple pixel precision will be tried; otherwise, only the BV with integer pixel precision is used. The following first takes the BV with integer pixel precision as an example for detailed description.
[0174] In a specific embodiment, 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:
[0175] Based on the INBC mode, determining the first partition and the second partition after the current block is divided;
[0176] Traversing at least one block vector in the block vector candidate list, calculating a first SAD cost result corresponding to the at least one block vector by the first partition and a second SAD cost result corresponding to the at least one block vector by the second partition;
[0177] The optimal SAD cost result is selected from the first SAD cost results, and the block vector corresponding to the optimal SAD cost result is determined as the first target block vector information of the first partition; and the optimal SAD cost result is selected from the second SAD cost result, and the block vector corresponding to the optimal SAD cost result is determined as the second target block vector information of the second partition.
[0178] 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 selected for the first partition and the second partition of the current block by comparing the Sum of Absolute Difference (SAD) cost results.
[0179] In another specific embodiment, 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:
[0180] Based on the INBC mode, determining the first partition and the second partition after the current block is divided;
[0181] Establishing a preset hash table, performing intra-block copy search on the first partition and the second partition, and selecting a first block vector information matching the hash key value of the first partition and a second block vector information matching the hash key value of the second partition from the block vector candidate list;
[0182] Traversing at least one block vector in the block vector candidate list, calculating a first cost result corresponding to the first partition with respect to the at least one block vector and a second cost result corresponding to the second partition with respect to the at least one block vector;
[0183] Selecting the best cost result from the first cost result, and determining the block vector corresponding to the best cost result as the first two blocks of vector information of the first partition; and selecting the best cost result from the second cost result, and determining the block vector corresponding to the best cost result as the second two blocks of vector information of the second partition;
[0184] Determining the block vector information with the best cost result from the first block vector information and the first two blocks vector information as the first target block vector information of the first partition; and
[0185] From the second one block of vector information and the second two blocks of vector information, the block vector information with the best cost result is determined as the second target block vector information of the second partition.
[0186] It should be noted that two preset hash tables, m_hash2Pos and m_pos2Hash, are first established, and then the hit prediction reference block and BV are searched. Here, the setting of the preset search range may include:
[0187] Determine the proportion of locations where the same hash value appears more than twice;
[0188] Determining whether the determined ratio value is greater than a preset ratio value;
[0189] If the judgment result is yes, the preset search range is set to 64×64;
[0190] If the judgment result is no, the preset search range is set to 32×32.
[0191] In the embodiment of the present application, the preset ratio value can be set to 5%, but it is not specifically limited. In this way, the size range of the IBC search can be set according to whether the ratio of the position where the same Hash value appears more than twice is greater than 5%. If the judgment result is yes, it is set to 64×64; otherwise it is set to 32×32. After searching the hit prediction reference block and BV, the BV searched by Hash can be obtained (including the first block vector information of the first partition and the second block vector information of the second partition). Then try all BVs in the block vector candidate list, and select the first two block vector information of the first partition and the second two block vector information of the second partition according to the optimal cost result by calculating the cost result; compare it with the BV searched by Hash before, and select a better BV according to the cost result to obtain the final first target block vector information of the first partition and the second target block vector information of the second partition. Here, for the block vector candidate list, if multiple block vector candidate lists are constructed, then the block vector candidate list corresponding to the optimal cost result can be determined as the block vector candidate list described in the embodiment of the present application by calculating the cost result, and the corresponding index number of the block vector candidate list is stored in bvp_idx.
[0192] It should be noted that if the first target block vector information (which can be represented by BV[0]) and the second target block vector information (which can be represented by BV[1]) obtained above are both legal block vector information, that is, BV[0]≠0&&BV[1]≠0, then the motion estimation ends; if at least one of the first target block vector information and the second target block vector information obtained above is legal block vector information, that is, BV[0]=0||BV[1]=0, then it is necessary to re-determine the first target block vector information and the second target block vector information. In another specific embodiment, the determining of 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:
[0193] If at least one of the first target block vector information and the second target block vector information is illegal block vector information, a preset search range is determined; in the block vector candidate list, a pixel-by-pixel block vector search is performed on the first partition and the second partition in sequence according to the preset search range to obtain first block vector information and second block vector information;
[0194] The obtained first block vector information and second block vector information are determined as the first target block vector information and the second target block vector information.
[0195] It should be noted that the search starting point BV with SAD < 1000 is selected in the block vector candidate list (cbvp_cands), otherwise, the starting point BV can be set to (0, 0). The optimal BVP (bvpasbv_idx) is recorded, and then the BV full search process is performed, as follows:
[0196] First, set the preset search range. Then, according to the bvpasbv_idx obtained above, calculate the SAD with its corresponding BV and put it in sad_best_cand and mv_cand. Then, according to the preset search range, perform BV search and update in order at the top (bvx=0, bvy transforms pixel by pixel) and to the left (bvy=0, bvx transforms pixel by pixel); it should be noted that bvx=0, bvy=0 refers to the BV relative to the search starting point. For coding blocks with W<16&&H<16, perform another round of search to improve prediction accuracy. At this time, except for the top and left, try other BVs at integer pixel or double pixel intervals within the preset search range to select the optimal BV (i.e., the first target block vector information and the second target block vector information).
[0197] It should also be noted that after obtaining a legal block vector through hash search or full search, the flag skip_me=1 can be set, and then the cost result is calculated and the currently obtained optimal BV (ie, the first target block vector information and the second target block vector information) is stored.
[0198] In addition, in the embodiment of the present application, for the BV with four times pixel precision, BV prediction is first performed to determine a block vector candidate list; then, because the flag skip_me=1, the original motion estimation process can be skipped, and the BV obtained with integer pixel precision is still used as the optimal BV, and then the BV is adjusted to an integer multiple of four according to the four times precision requirement; finally, the cost result (such as the rate-distortion cost result) can be calculated, and the optimal BV (i.e., the first target block vector information and the second target block vector information) can be updated according to the cost result.
[0199] In some embodiments, after determining the first target block vector information and the second target block vector information, the method may further include:
[0200] 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;
[0201] Determine a second block vector index number, where the second block vector index number is used to indicate an index number corresponding to the second target block vector information in the block vector candidate list;
[0202] The first block vector index serial number and the second block vector index serial number are written into a bitstream.
[0203] That is, after obtaining the first target block vector information and the second target block vector information, the first block vector index number and the second block vector index number can be determined, and the first block vector index number and the second block vector index number are written into the bitstream. In this way, the first block vector index number and the second block vector index number are obtained by parsing the bitstream at the decoder side, and the first target block vector information and the second target block vector information can be determined in combination with the constructed block vector candidate list.
[0204] S803: 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.
[0205] It should be noted that determining the first prediction value of the first partition according to the first target block vector information may include: performing motion compensation on the first partition according to the first target block vector information to obtain the prediction value of the first partition.
[0206] It should also be noted that determining the second prediction value of the second partition according to the second target block vector information may include: performing motion compensation on the second partition according to the second target block vector information to obtain the prediction value of the second partition.
[0207] That is to say, after obtaining the first target block vector information, motion compensation can be performed on the first partition according to the first target block vector information, and the prediction value of the first partition (or called motion compensation prediction value) can be obtained; after obtaining the second target block vector information, motion compensation can be performed on the second partition according to the second target block vector information, and the prediction value of the second partition (or called motion compensation prediction value) can be obtained.
[0208] S804: Determine a first weight value of the first partition and a second weight value of the second partition.
[0209] 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 mode index number (represented by AwpIdx). In some embodiments, determining the first weight value of the first partition and the second weight value of the second partition may include:
[0210] Based on the INBC mode, determining an angle division mode index number;
[0211] According to the angle division mode index number, a mapping angle value is obtained using a first calculation model;
[0212] According to the mapping angle value, a slope classification index value is obtained using a second calculation model;
[0213] According to the mapped angle value, using a third calculation model to obtain a partition value to which the angle belongs;
[0214] Based on the slope classification index value and the partition value to which the angle belongs, a first weight value of the first partition and a second weight value of the second partition are obtained using a preset weight calculation model.
[0215] It should be noted that after determining AwpIdx, the mapping angle value (expressed by ModAngNum) can be obtained; according to ModAngNum, the slope classification index value (expressed by angleIdx) and the partition value to which the angle belongs (expressed by subAngleIdx) can be determined. In addition, both the first weight value and the second weight value can include brightness weight (expressed by AwpWeightArrayY[x][y]) and chrominance weight (expressed by AwpWeightArrayUV[x][y]).
[0216] In the embodiment of the present application, after determining AwpIdx, the intermediate value (using stepIdx), angleIdx and subAngleIdx can be obtained. The specific calculation model is as follows:
[0217] stepIdx=(AwpIdx>>3)-3 (9)
[0218] modAngNum = AwpIdx%8 (10)
[0219] Here, ">>" indicates a right shift operator, and "%" indicates a modulo operator. In addition, the value of stepIdx can be -3, -2, -1, 0, 1, 2, 3; the value of modAngNum can be 0 to 7.
[0220] Furthermore, if modAngNum is equal to 2, angleIdx=7; if modAngNum is equal to 6, angleIdx=8; otherwise, angleIdx=modAngNum%2. Specifically, it is expressed as follows:
[0221]
[0222] Among them, the value comparison table between AwpIdx, stepIdx and modAngNum is shown in Table 1.
[0223] Table 1
[0224]
[0225]
[0226] In addition, after obtaining ModAngNum, the calculation model for subAngleIdx is as follows:
[0227] subAngleIdx=modAngNum>>1 (12)
[0228] Here, the value of subAngleIdx can be 0, 1, 2, or 3.
[0229] That is to say, stepIdx and modAngNum can be obtained from AwpIdx, and the value of modAngNum determines angleIdx and subAngleIdx.
[0230] Combined with the above Figure 3A and Figure 3B The value comparison table between modAngNum and AwpIdx and subAngleIdx is shown in Table 2.
[0231] 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
[0232] In this way, the accurate mapping angle value (ModAngNum) can be obtained according to the partition value (subAngleIdx) to which the angle belongs and the slope classification index value (angleIdx).
[0233] Further, a reference weight list is configured according to relevant parameters, and the reference weight list can be represented by ReferenceWeight[x]. Here, the width of the current block is represented by M, and the height is represented by N.
[0234] ValidLength_W=(M+(N>>angleIdx))<<1
[0235] ValidLength_H=(N+(M>>angleIdx))<<1
[0236] DeltaPos_W=stepIdx*((validLength_W>>3)-1)
[0237] DeltaPos_H=stepIdx*((ValidLength_H>>3)-1)
[0238] FirstPos=(ValidLength_H>>1)-6+DeltaPos_H
[0239] ReferenceWeights[x]=Clip3(0, 8, x-FirstPos);
[0240] Among them, “>>” represents the right shift operator, “<<” represents the left shift operator, Clip3 represents the embedded operator, Clip3(0, 8, x-FirstPos) means (x-FirstPos) is embedded between 0 and 8, and the value range of x is 0 to ValidLength_H-1.
[0241] The following takes 8×8, angIdx=0, stepIdx=0 as an example, assuming that the angle division mode index number is 24, modAngNum is 0, angleIdx is 0, and subAngleIdx is 0, and the following calculation is performed:
[0242] ValidLength_W=(8+8)<<1=16*2=32
[0243] ValidLength_H=(8+8)<<1=16*2=32
[0244] DeltaPos_W=0
[0245] DeltaPos_H=0
[0246] FirstPos=16-6+0=10
[0247] ReferenceWeights[x]=Clip3(0,8,x-10); wherein, for the current block of 8×8, the value range of x is 0-31.
[0248] In this way, the brightness weight of the pixel position (x, y) in the current block is represented by AwpWeightArrayY[x][y]. The calculation formula of AwpWeightArrayY[x][y] is as follows:
[0249] AwpWeightArrayY[x][y]=ReferenceWeights[(y<<1)+((x<<1)>>angleIdx)] (13)
[0250] Among them, the value range of x is 0 to M-1; the value range of v is 0 to N-1.
[0251] Taking subAngleIdx=0, angleIdx=0 as an example, then AwpWeightArrayY[x][y]=ReferenceWeights[(2y)+(2x)].
[0252] The chrominance weight of the pixel position (x, y) in the current block is represented by AwpWeightArrayUV[x][y]. The calculation formula of AwpWeightArrayUV[x][y] is as follows:
[0253] AwpWeightArrayUV[x][y]=AwpWeightArrayY[x<<1][y<<1] (14)
[0254] Among them, the value range of x is 0~M / 2-1; the value range of y is 0~N / 2-1.
[0255] In this way, according to the brightness weight (AwpWeightArrayY[x][y]) of each pixel position in the current block and the corresponding chrominance weight AwpWeightArrayUV[x][y], the first weight value of the first partition and the second weight value of the second partition can be determined.
[0256] In addition, it should be noted that after determining the angle division mode index number, the method may further include: writing the angle division mode index number into the bitstream.
[0257] That is, after obtaining the angle division mode index number, the angle division mode index number can be written into the bitstream. In this way, the angle division mode index number can be obtained by parsing the bitstream at the decoder side to determine the first weight value of the first partition and the second weight value of the second partition.
[0258] S805: Perform weighted fusion using the first prediction value, the first weight value, the second prediction value, and the second weight value to determine an intra-frame prediction value of the current block.
[0259] It should be noted that after obtaining the first prediction value, the first weight value, the second prediction value and the second weight value, the first prediction value, the first weight value, the second prediction value and the second weight value can be weighted and fused to determine the intra-frame prediction value of the current block in the INBC mode.
[0260] This embodiment provides an intra-frame prediction method, which is applied to an encoder. By determining the prediction mode parameters of the current block; when the prediction mode parameters indicate the use of the INBC mode, 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; determining the first prediction value of the first partition according to the first target block vector information, and determining the second prediction value of the second partition according to the second target block vector information; determining the first weight value of the first partition and the second weight value of the second partition; using the first prediction value, the first weight value, the second prediction value and the second weight value for weighted fusion to determine the intra-frame prediction value of the current block. In this way, using different angle weightings to process the boundary information in the image block in the intra-frame prediction can better process the edge information of two parts with different textures / color distributions in the same partition block, the sharp edge of objects in the intra-frame image, the junction of the foreground and the background, and the boundary information of the ordinary sequence, so that the intra-frame image has a tool for processing edge information like the inter-frame image, thereby effectively improving the coding efficiency of the video sequence.
[0261] In another embodiment of the present application, the embodiment of the present application proposes an INBC intra-frame prediction technology, which combines the IBC technology with the AWP technology. Among them, the IBC technology can be used to predict repeated / cyclic local image features and applied to screen content encoding; the AWP technology is applied to process boundary information in inter-frame images. In this way, the research purpose of INBC is to expect that INBC can better process the edge information of two parts with different textures / color distributions in the same partition block, the sharp edges of objects in the intra-frame image, the junction of the foreground and the background, and the boundary information, etc., so that the intra-frame image has a tool for processing edge information like the inter-frame image, thereby effectively improving the coding efficiency of the video sequence.
[0262] Thus, in the encoder, the implementation process of the INBC mode is as follows:
[0263] The mode, motion information and flag of the CU are identified in units of 4×4 current blocks. Here, the prediction mode is encoded. In a specific implementation, when the string prediction (SP) mode is turned on, it is necessary to first encode whether it is the INBC mode, then encode whether it is the SP mode, and finally encode whether it is the IBC mode.
[0264] The encoder's intra-frame prediction steps are as follows:
[0265] (1) Derive the block vector candidate list (i.e., BVP list).
[0266] (2) Traverse the 56 partitioning patterns, traverse the BVP list for each pattern, and select the optimal BV by comparing the SAD of the two partitions for each pattern.
[0267] (3) Among the 56 partitioning modes, three modes are selected by comparing SATD to enter the rate-distortion optimization process.
[0268] (4) The three modes are combined into two partitions according to the optimal BV determined in step (1) to perform motion compensation respectively, and determine the target block vector information of each of the two partitions.
[0269] (5) Based on the target block vector information of each of the two partitions, the motion compensation prediction values of the two partitions are determined respectively.
[0270] (6) For these three modes, weighted weights are calculated based on different mode information.
[0271] (7) For these three modes, the final intra-frame prediction value of the current block is obtained through weighted fusion.
[0272] (8) For these three modes, the optimal INBC mode among them is determined through the rate-distortion optimization process.
[0273] (9) The optimal INBC mode competes with other modes (such as normal intra-frame mode).
[0274] (10) Encode relevant information of the optimal mode (flag, BV index number, etc.).
[0275] It should be noted that in the encoder, the process of rate-distortion optimization is: using the historical BV candidate list of IBC, first determine the optimal BV candidates for the two partitions of each partition in the 56 partition modes of AWP; then select the best three partition modes from the 56 partition modes, and these three partition modes perform motion compensation according to the BV of the two partitions decided in the previous step to obtain prediction values, and then the prediction values of the two partitions are weightedly fused to realize the rate-distortion optimization process, select the optimal INBC mode, and then compete with other modes (such as normal intra-frame mode).
[0276] It should also be noted that in the encoder, flags need to be set: that is, flags are set at the sequence level, frame level, and CU level to control the use of INBC. Here, the CU size limit range for applying the INBC mode is: 4×4 to 16×16.
[0277] Regarding the derivation of the BVP list in step (1), in the embodiment of the present application, if ABVR is enabled, a block vector (BV) with integer pixel precision or quadruple pixel precision will be tried, otherwise, only BV with integer pixel precision will be used. The specific process is as follows:
[0278] (a) First try BV with integer pixel accuracy.
[0279] (1.1) Using HBVP technology to predict BV
[0280] (1.1.1) HBVP technology copies 8 motion information candidates from the previous coding block to the FIFO, and the FIFO is kept 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 will be removed first, and the motion information of the current coding unit will be added to 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 will be removed, and the latest motion information will be added to the end of the FIFO to ensure that the 8 latest motion information candidates are always retained in the FIFO. The motion information candidates in HBVP are identified together with the existing motion information candidates in AVS2 and binarized using the Unary method. AVS2 contains five motion information candidates, but the symmetric mode is removed in AVS3, leaving only 4 motion information candidates, plus the 8 candidates of HBVP, a total of up to 12 candidates. In short, HBVP stores the BV of the encoded IBC coding block in a historical BV information cache, which has a maximum storage capacity of 12, so that historical block vector prediction information can be obtained.
[0281] (1.1.2) Then, according to the following properties, a BV is allocated from the above historical BV information cache as one of the candidate BVPs (represented by cbvp_cands[i], i=0, 1, 2, ..., 6, i.e., a maximum of 7 BVs are stored in the BVP):
[0282] The BV of the coded block size parameter W×H≥64 is cached to cbvp_cands[0];
[0283] The BVs of the coded blocks that appear ≥ 2 times in the historical BV information cache are cached to cbvp_cands[1];
[0284] The BVs of the neighboring blocks of the coded block to the left, top, top-left, top-right, and bottom-left of the current block are cached in cbvp_cands[2], cbvp_cands[3], cbvp_cands[4], cbvp_cands[5], and cbvp_cands[6] respectively;
[0285] At this point, the candidate BVP (cbvp_cands) is filled.
[0286] (1.1.3) Record the number of BVPs filled in cbvp_cands in cnt_class_cands.
[0287] (1.2) Perform motion estimation and select an appropriate BV.
[0288] (1.2.1) First, two hash tables are established, namely m_hash2Pos and m_pos2Hash, to search for the hit predicted reference blocks and BVs. The size range of the IBC search is set according to whether the proportion of the same hash value appearing more than twice is greater than 5%. If so, it is set to 64×64, otherwise it is set to 32×32. Then select the BVP with the smallest cost result (cost) in cbvp_cands, and store the corresponding index value in bvp_idx. Then try all BVPs as BVs in cbvp_cands, calculate the cost, compare it with the BV found by the previous hash search, select a better BV, and record the block vector (BV), the index number of the block vector (bv_idx) and the cost result (cost).
[0289] (1.2.2) If a legal and reasonable BV (i.e., BV[0]≠0&&BV[1]≠0) is obtained in step (1.2.1), the motion estimation is completed and step (1.3) is executed; otherwise, step (1.2.3) is executed.
[0290] (1.2.3) Select the search starting point BV with SAD < 1000 in cbvp_cands, otherwise the starting point BV is set to (0, 0). Record the optimal BVP (bvpasbv_idx), and then perform a local search for BV. The process is as follows:
[0291] First, set the preset search range;
[0292] Secondly, according to the bvpasbv_idx just obtained, the SAD is calculated with its corresponding BV and stored in sad_best_cand and mv_cand;
[0293] Next, according to the preset search range, perform BV search and update in order at the top (bvx=0, bvy changes pixel by pixel) and the left (bvy=0, bvx changes pixel by pixel). (Note: bvx=0, bvy=0 refers to the BV relative to the search starting point);
[0294] Again, for coding blocks with W<16&&H<16, another round of search is performed to improve the prediction accuracy. In the search range, except for the top and left, other BVs are tried at integer pixel or double pixel intervals to select the optimal BV.
[0295] (1.3) After obtaining a legal and reasonable BV through hash search or full search in steps (1.1) and (1.2), set skip_me = 1, calculate the rate-distortion cost (RDcost), and store the current optimal BV.
[0296] (b) Try BV with four times the pixel precision.
[0297] (2.1) Perform BV prediction, which is the same as the above step (1.1) and will not be repeated here.
[0298] (2.2) Because skip_me=1, the original motion estimation process can be skipped, and the BV obtained with integer pixel precision is still used as the optimal BV; then, according to the quadruple precision requirement, the BV is adjusted to an integer multiple of four.
[0299] (2.3) Calculate the rate-distortion cost (RDcost) and update the optimal BV.
[0300] At this point, 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 can be obtained.
[0301] In this way, 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, motion compensation is performed according to the first target block vector information to determine the first prediction value of the first partition, and motion compensation is performed according to the second target block vector information to determine the second prediction value of the second partition; according to the angle division mode index number (AwpIdx), the first weight value of the first partition and the second weight value of the second partition can be determined; finally, the first prediction value, the first weight value, the second prediction value and the second weight value are used for weighted fusion, so as to obtain the intra-frame prediction value of the current block.
[0302] This embodiment provides an intra-frame prediction method, which is applied to an encoder. This embodiment describes the specific implementation of the aforementioned embodiment in detail, from which it can be seen that based on the technical solution of this embodiment, different angle weightings are used in intra-frame prediction to process the boundary information in the image block, which can better process the edge information of two parts with different textures / color distributions in the same divided block, the sharp edges of objects in the intra-frame image, the junction of the foreground and the background, and the boundary information of the ordinary sequence, so that the intra-frame image has a tool for processing edge information like the inter-frame image, thereby effectively improving the coding efficiency of the video sequence.
[0303] In another embodiment of the present application, the intra-frame prediction method provided in the embodiment of the present application is applied to a video decoding device, i.e., a decoder. The function implemented by the method can be implemented by calling a computer program by a second processor in the decoder, and of course the computer program can be stored in a second memory. It can be seen that the decoder includes at least a second processor and a second memory.
[0304] Based on the above Figure 7B For an example of an application scenario, see Fig. 9 , which shows a flow chart of another intra-frame prediction method provided by an embodiment of the present application. Fig. 9 As shown, the method may include:
[0305] S901: Parse the bitstream and obtain prediction mode parameters of the current block.
[0306] It should be noted that the video image can be divided into multiple image blocks, and each image block currently to be decoded can be called a decoding block. Here, each decoding block can also include a first image component, a second image component, and a third image component; and the current block is a decoding block in the video image that is currently to be predicted by the first image component, the second image component, or the third image component.
[0307] In some embodiments, parsing the bitstream to obtain the prediction mode parameter of the current block may include:
[0308] Parse the code stream and obtain the INBC mode flag;
[0309] If the INBC mode flag is the first value, it is determined that the current block uses the INBC mode;
[0310] If the INBC mode flag is the second value, it is determined that the current block uses the normal intra mode.
[0311] It should be noted that, in a specific implementation, the first value may be 1, and the second value may be 0; or, the first value may be true, and the second value may be false. In another specific implementation, the first value may be 0, and the second value may be 1; or, the first value may be false, and the second value may be true.
[0312] It should also be noted that after the encoder determines the prediction mode parameters, the encoder can write the INBC mode flag into the bitstream. In this way, the decoder can obtain the INBC mode flag of the current block by parsing the bitstream, and then determine whether the current block uses the INBC mode based on the INBC mode flag.
[0313] S902: When the prediction mode parameter indicates to use the INBC mode, parse the bitstream to obtain a first block vector index number and a second block vector index number.
[0314] S903: Based on the block vector candidate list, determine the first target block vector information of the first partition of the current block corresponding to the first block vector index number in the block vector candidate list, and the second target block vector information of the second partition of the current block corresponding to the second block vector index number in the block vector candidate list.
[0315] It should be noted that when the prediction mode parameter indicates to use the INBC mode, the current block is divided based on the INBC mode to obtain at least two partitions, wherein the at least two partitions may be a first partition and a second partition.
[0316] It should also be 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. Therefore, in some embodiments, the method may further include:
[0317] A block vector candidate list is constructed, wherein the block vector candidate list includes at least one block vector.
[0318] Here, for the block vector candidate list, in a specific embodiment, the building block vector candidate list may include:
[0319] Obtain historical block vector prediction information;
[0320] The block vector candidate list is determined based on the historical block vector prediction information.
[0321] That is, the block vector candidate list may be determined based on history based block vector prediction information (History based Block Vector Prediction, HBVP). In a more specific embodiment, determining the block vector candidate list based on the history block vector prediction information may include:
[0322] If the size parameter of the decoded block is greater than or equal to a preset size parameter, storing the block vector of the decoded block at the zeroth position of the block vector candidate list; and
[0323] If the number of times a decoded block appears in the historical block vector prediction information is greater than or equal to a preset number, storing the block vector of the decoded block at the first position of the block vector candidate list; and
[0324] The block vectors of the left decoded neighboring block, the upper decoded neighboring block, the upper left decoded neighboring block, the upper right decoded neighboring block and the lower left decoded neighboring block of the current block are stored in the second, third, fourth, fifth and sixth positions of the block vector candidate list respectively;
[0325] The block vector candidate list is obtained based on the block vectors stored at the zeroth, first, second, third, fourth, fifth and sixth positions in the block vector candidate list.
[0326] It should be noted that a maximum of 7 block vectors are stored in the block vector candidate list (BVP); wherein the i-th block vector candidate list can be represented by cbvp_cands[i], where i=0, 1, 2, ..., 6.
[0327] It should also be noted that the process of constructing the block vector candidate list in the decoder is the same as the process of constructing the block vector candidate list in the encoder, which will not be described in detail here.
[0328] After the encoder determines the first target block vector information and the second target block vector information, it writes the first block vector index number corresponding to the first target block vector information and the second block vector index number corresponding to the second target block vector information into the code stream and transmits it to the decoder. In this way, in the decoder, there is no need to determine the first target block vector information and the second target block vector information as in the encoder. At this time, the decoder can obtain the first block vector index number and the second block vector index number by parsing the code stream, and then obtain the first target block vector information and the second target block vector information based on the constructed block vector candidate list. Among them, the first target block vector information represents the optimal block vector of the first partition of the current block, and the second target block vector information represents the optimal block vector of the second partition of the current block.
[0329] S904: 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.
[0330] It should be noted that determining the first prediction value of the first partition according to the first target block vector information may include: performing motion compensation on the first partition according to the first target block vector information to obtain the prediction value of the first partition.
[0331] It should also be noted that determining the second prediction value of the second partition according to the second target block vector information may include: performing motion compensation on the second partition according to the second target block vector information to obtain the prediction value of the second partition.
[0332] That is to say, after obtaining the first target block vector information, motion compensation can be performed on the first partition according to the first target block vector information, and the prediction value of the first partition (or called motion compensation prediction value) can be obtained; after obtaining the second target block vector information, motion compensation can be performed on the second partition according to the second target block vector information, and the prediction value of the second partition (or called motion compensation prediction value) can be obtained.
[0333] S905: Determine a first weight value of the first partition and a second weight value of the second partition.
[0334] 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 mode index number (represented by AwpIdx). In some embodiments, determining the first weight value of the first partition and the second weight value of the second partition may include:
[0335] Parse the code stream and obtain the angle division mode index number;
[0336] According to the angle division mode index number, a mapping angle value is obtained using a first calculation model;
[0337] According to the mapping angle value, a slope classification index value is obtained using a second calculation model;
[0338] According to the mapped angle value, using a third calculation model to obtain a partition value to which the angle belongs;
[0339] Based on the slope classification index value and the partition value to which the angle belongs, a first weight value of the first partition and a second weight value of the second partition are obtained using a preset weight calculation model.
[0340] It should be noted that since the encoder writes AwpIdx into the bitstream, the decoder can obtain AwpIdx by parsing the bitstream. Then, according to AwpIdx, the mapping angle value (expressed by ModAngNum) can be further obtained; according to ModAngNum, the slope classification index value (expressed by angleIdx) and the partition value to which the angle belongs (expressed by subAngleIdx) can be further obtained. In addition, both the first weight value and the second weight value can include brightness weight (expressed by AwpWeightArrayY[x][y]) and chrominance weight (expressed by AwpWeightArrayUV[x][y]).
[0341] It should also be noted that after obtaining AwpIdx, the determination process of the first weight value and the second weight value in the decoder is the same as the determination process of the first weight value and the second weight value in the encoder, which will not be described in detail here.
[0342] S906: Perform weighted fusion using the first prediction value, the first weight value, the second prediction value, and the second weight value to determine an intra-frame prediction value of the current block.
[0343] It should be noted that after obtaining the first prediction value, the first weight value, the second prediction value and the second weight value, the first prediction value, the first weight value, the second prediction value and the second weight value are weighted and fused to determine the intra-frame prediction value of the current block in the INBC mode.
[0344] In short, in the decoder, by constructing the same block vector candidate list as that on the encoder side, the coefficients related to the weighted weights and the corresponding target block vector information of the two partitions (the first partition and the second partition) are determined according to the mode index (i.e., the angle division mode index number) and the BV index (i.e., the first block vector index number and the 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 the final intra-frame prediction value.
[0345] The decoder's intra prediction steps are as follows:
[0346] (1) Parse the bitstream to obtain flag information, the angle partition mode index number of the INBC mode, and the BV indexes of the two partitions.
[0347] (2) Derive the block vector candidate list (i.e., BVP list).
[0348] (3) According to the BV index and the BVP list, the BV information of the two partitions (ie, the target block vector information of each of the two partitions, including the first target block vector information and the second target block vector information) can be determined.
[0349] (4) Based on the target block vector information of each of the two partitions, the motion compensation prediction values of the two partitions are determined respectively.
[0350] (5) Parse the code stream to obtain mode information; calculate the weighted weight according to the mode information.
[0351] (6) Obtain the final intra-frame prediction value of the current block through weighted fusion.
[0352] The present embodiment provides an intra-frame prediction method, which is applied to a decoder. The prediction mode parameters of the current block are obtained by parsing the bitstream; when the prediction mode parameters indicate the use of the INBC mode, the bitstream is parsed to obtain the first block vector index number and the second block vector index number; based on the block vector candidate list, the first target block vector information of the first partition of the current block corresponding to the first block vector index number in the block vector candidate list and the second target block vector information of the second partition of the current block corresponding to the second block vector index number in the block vector candidate list are determined; the first prediction value of the first partition is determined according to the first target block vector information, and the second prediction value of the second partition is determined according to the second target block vector information; the first weight value of the first partition and the second weight value of the second partition are determined; the first prediction value, the first weight value, the second prediction value and the second weight value are weightedly fused to determine the intra-frame prediction value of the current block. In this way, using different angle weights to process the boundary information in the image block in intra-frame prediction can better process the edge information of two parts with different texture / color distributions in the same divided block, the sharp edges of objects in the intra-frame image, the junction of the foreground and the background, and the boundary information of ordinary sequences, etc., so that the intra-frame image has a tool for processing edge information like the inter-frame image, thereby effectively improving the decoding efficiency of the video sequence.
[0353] In another embodiment of the present application, based on the same inventive concept as the above embodiment, see Fig.10 , which shows a schematic diagram of the structure of an encoder 100 provided in an embodiment of the present application. Fig.10 As shown, the encoder 100 may include: a first determination unit 1001, a first calculation unit 1002 and a first prediction unit 1003; wherein,
[0354] A first determining unit 1001 is configured to determine a prediction mode parameter of a current block;
[0355] The first determining unit 1001 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 to use the INBC mode;
[0356] A first calculation unit 1002 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 determine a first weight value of the first partition and a second weight value of the second partition;
[0357] The first prediction unit 1003 is configured to perform weighted fusion using the first prediction value, the first weight value, the second prediction value and the second weight value to determine the intra-frame prediction value of the current block.
[0358] In some embodiments, see Fig.10 , the encoder 100 may further include a precoding unit 1004, configured to precode the current block based on multiple candidate prediction modes, and determine precoding results corresponding to the multiple candidate prediction modes;
[0359] The first determining unit 1001 is further configured to determine a prediction mode parameter of the current block from the multiple candidate prediction modes according to the precoding result.
[0360] Furthermore, the first determination unit 1001 is specifically configured to obtain rate-distortion cost results corresponding to the multiple candidate prediction modes based on the precoding result; and select the optimal rate-distortion cost result from the rate-distortion cost results, and determine the candidate prediction mode corresponding to the optimal rate-distortion cost result as the prediction mode parameter of the current block.
[0361] In some embodiments, see Fig.10 , the encoder 100 may further include a setting unit 1005; wherein the multiple candidate prediction modes include an INBC mode and a normal intra-frame mode;
[0362] The setting unit 1005 is configured to set the INBC mode flag to a first value if the prediction mode parameter indicates the use of the INBC mode; and to set the INBC mode flag to a second value if the prediction mode parameter indicates the use of the normal intra mode.
[0363] 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 false.
[0364] In some embodiments, see Fig.10 The encoder 100 may further include a writing unit 1006 configured to write the INBC mode flag into the bitstream.
[0365] In some embodiments, the first determination unit 1001 is also configured to determine three target candidate angle division modes from a plurality of candidate angle division modes; perform intra-frame prediction on the current block using the three target candidate angle division modes, and determine prediction cost results corresponding to the three target candidate angle division modes; and based on the prediction cost results, determine the INBC mode used by the current block from the three target candidate angle division modes.
[0366] Furthermore, the first determination unit 1001 is specifically configured to obtain rate-distortion cost results corresponding to the three target candidate angle division modes based on the prediction cost result; and select the optimal rate-distortion cost result from the rate-distortion cost results, and determine the target candidate angle division mode corresponding to the optimal rate-distortion cost result as the INBC mode used by the current block.
[0367] In some embodiments, the precoding unit 1004 is further configured to precode the current block based on the multiple candidate angle division modes, and determine precoding results corresponding to the multiple candidate angle division modes;
[0368] The first determination unit 1001 is further configured to determine the three target candidate angle division modes from the multiple candidate angle division modes based on the precoding result.
[0369] Furthermore, the first determination unit 1001 is specifically configured to obtain SATD cost results corresponding to the multiple candidate angle division modes based on the precoding results; and select three relatively better SATD cost results from the SATD cost results, and determine the candidate angle division modes corresponding to the three SATD cost results as the three target candidate angle division modes.
[0370] In some embodiments, the first determining unit 1001 is further configured to determine, based on multiple candidate angle partitioning modes, a first partition and a second partition of the current block in each candidate angle partitioning mode; and determine first target block vector information of the first partition and second target block vector information of the second partition in each candidate angle partitioning mode;
[0371] The precoding unit 1004 is specifically configured to precode 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 under each candidate angle partition mode to obtain precoding results corresponding to the multiple candidate angle partition modes.
[0372] In some embodiments, see Fig.10 The encoder 100 may further include a first constructing unit 1007 configured to construct a block vector candidate list, wherein the block vector candidate list includes at least one block vector.
[0373] In some embodiments, the first constructing unit 1007 is specifically configured to obtain historical block vector prediction information; and determine the block vector candidate list based on the historical block vector prediction information.
[0374] Further, the first construction unit 1007 is specifically configured to store the block vector of the encoded block at the zeroth position of the block vector candidate list if the size parameter of the encoded block is greater than or greater than a preset size parameter; and store the block vector of the encoded block at the first position of the block vector candidate list if the number of times the encoded block appears in the historical block vector prediction information is greater than or equal to a preset number of times; and store the block vectors of the left encoded neighboring block, the upper encoded neighboring block, the upper left encoded neighboring block, the upper right encoded neighboring block and the lower left encoded neighboring block of the current block at the second, third, fourth, fifth and sixth positions of the block vector candidate list respectively; and obtain the block vector candidate list based on the block vectors stored at the zeroth, first, second, third, fourth, fifth and sixth positions in the block vector candidate list.
[0375] In some embodiments, the first determination 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; and establish a preset hash table, perform intra-frame block copy search on the first partition and the second partition, and select a first block vector information matching the hash key value of the first partition and a second block vector information matching the hash key value of the second partition from the block vector candidate list; and traverse at least one block vector in the block vector candidate list, calculate a first cost result corresponding to the at least one block vector of the first partition and a second cost result corresponding to the at least one block vector of the second partition; and select the best cost result from the first cost result, and determine the block vector corresponding to the best cost result as the first two block vector information of the first partition; and select the best cost result from the second cost result, and determine the block vector corresponding to the best cost result as the second two block vector information of the second partition; and determine the block vector information with the best cost result from the first one block vector information and the first two block vector information as the first target block vector information of the first partition; and determine the block vector information with the best cost result from the second one block vector information and the second two block vector information as the second target block vector information of the second partition.
[0376] In some embodiments, the first determination 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 is illegal block vector information; in the block vector candidate list, perform a pixel-by-pixel block vector search on the first partition and the second partition in order according to the preset search range to obtain first block vector information and second block vector information; and determine 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.
[0377] 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; and determine a second block vector index number, where the second block vector index number is used to indicate an index number corresponding to the second target block vector information in the block vector candidate list;
[0378] The writing unit 1006 is further configured to write the first block vector index sequence number and the second block vector index sequence number into the bitstream.
[0379] In some embodiments, the first calculation unit 1002 is specifically configured to perform motion compensation on the first partition according to the first target block vector information to obtain a prediction value of the first partition.
[0380] In some embodiments, the first calculation 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.
[0381] In some embodiments, the first determining unit 1001 is further configured to determine the angle division mode index number based on the INBC mode;
[0382] The first calculation unit 1002 is also configured to obtain a mapping angle value using a first calculation model according to the angle division mode index number; and obtain a slope classification index value using a second calculation model according to the mapping angle value; and obtain a partition value to which the angle belongs using a third calculation model according to the mapping angle value; and obtain a first weight value of the first partition and a second weight value of the second partition based on the slope classification index value and the partition value to which the angle belongs using a preset weight calculation model.
[0383] In some embodiments, the writing unit 1006 is further configured to write the angle division mode index sequence number into the bit stream.
[0384] It is understandable 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, etc., and of course, it may be a module, or it may be non-modular. Moreover, the components in the present embodiment may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional module.
[0385] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0386] Therefore, an embodiment of the present application provides a computer storage medium, which is applied to the encoder 100, and the computer storage medium stores an intra-frame prediction program. When the intra-frame prediction program is executed by the first processor, the method described in any one of the above embodiments is implemented.
[0387] Based on the composition of the encoder 100 and the computer storage medium, see Fig.11 , which shows a schematic diagram of the specific hardware structure of the encoder 100 provided in the embodiment of the present application. Fig.11 As shown, it may include: a first communication interface 1101, a first memory 1102 and a first processor 1103; each component is coupled together through a first bus system 1104. It is understandable that the first bus system 1104 is used to realize the connection and communication between these components. In addition to the data bus, the first bus system 1104 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig.11 In the figure, various buses are marked as the first bus system 1104. Among them,
[0388] The first communication interface 1101 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0389] A first memory 1102, used to store a computer program that can be run on the first processor 1103;
[0390] The first processor 1103 is configured to, when running the computer program, execute:
[0391] Determining prediction mode parameters for the current block;
[0392] When the prediction mode parameter indicates that the INBC mode is used, 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;
[0393] 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;
[0394] Determining a first weight value of the first partition and a second weight value of the second partition;
[0395] The first prediction value, the first weight value, the second prediction value and the second weight value are used for weighted fusion to determine the intra-frame prediction value of the current block.
[0396] It can be understood that the first memory 1102 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM). The first memory 1102 of the system and method described in the present application is intended to include but is not limited to these and any other suitable types of memory.
[0397] The first processor 1103 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the first processor 1103. The above-mentioned first processor 1103 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the first memory 1102, and the first processor 1103 reads the information in the first memory 1102 and completes the steps of the above method in combination with its hardware.
[0398] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units or combinations thereof for performing functions described in the present application. For software implementation, the technology described in the present application can be implemented by a module (such as a process, function, etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in a processor or outside a processor.
[0399] Optionally, as another embodiment, the first processor 1103 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.
[0400] This embodiment provides an encoder, which may include a first determination unit, a first calculation unit, and a first prediction unit. In this way, different angle weightings are used to process the boundary information in the image block in intra-frame prediction, which can better process the edge information of two parts with different textures / color distributions in the same divided block, the sharp edge of objects in the intra-frame image, the junction of the foreground and the background, and the boundary information of the ordinary sequence, so that the intra-frame image has a tool for processing edge information like the inter-frame image, thereby effectively improving the coding efficiency of the video sequence.
[0401] In another embodiment of the present application, based on the same inventive concept as the above embodiment, see Fig.12 , which shows a schematic diagram of the structure of a decoder 120 provided in an embodiment of the present application. Fig.12 As shown, the decoder 120 may include: a parsing unit 1201, a second determining unit 1202, a second calculating unit 1203 and a second predicting unit 1204; wherein,
[0402] The parsing unit 1201 is configured to parse the bitstream to obtain a prediction mode parameter of the current block; and is further configured to parse the bitstream to obtain a first block vector index number and a second block vector index number when the prediction mode parameter indicates that the INBC mode is used;
[0403] The second determining unit 1202 is configured to determine, based on the block vector candidate list, first target block vector information of a first partition of the 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;
[0404] A second calculation unit 1203 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 determine a first weight value of the first partition and a second weight value of the second partition;
[0405] The second prediction unit 1204 is configured to perform weighted fusion using the first prediction value, the first weight value, the second prediction value and the second weight value to determine the intra-frame prediction value of the current block.
[0406] In some embodiments, the parsing unit 1201 is further configured to parse the bitstream and obtain an INBC mode flag;
[0407] The second determining unit 1202 is further configured to determine that the current block uses the INBC mode if the INBC mode flag is a first value; and determine that the current block uses the normal intra mode if the INBC mode flag is a second value.
[0408] 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 false.
[0409] In some embodiments, see Fig.12 The decoder 120 may further include a second constructing unit 1205 configured to construct a block vector candidate list, wherein the block vector candidate list includes at least one block vector.
[0410] In some embodiments, the second constructing unit 1205 is specifically configured to obtain historical block vector prediction information; and determine the block vector candidate list based on the historical block vector prediction information.
[0411] Further, the second construction unit 1205 is specifically configured to store the block vector of the decoded block at the zeroth position of the block vector candidate list if the size parameter of the decoded block is greater than or greater than the preset size parameter; and store the block vector of the decoded block at the first position of the block vector candidate list if the number of times the decoded block appears in the historical block vector prediction information is greater than or equal to the preset number of times; and store the block vectors of the left decoded neighboring block, the upper decoded neighboring block, the upper left decoded neighboring block, the upper right decoded neighboring block and the lower left decoded neighboring block of the current block at the second, third, fourth, fifth and sixth positions of the block vector candidate list respectively; and obtain the block vector candidate list based on the block vectors stored at the zeroth, first, second, third, fourth, fifth and sixth positions in the block vector candidate list.
[0412] In some embodiments, the second calculation unit 1203 is specifically configured to perform motion compensation on the first partition according to the first target block vector information to obtain a prediction value of the first partition.
[0413] In some embodiments, the second calculation unit 1203 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.
[0414] In some embodiments, the parsing unit 1201 is further configured to parse the code stream to obtain the angle division mode index number;
[0415] The second calculation unit 1203 is also configured to obtain a mapping angle value using a first calculation model according to the angle division mode index number; and obtain a slope classification index value using a second calculation model according to the mapping angle value; and obtain a partition value to which the angle belongs using a third calculation model according to the mapping angle value; and obtain a first weight value of the first partition and a second weight value of the second partition based on the slope classification index value and the partition value to which the angle belongs using a preset weight calculation model.
[0416] It can be understood that in this embodiment, a "unit" can be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional module.
[0417] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer storage medium, which is applied to the decoder 120, and the computer storage medium stores an intra-frame prediction program. When the intra-frame prediction program is executed by the second processor, the method described in any one of the above embodiments is implemented.
[0418] Based on the above-mentioned components of the decoder 120 and the computer storage medium, see Fig.13 , which shows a schematic diagram of the specific hardware structure of the decoder 120 provided in the embodiment of the present application. Fig.13 As shown, it may include: a second communication interface 1301, a second memory 1302, and a second processor 1303; each component is coupled together via a second bus system 1304. It is understood that the second bus system 1304 is used to realize the connection and communication between these components. In addition to the data bus, the second bus system 1304 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in Fig.13 In the figure, various buses are labeled as the second bus system 1304. Among them,
[0419] The second communication interface 1301 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0420] The second memory 1302 is used to store a computer program that can be run on the second processor 1303;
[0421] The second processor 1303 is configured to, when running the computer program, execute:
[0422] Parse the bitstream and obtain the prediction mode parameters of the current block;
[0423] When the prediction mode parameter indicates that the INBC mode is used, parsing the bitstream to obtain the first block vector index number and the second block vector index number;
[0424] Based on the block vector candidate list, determine first target block vector information of a first partition of the 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;
[0425] 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;
[0426] Determining a first weight value of the first partition and a second weight value of the second partition;
[0427] The first prediction value, the first weight value, the second prediction value and the second weight value are used for weighted fusion to determine the intra-frame prediction value of the current block.
[0428] Optionally, as another embodiment, the second processor 1303 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.
[0429] It can be understood that the hardware functions of the second memory 1302 and the first memory 1102 are similar, and the hardware functions of the second processor 1303 and the first processor 1103 are similar; they will not be described in detail here.
[0430] This embodiment provides a decoder, which may include a parsing unit, a second determining unit, a second calculating unit, and a second predicting unit. In this way, different angle weightings are used in intra-frame prediction to process the boundary information in the image block, which can better process the edge information of two parts with different textures / color distributions in the same divided block, the sharp edges of objects in the intra-frame image, the junction of the foreground and the background, and the boundary information of the ordinary sequence, so that the intra-frame image has a tool for processing edge information like the inter-frame image, thereby effectively improving the decoding efficiency of the video sequence.
[0431] It should be noted that, in this application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0432] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0433] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0434] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0435] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0436] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0437] Industrial Applicability
[0438] In an embodiment of the present application, after obtaining the prediction mode parameters of the current block, when the prediction mode parameters indicate the use of the INBC mode, determine 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; determine the first prediction value of the first partition according to the first target block vector information, and determine the second prediction value of the second partition according to the second target block vector information; determine the first weight value of the first partition and the second weight value of the second partition; and then use the first prediction value, the first weight value, the second prediction value and the second weight value for weighted fusion to determine the intra-frame prediction value of the current block. In this way, using different angle weightings to process the boundary information in the image block in intra-frame prediction can better process the edge information of two parts with different texture / color distributions in the same partition block, the sharp edge of objects in the intra-frame image, the junction of the foreground and the background, and the boundary information of the ordinary sequence, so that the intra-frame image has a tool for processing edge information like the inter-frame image, thereby effectively improving the encoding and decoding efficiency of the video sequence.
Claims
1. An intra-frame prediction method, applied to an encoder, the method comprising: Determining prediction mode parameters for the current block; When the prediction mode parameter indicates that the non-rectangular block copying (INBC) mode is used, 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; 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; Determine a first weight value of the first partition and a second weight value of the second partition; wherein the first weight value of the first partition and the second weight value of the second partition are related to an angle division mode index number, and the angle division mode index number is determined based on the INBC mode; The first prediction value, the first weight value, the second prediction value and the second weight value are used for weighted fusion to determine the intra-frame prediction value of the current block.
2. The method according to claim 1, wherein: The determining of the prediction mode parameters of the current block includes: Precoding the current block based on multiple candidate prediction modes, and determining precoding results corresponding to the multiple candidate prediction modes; According to the pre-encoding result, a prediction mode parameter of the current block is determined from the multiple candidate prediction modes.
3. The method according to claim 2, wherein: The step of determining the prediction mode parameter of the current block from the plurality of candidate prediction modes according to the precoding result includes: Based on the precoding result, obtaining rate-distortion cost results corresponding to the multiple candidate prediction modes; An optimal rate-distortion cost result is selected from the rate-distortion cost results, and a candidate prediction mode corresponding to the optimal rate-distortion cost result is determined as a prediction mode parameter of the current block.
4. The method according to claim 2, wherein: The multiple candidate prediction modes include an INBC mode and a normal intra-frame mode, and the determining of the prediction mode parameters of the current block includes: If the prediction mode parameter indicates to use the INBC mode, setting the INBC mode flag bit to a first value; If the prediction mode parameter indicates to use the normal intra mode, the INBC mode flag is set to a second value.
5. The method according to 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 false.
6. The method according to claim 4, wherein: The method further comprises: The INBC mode flag is written into the bit stream.
7. The method according to claim 1, wherein: Before determining the prediction mode parameters of the current block, the method further includes: Determine three target candidate angle division modes from a plurality of candidate angle division modes; Performing intra-frame prediction on the current block using the three target candidate angle division modes, and determining prediction cost results corresponding to the three target candidate angle division modes; Based on the prediction cost result, the INBC mode used by the current block is determined from the three target candidate angle division modes.
8. The method according to claim 7, wherein: The determining, based on the prediction cost result, the INBC mode used by the current block from the three target candidate angle division modes comprises: Based on the prediction cost result, obtaining rate-distortion cost results corresponding to the three target candidate angle division modes; An optimal rate-distortion cost result is selected from the rate-distortion cost results, and a target candidate angle division mode corresponding to the optimal rate-distortion cost result is determined as the INBC mode used by the current block.
9. The method according to claim 7, wherein: The step of determining three target candidate angle division modes from the plurality of candidate angle division modes comprises: Pre-encoding the current block based on the multiple candidate angle division modes, and determining pre-encoding results corresponding to the multiple candidate angle division modes; Based on the precoding result, the three target candidate angle division modes are determined from the multiple candidate angle division modes.
10. The method according to claim 9, wherein: The determining, based on the precoding result, the three target candidate angle division modes from the multiple candidate angle division modes comprises: Based on the precoding result, obtaining absolute transformation difference and SATD cost results corresponding to the multiple candidate angle division modes; Three relatively better SATD cost results are selected from the SATD cost results, and the candidate angle division modes corresponding to the three SATD cost results are determined as the three target candidate angle division modes.
11. The method according to claim 9, wherein: The precoding of the current block based on the multiple candidate angle division modes and determining precoding results corresponding to the multiple candidate angle division modes includes: Based on a plurality of candidate angle partition modes, determine a first partition and a second partition of the current block under each candidate angle partition mode; Determine first target block vector information of the first partition and second target block vector information of the second partition under each candidate angle division mode; The current block is pre-encoded according to the first target block vector information of the first partition and the second target block vector information of the second partition under each candidate angle partition mode to obtain pre-coding results corresponding to the multiple candidate angle partition modes.
12. The method according to claim 1, wherein: The method further comprises: A block vector candidate list is constructed, wherein the block vector candidate list includes at least one block vector.
13. The method according to claim 12, wherein: The candidate list of building block vectors includes: Obtain historical block vector prediction information; The block vector candidate list is determined based on the historical block vector prediction information.
14. The method according to claim 13, wherein: The determining the block vector candidate list based on the historical block vector prediction information includes: If the size parameter of the encoded block is greater than or greater than the preset size parameter, storing the block vector of the encoded block at the zeroth position of the block vector candidate list; and If the number of times that the coded block appears in the historical block vector prediction information is greater than or equal to a preset number, storing the block vector of the coded block at the first position of the block vector candidate list; and The block vectors of the left coded neighboring block, the upper coded neighboring block, the upper left coded neighboring block, the upper right coded neighboring block and the lower left coded neighboring block of the current block are stored in the second, third, fourth, fifth and sixth positions of the block vector candidate list respectively; The block vector candidate list is obtained based on the block vectors stored at the zeroth, first, second, third, fourth, fifth and sixth positions in the block vector candidate list.
15. The method according to claim 12, wherein: The determining of 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 includes: Based on the INBC mode, determining the first partition and the second partition after the current block is divided; Establishing a preset hash table, performing intra-block copy search on the first partition and the second partition, and selecting a first block vector information matching the hash key value of the first partition and a second block vector information matching 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, calculating a first cost result corresponding to the first partition with respect to the at least one block vector and a second cost result corresponding to the second partition with respect to the at least one block vector; Selecting the best cost result from the first cost result, and determining the block vector corresponding to the best cost result as the first two blocks of vector information of the first partition; and selecting the best cost result from the second cost result, and determining the block vector corresponding to the best cost result as the second two blocks of vector information of the second partition; Determining the block vector information with the best cost result from the first block vector information and the first two blocks vector information as the first target block vector information of the first partition; and From the second one block of vector information and the second two blocks of vector information, the block vector information with the best cost result is determined as the second target block vector information of the second partition.
16. The method according to claim 15, wherein: The determining of 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 includes: If at least one of the first target block vector information and the second target block vector information is illegal block vector information, a preset search range is determined; in the block vector candidate list, a pixel-by-pixel block vector search is performed on the first partition and the second partition in sequence according to the preset search range to obtain first block vector information and second block vector information; The obtained first block vector information and second block vector information are determined as the first target block vector information and the second target block vector information.
17. The method according to claim 12, wherein: After determining the first target block vector information and the second target block vector information, the method further includes: 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; Determine a second block vector index number, where the second block vector index number is used to indicate an index number corresponding to the second target block vector information in the block vector candidate list; The first block vector index serial number and the second block vector index serial number are written into a bitstream.
18. The method according to any one of claims 1 to 17, wherein: The determining the first prediction value of the first partition according to the first target block vector information includes: Motion compensation is performed on the first partition according to the first target block vector information to obtain a prediction value of the first partition.
19. The method according to any one of claims 1 to 17, wherein: The determining the second prediction value of the second partition according to the second target block vector information includes: Motion compensation is performed on the second partition according to the second target block vector information to obtain a prediction value of the second partition.
20. The method according to any one of claims 1 to 17, wherein: The determining a first weight value of the first partition and a second weight value of the second partition includes: Based on the INBC mode, determining an angle division mode index number; According to the angle division mode index number, a mapping angle value is obtained using a first calculation model; According to the mapping angle value, a slope classification index value is obtained using a second calculation model; According to the mapped angle value, using a third calculation model to obtain a partition value to which the angle belongs; Based on the slope classification index value and the partition value to which the angle belongs, a first weight value of the first partition and a second weight value of the second partition are obtained using a preset weight calculation model.
21. The method according to claim 20, wherein: After determining the angle division mode index sequence number, the method further includes: The angle division mode index sequence number is written into the bit stream.
22. An intra-frame prediction method, applied to a decoder, the method comprising: Parse the bitstream and obtain the prediction mode parameters of the current block; When the prediction mode parameter indicates that the INBC mode is used, parsing the bitstream to obtain the first block vector index number and the second block vector index number; Based on the block vector candidate list, determine first target block vector information of a first partition of the 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; 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; Determine a first weight value of the first partition and a second weight value of the second partition; wherein the first weight value of the first partition and the second weight value of the second partition are related to an angle division mode index number, and the angle division mode index number is determined based on a parsed bitstream; The first prediction value, the first weight value, the second prediction value and the second weight value are used for weighted fusion to determine the intra-frame prediction value of the current block.
23. The method according to claim 22, wherein: The parsing of the bitstream to obtain the prediction mode parameters of the current block includes: Parse the code stream and obtain the INBC mode flag; If the INBC mode flag is the first value, determining that the current block uses the INBC mode; If the INBC mode flag is the second value, it is determined that the current block uses the normal intra mode.
24. The method according to 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 false.
25. The method according to claim 22, wherein: The method further comprises: The block vector candidate list is constructed, and the block vector candidate list includes at least one block vector.
26. The method according to claim 25, wherein: The step of constructing the block vector candidate list comprises: Obtain historical block vector prediction information; The block vector candidate list is determined based on the historical block vector prediction information.
27. The method according to claim 26, wherein: The determining the block vector candidate list based on the historical block vector prediction information includes: If the size parameter of the decoded block is greater than or equal to a preset size parameter, storing the block vector of the decoded block at the zeroth position of the block vector candidate list; and If the number of times a decoded block appears in the historical block vector prediction information is greater than or equal to a preset number, storing the block vector of the decoded block at the first position of the block vector candidate list; and The block vectors of the left decoded neighboring block, the upper decoded neighboring block, the upper left decoded neighboring block, the upper right decoded neighboring block and the lower left decoded neighboring block of the current block are stored in the second, third, fourth, fifth and sixth positions of the block vector candidate list respectively; The block vector candidate list is obtained based on the block vectors stored at the zeroth, first, second, third, fourth, fifth and sixth positions in the block vector candidate list.
28. The method according to any one of claims 22 to 27, wherein: The determining the first prediction value of the first partition according to the first target block vector information includes: Motion compensation is performed on the first partition according to the first target block vector information to obtain a prediction value of the first partition.
29. The method according to any one of claims 22 to 27, wherein: The determining the second prediction value of the second partition according to the second target block vector information includes: Motion compensation is performed on the second partition according to the second target block vector information to obtain a prediction value of the second partition.
30. The method according to any one of claims 22 to 27, wherein: The determining a first weight value of the first partition and a second weight value of the second partition includes: Parse the code stream and obtain the angle division mode index number; According to the angle division mode index number, a mapping angle value is obtained using a first calculation model; According to the mapping angle value, a slope classification index value is obtained using a second calculation model; According to the mapped angle value, using a third calculation model to obtain a partition value to which the angle belongs; Based on the slope classification index value and the partition value to which the angle belongs, a first weight value of the first partition and a second weight value of the second partition are obtained using a preset weight calculation model.
31. An encoder, comprising a first determining unit, a first calculating unit and a first predicting unit; wherein: The first determining unit is configured to determine a prediction mode parameter of a current block; The first determining 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 to use the INBC mode; 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 to 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; wherein the first weight value of the first partition and the second weight value of the second partition are related to an angle division mode index number, and the angle division mode index number is determined based on the INBC mode; The first prediction unit is configured to perform weighted fusion using the first prediction value, the first weight value, the second prediction value and the second weight value to determine the intra-frame prediction value of the current block.
32. An encoder, comprising a first memory and a first processor; wherein: The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the method according to any one of claims 1 to 21 when running the computer program.
33. A decoder, comprising a parsing unit, a second determining unit, a second calculating unit and a second predicting unit; wherein: The parsing unit is configured to parse the bitstream to obtain a prediction mode parameter of the current block; and is further configured to parse the bitstream to obtain a first block vector index number and a second block vector index number when the prediction mode parameter indicates that the INBC mode is used; The second determining unit is configured to determine, based on the block vector candidate list, first target block vector information of a first partition of the 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 to 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; wherein the first weight value of the first partition and the second weight value of the second partition are related to an angle division mode index number, and the angle division mode index number is determined based on a parsed bitstream; The second prediction unit is configured to perform weighted fusion using the first prediction value, the first weight value, the second prediction value and the second weight value to determine the intra-frame prediction value of the current block.
34. A decoder, comprising a second memory and a second processor; wherein: The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method according to any one of claims 22 to 30 when running the computer program.
35. A computer storage medium, wherein: The computer storage medium stores a computer program, which implements the method according to any one of claims 1 to 21 when executed by a first processor, or implements the method according to any one of claims 22 to 30 when executed by a second processor.
