In the field of video coding and decoding, how to enhance efficiency of video compression is of vital importance. During digitization of pictures and videos, a large amount of data redundancies are generated, which makes video compression technologies possible. There is a strong spatial correlation between neighbouring parts or neighbouring pixels within the picture. The intra prediction is a prediction method which uses a spatial correlation between coded and decoded pixels around a current block and pixels within the current block, thereby reducing a spatial redundancy in the video coding based on prediction results. However, the intra prediction in existing video coding and decoding standards has a problem of poor video coding and decoding performance. Therefore, it still has a significance of studying how to further improve the accuracy of the intra prediction to enhance the video coding and decoding performance.
Embodiments of the disclosure relate to video picture technologies, and relate to, but are not limited to, a coding method, a decoding method, a coder and a decoder.
The coding method, the decoding method, the coder, and the decoder provided in the embodiments of the disclosure are implemented as follows.
According to an aspect of the embodiments of the disclosure, a decoding method is provided. The method is applied to a decoder and includes the following operations. A first reference block of a current block is determined. A first intra prediction value of the current block is obtained according to sample values of a reconstructed area neighbouring the current block and a sample value of the first reference block. A reconstructed value of the current block is determined according to the first intra prediction value of the current block.
According to another aspect of the embodiments of the disclosure, a decoding method is provided. The method is applied to a decoder and includes the following operations. Multiple reference blocks of a current block are determined. The multiple reference blocks are located in a picture where the current block is located. A first intra prediction value of the current block is obtained according to sample values of the multiple reference blocks. A reconstructed value of the current block is determined according to the first intra prediction value of the current block.
According to yet another aspect of the embodiments of the disclosure, a coding method is provided. The method is applied to a coder and includes the following operations. A first reference block of a current block is determined. A first intra prediction value of the current block is obtained according to sample values of a reconstructed area neighbouring the current block and a sample value of the first reference block. A residual value of the current block is obtained according to the first intra prediction value of the current block and a sample value of the current block. A bitstream is generated according to the residual value.
According to still another aspect of the embodiments of the disclosure, a coding method is provided. The method is applied to a coder and includes the following operations. Multiple reference blocks of a current block are determined. The multiple reference blocks are located in a picture where the current block is located. A first intra prediction value of the current block is obtained according to sample values of the multiple reference blocks. A residual value of the current block is obtained according to the first intra prediction value of the current block and a sample value of the current block. A bitstream is generated according to the residual value.
According to another aspect of the embodiments of the disclosure, a decoding apparatus is provided. The apparatus is applied to a decoder and includes a first determination module, a first prediction module, and a second determination module. The first determination module is configured to determine a first reference block of a current block. The first prediction module is configured to obtain a first intra prediction value of the current block according to sample values of a reconstructed area neighbouring the current block and a sample value of the first reference block. The second determination module is configured to determine a reconstructed value of the current block according to the first intra prediction value of the current block.
According to yet another aspect of the embodiments of the disclosure, a decoding apparatus is provided. The apparatus is applied to a decoder and includes a third determination module, a second prediction module, and a second determination module. The third determination module is configured to determine multiple reference blocks of a current block. The multiple reference blocks are located in a picture where the current block is located. The second prediction module is configured to obtain a first intra prediction value of the current block according to sample values of the multiple reference blocks. The second determination module is configured to determine a reconstructed value of the current block according to the first intra prediction value of the current block.
According to still another aspect of the embodiments of the disclosure, a decoder is provided. The decoder includes a first memory and a first processor. The first memory is configured to store a computer program executable on the first processor. The first processor is configured to perform the decoding method described in the embodiments of the disclosure when executing the computer program.
According to another aspect of the embodiments of the disclosure, a coding apparatus is provided. The apparatus is applied to a coder and includes a first determination module, a first prediction module, and a generation module. The first determination module is configured to determine a first reference block of a current block. The first prediction module is configured to obtain a first intra prediction value of the current block according to sample values of a reconstructed area neighbouring the current block and a sample value of the first reference block. The generation module is configured to obtain a residual value of the current block according to the first intra prediction value of the current block and a sample value of the current block, and generate a bitstream according to the residual value.
According to yet another aspect of the embodiments of the disclosure, a coding apparatus is provided. The apparatus is applied to a coder and includes a third determination module, a second prediction module, and a generation module. The third determination module is configured to determine multiple reference blocks of a current block. The multiple reference blocks are located in a picture where the current block is located. The second prediction module is configured to obtain a first intra prediction value of the current block according to sample values of the multiple reference blocks. The generation module is configured to obtain a residual value of the current block according to the first intra prediction value of the current block and a sample value of the current block, and generate a bitstream according to the residual value.
According to still another aspect of the embodiments of the disclosure, a coder is provided. The coder includes a second memory and a second processor. The second memory is configured to store a computer program executable on the second processor. The second processor is configured to perform the coding method described in the embodiments of the disclosure when executing the computer program.
According to another aspect of the embodiments of the disclosure, a bitstream is provided. The bitstream is generated a residual value between a first intra prediction value of a current block and a sample value of the current block. The first intra prediction value is obtained through the coding method described in the embodiments of the disclosure.
According to yet another aspect of the embodiments of the disclosure, an electronic device is provided. The electronic device includes a processor and a computer-readable storage medium. The processor is configured to execute a computer program. The computer-readable storage medium has stored thereon a computer program. When the computer program is executed by the processor, the coding method described in the embodiments of the disclosure is implemented. Alternatively, when the computer program is executed by the processor, the decoding method described in the embodiments of the disclosure is implemented.
According to still another aspect of the embodiments of the disclosure, a computer-readable storage medium is provided. The computer-readable storage medium has stored thereon a computer program. When the computer program is executed, the coding method described in the embodiments of the disclosure is implemented. Alternatively, when the computer program is executed, the decoding method described in the embodiments of the disclosure is implemented.
It should be understood that the foregoing general descriptions and the following detailed descriptions are only exemplary and explanatory, and cannot limit the disclosure.
The drawings here are incorporated into the description and constitute a part of the description, and these drawings show the embodiments consistent with the disclosure and are intended to explain the technical solutions of the disclosure together with the description. It is apparent that the drawings described below are only some embodiments of the disclosure, and other drawings may also be obtained by those of ordinary skill in the art according to these drawings without paying any creative work.
The flowcharts shown in the drawings are only exemplary explanations and do not necessarily include all the contents and operations/steps, nor are they necessarily performed in the described order. For example, some operations/steps may also be decomposed, and some operations/steps may be combined or partially combined. Therefore the actual execution order may be changed according to actual situations.
In order to make the purpose, technical solutions and advantages of the embodiments of the disclosure clearer, specific technical solutions of the disclosure will be further described in detail below with reference to the drawings in the embodiments of the disclosure. The following embodiments are intended to explain the disclosure, but not to limit the scope of the disclosure.
Unless otherwise defined, all the technical and scientific terms used here have the same meaning as usually understood by technicians in the technical field to which the disclosure belongs. The terms used here are only for the purpose of describing the embodiments of the disclosure, and are not intended to limit the disclosure.
In the following descriptions, reference is made to exemplary descriptions such as “some embodiments”, or “in some other embodiments”, or “in an example”, or the like which describe a subset of all the possible embodiments. However, it may be understood that “some embodiments” may be the same or different subsets of all the possible embodiments, and may be combined with each other without conflict.
It should be noted that terms “first\second\third” or the like involved in the embodiments of the disclosure are intended to distinguish similar or different objects, and do not represent a specific order of the objects. It may be understood that specific orders or sequences of “first\second\third” or the like may be interchanged if allowable, so that the embodiments of the disclosure described here may be implemented in an order besides that shown or described here.
Frameworks of a coder and a decoder and business scenarios described in the embodiments of the disclosure are intended to explain the technical solutions of the embodiments of the disclosure more clearly, and do not constitute a limitation on the technical solutions provided in the embodiments of the disclosure. It may be known by those of ordinary skill in the art that with the evolution of the coder and the decoder and the emergence of new business scenarios, the technical solutions provided in the embodiments of the disclosure are also applicable to similar technical problems.
Most video coding and decoding standards adopt a block-based hybrid coding framework. Each picture or sub-picture or frame in the video is divided into square Largest Coding Units (LCUs) or Coding Tree Units (CTUs) of the same size (such as 128×128, or 64×64, etc.). Each LCU or CTU may be divided into rectangular Coding Units (CUs) according to a rule. The CU may also be divided into Prediction Units (PUs) and/or Transform Units (TUs), etc. The hybrid coding framework includes modules such as a prediction module, a transform module, a quantization module, an entropy coding module, an in-loop filter module, etc. The prediction module includes intra prediction and inter prediction. The inter prediction includes motion estimation and motion compensation. Since there is a strong correlation between neighbouring pixels in a frame of the video, an intra prediction method is used in the video coding and decoding technologies to eliminate a spatial redundancy between neighbouring pixels. Since there is a strong similarity between neighbouring frames in the video, an inter prediction method is used in the video coding and decoding technologies to eliminate the temporal redundancy between neighbouring frames, thereby improving the coding and decoding efficiency.
A basic flow of a video codec is shown in
The above descriptions are the basic flow of the video codec under the block-based hybrid coding framework. With the development of technologies, some modules or steps of the framework or flow may be optimized. The coding and decoding methods provided in the embodiments of the disclosure are applicable to the basic flow of the video codec under the block-based hybrid coding framework, but are not limited to the framework and flow. It may be known by those of ordinary skill in the art that with the evolution of the coder and the decoder and the emergence of new business scenarios, the methods provided in the embodiments of the disclosure are also applicable to similar technical problems.
The current block may be a current CU, or a current PU, etc.
It may be understood that there is a strong spatial correlation between neighbouring parts or neighbouring pixels within the picture. The intra prediction is a method of performing the prediction by using a spatial correlation between coded and decoded pixels around the current block and pixels within the current block. For example, as shown in
An intra prediction method of Multiple Reference Line (MRL) may use more reference pixels, thereby improving the coding efficiency. As shown in
There are multiple prediction modes for the intra prediction. As shown in
In addition, there are a Plane mode, a Planar mode, etc. With the development of technologies and the expansion of blocks, there are more and more angular prediction modes. As shown in
A video is composed of multiple pictures. In order to make the video watched smoothly, each second of video contains dozens or even hundreds of frames of pictures, such as 24 frames per second (FPS), 30 FPS, 50 FPS, 60 FPS, or 120 FPS, etc. Therefore, there is a very obvious temporal redundancy in the video. Alternatively, in other words, there is a large temporal correlation in the video. The inter prediction uses this temporal correlation to improve the compression efficiency. The inter prediction often uses “motion” to use the temporal correlation. A very simple “motion” model is that an object is at a certain position on a picture corresponding to a certain moment, and after a certain period of time, the object translates to another position on the picture corresponding to this moment. This is a basic and commonly used translation motion in the video coding and decoding. The inter prediction uses the motion information to represent “motion”. The basic motion information includes information of a reference frame (or, referred to as a reference picture) and information of a Motion Vector (MV). The codec determines the reference picture according to the information of the reference picture, and determines a coordinate of a reference block according to the information of the MV and a coordinate of the current block. The reference block is determined by using the coordinate of the reference block in the reference picture. Taking the determined reference block as a prediction block is a most basic prediction method for the inter prediction.
The motion in the video is not always such simple motion. Even the motion considered as translation may have slight variations over time, including slight deformation, variation of luma, variation of noise, etc. More than one reference block may be used to predict the current block, thereby achieving a better prediction effect. For example, in bidirectional prediction, two reference blocks are used to predict the current block. The two reference blocks may use a forward reference block and a backward reference block. It is also allowable that the two reference blocks are both forward reference blocks or backward reference blocks. The so-called “forward” refers to that a time corresponding to the reference picture occurs before a current frame, and “backward” refers to that the time corresponding to the reference picture occurs after the current frame. Alternatively, “forward” refers to that a position of the reference picture in the video occurs before the current frame, and “backward” refers to that the position of the reference picture in the video occurs after the current frame. Alternatively, “forward” refers to that a picture order count (POC) of the reference picture is less than a POC of the current frame, and “backward” refers to that the POC of the reference picture is greater than the POC of the current frame. Future video coding and decoding standards may support prediction of multiple reference blocks. A simple method for generating a prediction block by using two reference blocks is to average pixel values at positions corresponding to the two reference blocks to obtain the prediction block. In order to obtain a better prediction result, weighted averaging may also be used, such as Bi-prediction with CU-level Weight (BCW) used in VVC. A Geometric Partitioning Mode (GPM) in the VVC may also be understood as a special bidirectional prediction. In order to use the bidirectional prediction, it is naturally necessary to find two reference blocks, and then two sets of information of reference pictures and information of MVs are required.
The motion in the video is not only a simple translation, but also includes scaling, rotation, distortion, deformation and various complex motions. Affine is used in the VVC to simulate some of simple motions. An affine model in the VVC uses two or three control points, and derives MV of each sub-block in the current block by using a linear model according to these control points. A reason why only the MV is mentioned here instead of the motion information is because both of them point to the same reference picture. It may be understood that an ordinary translational motion is to find a “whole block” from the reference picture, while the affine is to find a set of “sub-blocks” which are not neighbouring one by one from the reference picture. The above descriptions are all in the scope of unidirectional prediction, and the affine may also implement the bidirectional prediction or prediction of more “reference blocks”. The reference block mentioned here is composed of sub-blocks. In a specific implementation, the unidirectional motion information in a data structure of affine motion information may include information of a reference picture and information of two to three MVs, or two to three sets of information of reference pictures and information of MVs. However, information of these reference pictures may be the same.
Intra Block Copy (IBC) may significantly improve the compression efficiency of screen content coding, so that the IBC is used for screen content coding from HEVC to VVC. The screen content is different from the camera captured content, and the screen content is generated by a computer. The screen content has no noise, contains text, computer graphics, or the like, and has clear boundaries. There are a lot of repeated contents in the screen content. As shown in
As mentioned above, the inter prediction uses the reference block in the reference picture as the prediction block of the current block, and the reference picture is not a current picture. However, the IBC finds a block from coded and decoded parts of the current picture (referred to as reconstructed parts), as the prediction block of the current block. In some situations, the IBC is also referred to as intra picture block compensation or current picture referencing (CPR). Names of the IBC are not limited in the embodiment, and the above names are equivalent or interchangeable, unless otherwise specially indicated.
The IBC uses a Block Vector (BV) to represent a position difference between the current block and the reference block. The coder determines a best matching block of the current block in a search range through a block matching method, and codes the BV. There are many methods for coding the BV, which are not elaborated here. The IBC may be considered as an intra prediction method, or may be considered as another type of prediction method independent of the intra prediction and the inter prediction.
A Template Matching (TM) method is used in the inter prediction first, which uses a correlation between neighbouring pixels and takes some areas around the current block as templates. When the current block is coded and decoded, left and upper sides of the current block have been coded and decoded according to a coding order. Of course, when it is implemented on a hardware decoder, it is not necessarily ensured that the left and upper sides of the current block have been decoded when decoding of the current block starts. Of course, what mentioned here is an inter block. For example, in HEVC, when an inter coded block generates a prediction block, surrounding reconstructed pixels are not required, therefore a prediction process of the inter block may be carried out in parallel. However, an intra coded block requires reconstructed pixels at the left and upper sides as reference pixels. In theory, the left and upper sides of the current block are available, that is, it may be achieved by making corresponding adjustments to hardware design. Relatively speaking, the right and lower sides of the current block are unavailable in a coding order in the video standard (such as VVC).
As shown in
Intra Template Matching Prediction (intraTMP) is also a prediction technology. As mentioned above, the TM may reduce overhead of coding the MV, that is, the TM may reduce overhead of coding the BV. An example is that it is unnecessary to code the BV, and a matching block found by the TM is directly used as a prediction block of an intraTMP mode of the current block.
An example of intraTMP is shown in
As mentioned above, an important reason why the IBC may significantly improve the compression efficiency of screen content coding is that a lot of repeated blocks may be found in the screen content, and the screen content usually has sharp boundaries. In terms of color (luma and chroma), there may be a situation where pieces of areas have the same color (luma and chroma). There are also approximately repeated blocks in the camera captured content. Even though influences of slight variations of noise and luma, a perspective angle or other reasons are considered, it is undeniable that repeated textures are present in the camera captured content, such as a floor in
The IBC and the intraTMP or other technologies may be used in the camera captured content or a natural sequence. However, considering that what is more in the camera captured content are approximately repeated textures, a method of directly using the best matching block or the reference block found based on the IBC and the intraTMP or other technologies as the prediction block of the current block needs to be subject to some optimization, so as to achieve coding which is more suitable for the camera captured content. In the embodiments of the disclosure, the mainly discussed contents are a problem of how to generate the prediction block from the reference block, in case that the reference block is obtained based on the IBC and the intraTMP or other technologies.
An embodiment of the disclosure provides a coding method.
In operation 141, a coder determines a first reference block of a current block.
In operation 142, the coder obtains a first intra prediction value of the current block according to sample values of a reconstructed area neighbouring the current block and a sample value of the first reference block.
In operation 143, the coder obtains a residual value of the current block according to the first intra prediction value of the current block and a sample value of the current block.
In operation 144, the coder generates a bitstream according to the residual value.
In the embodiment of the disclosure, after obtaining the first reference block of the current block, the coder does not directly use the sample value of the reference block as the first intra prediction value of the current block, instead, the coder further determines the first intra prediction value according to the sample values of the reconstructed area neighbouring the current block and the sample value of the first reference block. That is, when the first intra prediction value is determined, not only the sample value of the first reference block are considered, but also the sample values of the reconstructed area neighbouring the current block are considered, so that the first intra prediction value obtained finally is more accurate. Therefore, on one hand, the coding performance of a picture may be improved, the coding efficiency may be improved, and the bitstream overhead can be saved, or the like, it is especially beneficial to improve the coding and decoding performance of a picture with approximately repeated textures (such as a camera captured picture); on the other hand, a boundary effect of the picture caused by directly using the sample value of the first reference block as the first intra prediction value (i.e., a problem of unnatural transition between blocks of the picture) can be reduced.
Further optional implementations of each of the above operations and relevant nouns, or the like will be described below respectively.
In operation 141, the coder determines a first reference block of a current block.
In the embodiments of the disclosure, methods for determining the first reference block are not limited. In some embodiments, the first reference block may be obtained based on one reference block. For example, the sample value of the first reference block is equal to a sample value of the one reference block, that is, the one reference block is used as the first reference block.
In some other embodiments, the first reference block is obtained based on a weighted sum of multiple reference blocks. Further, in some embodiments, a weighted average value of sample values at corresponding positions of multiple reference blocks is used as a sample value at a corresponding position in the first reference block.
It should be noted that in the embodiments of the disclosure, when the sample value of the first reference block is obtained by weighted averaging, weight coefficient values of multiple reference blocks may be the same or different, and weight coefficient values of different samples in the reference block participating in the weighted averaging may be the same or different. The weight coefficient value of the samples of the reference block may be set according to a relative position of the reference block to the current block and/or a confidence of the reference block. A possible embodiment is that a weight coefficient value of the reference block obtained based on the IBC is greater than a weight coefficient of the reference block obtained based on the intraTMP mode; another possible embodiment is that the weight coefficient value of the reference block obtained based on the IBC is less than the weight coefficient of the reference block obtained based on the intraTMP mode; or, the weight coefficient value of the reference block obtained based on the IBC is equal to the weight coefficient of the reference block obtained based on the intraTMP mode.
In the embodiment of the disclosure, methods for determining the one reference block and methods for determining the multiple reference blocks are not limited.
In some embodiments, the one reference block is a reference block obtained in an IBC mode or an intraTMP mode.
In some embodiments, the multiple reference blocks are reference blocks obtained in an IBC mode and/or an intraTMP mode.
Further, in some embodiments, the reference block obtained based on the IBC mode is located in a picture (frame) where the current block is located.
Specifically, in some embodiments, the reference block obtained in the intraTMP mode may be obtained by the coder as follows. Based on the intraTMP mode, a first matching block of the current block is determined. The one reference block is equal to the first matching block. The multiple reference blocks include one first matching block or K first matching blocks, K is equal to or greater than 1. When the multiple reference blocks include one first matching block, this matching block is a reconstructed block corresponding to a minimum distortion cost. When the multiple reference blocks include K first matching blocks, the K first matching blocks are K reconstructed blocks with the minimum distortion cost, or reconstructed blocks with a distortion cost less than a cost threshold.
Specifically, in some embodiments, the reference block obtained in the IBC mode may be obtained by the coder as follows. Based on the IBC mode, a second matching block matched with an original sample value of the current block is searched from a reconstructed area of the current frame. The one reference block is equal to the second matching block. The multiple reference blocks include one second matching block or L second matching blocks, L is equal to or greater than 1. When the multiple reference blocks include one second matching block, this matching block is a reconstructed block with a minimum error from the sample value of the current block. When multiple reference blocks include L second matching blocks, the L second matching blocks are L reconstructed blocks with the minimum error from the sample value of the current block, or reconstructed blocks with a sample value error less than an error threshold. On the other hand, the coder generates a bitstream according to BVs of the current block and the second matching block, so that the decoder can obtain the BVs by decoding, thereby determining the one or more reference blocks based on the BVs.
In operation 142, a first intra prediction value of the current block is obtained according to sample values of a reconstructed area neighbouring the current block and a sample value of the first reference block.
In the embodiment of the disclosure, the sample values of the reconstructed area neighbouring the current block may also be understood as the neighbouring reconstructed sample values of the current block, in a word, it may refer to the sample values of the reconstructed area around the current block. Specific reference to which reconstructed area is not limited. In some embodiments, the reconstructed area includes an upper neighbouring area of the current block and/or a left neighbouring area of the current block. In the embodiment of the disclosure, the upper neighbouring area may include a row of samples or multiple rows of samples, and the left neighbouring area may include a column of samples or multiple columns of samples.
In the embodiment of the disclosure, specific embodiments of operation 142 are not limited and may be various embodiments, in a word, as long as when the first intra prediction value is determined, the sample values of the reconstructed area neighbouring the current block and the sample value of the first reference block participate in such determination. For example, the first intra prediction value may be determined by methods described in the following first to seventh embodiments.
In the first embodiment, the sample values of the reconstructed area neighbouring the current block and the sample value of the first reference block are filtered to obtain the first intra prediction value of the current block.
Further, in some embodiments, the sample values of the reconstructed area neighbouring the current block and the sample value of the first reference block are filtered by using a filtering template to obtain the first intra prediction value of the current block.
In some embodiments, the filtering template may also be understood as a filter, a coefficient matrix, or a filter matrix, etc. However, in the embodiment of the disclosure, shape and size of the filtering template are not limited, in a word, as long as when the first intra prediction value of at least one sample of the current block is determined, at least one neighbouring reconstructed sample and at least one sample of the first reference block participate in the calculation. In an example, the filtering template is an M×M filter matrix. M is greater than 1, for example, M-3 or 5, etc. In another example, the filtering template may also be a one-dimensional filter of M×1 or 1×M. In yet another example, the filtering template may also be a filter with other numbers of taps.
A filter coefficient of the filtering template is not limited. That is, values of elements in the filter matrix are not limited and may be set according to specific performance requirements.
In addition, specific filtering methods are not limited. In some embodiments, an area composed of the first reference block and the reconstructed area may be filtered by using the filtering template to obtain the first intra prediction value of the current block.
Further, in some embodiments, a position of the first reference block in the composition area relative to the reconstructed area is consistent with a position of the current block relative to the reconstructed area. For example, as shown in
For example, as shown in
As shown in
On the other hand, it may also be necessary to control the value of pred[x][y] to be in an allowable numerical range, such as a range from 0 to (1<<bitdepth)−1, here bitdepth is a bit width used by pred[x][y].
In the second embodiment, the first intra prediction value of the current block is obtained according to a weighted sum of the sample values of the first reference block and the sample values of the reconstructed area.
Further, in some embodiments, the second embodiment may be implemented as follows. A first intra prediction value of a fourth sample of the current block is obtained according to a weighted sum of a sample value of a first sample of the first reference block and sample values of a second sample and/or a third sample of the reconstructed area. A position of the first sample corresponds to a position of the fourth sample, the second sample at least includes at least one sample in a same column as the fourth sample in an upper neighbouring area of the current block, and the third sample at least includes at least one sample in a same row as the fourth sample in a left neighbouring area of the current block.
Still further, in some embodiments, a weight coefficient of the second sample and a weight coefficient of the third sample are preset.
Alternatively, the weight coefficient of the second sample is determined according to the position of the fourth sample, a position of the second sample and/or a size of the current block, and the weight coefficient of the third sample is determined according to the position of the fourth sample, a position of the third sample and/or the size of the current block.
For example, the prediction value at the position (x, y) of the current block is set as pred[x][y], here y ranges from 0 to height −1, and x ranges from 0 to width −1. The first intra prediction value of the sample at (x, y) may be determined according to the following formula:
Here ref[x][y] is a sample value of the corresponding position in the reference block determined based on the IBC mode or the intraTMP mode or other modes. As shown in
It may also be necessary to control the value of pred[x][y] to be within an allowable numerical range, such as a range from 0 to (1<<bitdepth)−1, here bitdepth is a bit width used by pred[x][y].
It should be noted that the reference block and the current block are not illustrated separately in
In the third embodiment, intra prediction is performed on the current block according to the sample values of the reconstructed area to obtain a second intra prediction value of the current block. The first intra prediction value of the current block is obtained according to a weighted sum of the sample value of the first reference block and a second intra prediction value of a corresponding sample in the current block.
Further, in some embodiments, the intra prediction is performed on the current block by using at least one of a PLANAR mode, a DC mode, or an angular mode.
For example, in some embodiments, the first intra prediction value at the position (x, y) of the current block is set as pred[x][y]. The value of y ranges from 0 to height −1, and the value of x ranges from 0 to width −1, then pred[x][y]=((weight[x][y]*ref[x][y]+(64−weight[x][y])*predPlanar[x][y]+32)>>6). Here weight[x][y] is a weight of the reference block at the position (x, y), and 64−weight[x][y] is a weight of a sample prediction value obtained based on the PLANAR mode at the position (x, y). Here, in order to avoid decimals, the weight is multiplied by 64 and then right-shifted by 6 bits. One possibility is that weight[x][y] is the same for all (x, y), then weight[x][y] may also be written as weight. Another possibility is that weight[x][y] varies for different (x, y).
It may also be necessary to control the value of pred[x][y] to be in an allowable numerical range, such as a range from 0 to (1<<bitdepth)−1, here bitdepth is a bit width used by pred[x][y].
In the fourth embodiment, a sample value offset between a neighbouring area of the first reference block and the reconstructed area is determined, and the first intra prediction value of the current block is determined according to the sample value offset and the sample value of the first reference block. A position of the neighbouring area of the first reference block relative to the first reference block is consistent with a position of the reconstructed area relative to the current block. For example, the neighbouring area of the first reference block includes an upper neighbouring area of the first reference block, and accordingly, the reconstructed area includes an upper neighbouring area of the current block; and/or, the neighbouring area of the first reference block includes a left neighbouring area of the first reference block, and accordingly, the reconstructed area includes a left neighbouring area of the current block.
Further, in some embodiments, a first average value of the sample values of the reconstructed area is determined, a second average value of sample values of the neighbouring area of the first reference block is determined, and the sample value offset is determined according to a difference between the first average value and the second average value.
In the fifth embodiment, a sample value offset between a partial area of the first reference block and the reconstructed area is determined, and the first intra prediction value of the current block is determined according to the sample value offset and the sample value of the first reference block.
Further, in some embodiments, a first average value of the sample values of the reconstructed area is determined, a third average value of sample values of the partial area of the first reference block is determined, and the sample value offset is determined according to a difference between the first average value and the third average value.
An example is to calculate an average value avgRec by using the reconstructed samples in the left column and the upper row of the current block, calculate an average value avgRef by using samples in a left column and an upper row out of the reference block or samples in a leftmost column and an uppermost row within the reference block, and use a difference between the two average values as a sample value offset “offset”, offset=avgRec−avgRef. The first intra prediction value at the position (x, y) of the current block is set as pred[x][y], here y ranges from 0 to height −1, and x ranges from 0 to width −1, then pred[x][y]=ref[x][y]+offset. That is, the first intra prediction value of each position of the current block is equal to a reference value of the corresponding position plus the sample value offset. Here ref[x][y] is a sample value of the corresponding position in the reference block determined based on the IBC mode or the intraTMP mode or other modes.
In the sixth embodiment, a numerical relationship between the sample values of the reconstructed area and sample values of a partial area of the first reference block is determined, and the first intra prediction value of the current block is obtained according to the numerical relationship and the sample value of the first reference block.
In the fifth embodiment and the sixth embodiment, the reconstructed area includes an upper neighbouring area of the current block, and accordingly, the partial area of the first reference block includes an upper area within the first reference block; and/or, the reconstructed area includes a left neighbouring area of the current block, and accordingly, the partial area of the first reference block includes a left area within the first reference block.
In the seventh embodiment, a numerical relationship between the sample values of the reconstructed area and sample values of a neighbouring area of the first reference block is determined, and the first intra prediction value of the current block is obtained according to the numerical relationship and the sample value of the first reference block. A position of the neighbouring area of the first reference block relative to the first reference block is consistent with a position of the reconstructed area relative to the current block. For example, the neighbouring area of the first reference block includes an upper neighbouring area of the first reference block, and accordingly, the reconstructed area includes an upper neighbouring area of the current block; and/or, the neighbouring area of the first reference block includes a left neighbouring area of the first reference block, and accordingly, the reconstructed area includes a left neighbouring area of the current block.
In the embodiment of the disclosure, the numerical relationship may be understood as a linear relationship or a nonlinear relationship, that is, linear model parameters or nonlinear model parameters of the sample values of the reconstructed area and the sample values of the partial area of the first reference block are determined according to the sample values of the reconstructed area and the sample values of the partial area of the first reference block. The linear model parameters may be understood as a linear relationship, which is an example of the numerical relationship; the nonlinear model parameters may be understood as a nonlinear relationship, which is another example of the numerical relationship.
An example is to calculate a linear model by using the reconstructed sample values in the left column and the upper row of the current block, and using sample values in a left column and an upper row out of the reference block or sample values in a leftmost column and an uppermost row within the reference block, here a is a magnification of the linear model, b is an offset of the linear model. The first intra prediction value at the position (x, y) of the current block is set as pred[x][y], here y ranges from 0 to height −1, and x ranges from 0 to width −1, then pred[x][y]=ref[x][y]*a+b. That is, the first intra prediction value of each position of the current block is equal to a value after the linear model acts on a corresponding reference value.
It may also be necessary to control the value of pred[x][y] to be in an allowable numerical range, such as a range from 0 to (1<<bitdepth)−1, here bitdepth is a bit width used by pred[x][y].
In some embodiments, the first intra prediction value is within a set numerical range.
An embodiment of the disclosure further provides a coding method.
In operation 171, a coder determines multiple reference blocks of a current block, here the multiple reference blocks are located in a picture where the current block is located.
In operation 172, the coder obtains a first intra prediction value of the current block according to sample values of the multiple reference blocks.
In operation 173, the coder obtains a residual value of the current block according to the first intra prediction value of the current block and a sample value of the current block.
In operation 174, the coder generates a bitstream according to the residual value.
In the embodiment of the disclosure, accuracy of the first intra prediction value is improved through multi-prediction, that is, the first intra prediction value of the current block is determined according to the sample values of multiple reference blocks, rather than directly using one reference block as the first intra prediction value. In this way, the coding performance of a picture may be improved, for example, the coding efficiency may be improved and the bitstream overhead may be saved, or the like, it is especially beneficial to improve coding and decoding performance of a picture with approximately repeated textures (such as a camera captured picture).
Further optional implementations of each of the above operations and relevant nouns, or the like will be described below respectively.
In operation 171, the coder determines multiple reference blocks of a current block, here the multiple reference blocks are located in a picture where the current block is located.
In some embodiments, the multiple reference blocks are reference blocks obtained in an IBC mode and/or an intraTMP mode. This may be understood by referring to the above explanations and descriptions of the method for determining the multiple reference blocks, which would not be elaborated here to save space.
Further, in some embodiments, the reference block obtained based on the IBC mode is located in a picture (frame) where the current block is located.
In operation 172, the coder obtains a first intra prediction value of the current block according to the sample values of the multiple reference blocks.
In the embodiment of the disclosure, how to obtain the first intra prediction value of the current block based on the sample values of the multiple reference blocks is not limited, and there may be various methods for doing such. In a word, the sample values of multiple reference blocks are considered when the first intra prediction value is determined. In some embodiments, the first intra prediction value of the current block is obtained according to a weighted sum of the sample values of the multiple reference blocks.
For example, the reference block obtained based on the intraTMP mode is taken as an example, when a template matching block is searched based on the intraTMP mode, in a limited search range: a matching block with a minimum cost is determined as a reference block ref0, and its cost on the template is cost0; a matching block with a second minimum cost is determined as a reference block ref1, and its cost on the template is cost1. The first intra prediction value at the position (x, y) of the current block is set as pred[x][y], then
A method for determining weight is weight=cost0*64/(cost0+cost1). Considering that the cost of performing division by the hardware is very great, the method for deriving the weight may be replaced by a disguised division, such as table lookup or the like, which is not elaborated here.
It may also be necessary to control the value of pred[x][y] to be in an allowable numerical range, such as a range from 0 to (1<<bitdepth)−1, here the bitdepth is a bit width used by pred[x][y].
An embodiment of the disclosure provides a decoding method.
In operation 181, a decoder determines a first reference block of a current block.
In operation 182, the decoder obtains a first intra prediction value of the current block according to sample values of a reconstructed are a neighbouring the current block and a sample value of the first reference block.
In operation 183, the decoder determines a reconstructed value of the current block according to the first intra prediction value of the current block.
Further optional implementations of each of the above operations and relevant nouns, or the like will be described below respectively.
In operation 181, the decoder determines a first reference block of a current block.
In some embodiments, the first reference block is obtained based on one reference block, or, the first reference block is obtained based on a weighted sum of multiple reference blocks.
Further, in some embodiments, the one reference block is a reference block obtained in an IBC mode or an intraTMP mode.
Further, in some embodiments, the multiple reference blocks are reference blocks obtained in the IBC mode and/or the intraTMP mode.
Still further, in some embodiments, the reference block obtained based on the IBC mode is located in a picture (frame) where the current block is located.
Specifically, in some embodiments, the reference block obtained in the IBC mode may be obtained by the decoder as follows. A bitstream is decoded, and it is determined that the intra prediction modes used by the current block include the IBC mode. The BV of the current block is obtained. A part or all of reference blocks in the one reference block or the multiple reference blocks are determined according to the BV.
It should be noted that the technical details not disclosed in operation 181 and its corresponding embodiments may be understood by referring to the explanations and descriptions of operation 141 and its corresponding embodiments in the above coding method. Therefore, in order to save space and avoid repeated descriptions, some technical details of operation 181 are not explained and described any more here.
In operation 182, the decoder obtains a first intra prediction value of the current block according to sample values of a reconstructed area neighbouring the current block and a sample value of the first reference block.
Similarly, implementation methods and specific implementation details of operation 182 may be understood by referring to the explanations and descriptions of operation 142 in the above coding method. In other words, methods for determining the first intra prediction value at the decoding side and the coding side are the same. Therefore, in order to save space and avoid repeated descriptions, some technical details of operation 182 are not explained and described any more here.
In operation 183, the decoder determines a reconstructed value of the current block according to the first intra prediction value of the current block.
In some embodiments, the decoder may decode the bitstream to obtain a residual value of the current block, and determine the reconstructed value of the current block according to the residual value of the current block and the first intra prediction value.
Further, in some embodiments, a reconstructed value of a sample of the current block may be obtained according to a sum of a residual value of the sample and a first intra prediction value of the sample. For example, the reconstructed value of the sample of the current block is equal to the sum of the residual value of the sample and the first intra prediction value of the sample.
An embodiment of the disclosure further provides a decoding method.
In operation 191, a decoder determines multiple reference blocks of a current block. The multiple reference blocks are located in a picture where the current block is located.
In some embodiments, the multiple reference blocks are reference blocks obtained in an IBC mode and/or an intraTMP mode.
Further, in some embodiments, the reference block obtained based on the IBC mode is located in a picture (frame) where the current block is located.
It should be noted that technical details not disclosed in operation 191 and its corresponding embodiments may be understood by referring to the explanations and descriptions of operation 171 or operation 141 and the corresponding embodiments in the above coding method. Therefore, in order to save space and avoid repeated descriptions, some technical details of operation 191 are not explained and described any more here.
In operation 192, the decoder obtains a first intra prediction value of the current block according to sample values of the multiple reference blocks.
Similarly, implementation methods and specific implementation details of operation 192 may be understood by referring to explanations and descriptions of operation 171 in the above coding method. In other words, methods for determining the first intra prediction value at the decoding side and the coding side are the same. Therefore, in order to save space and avoid repeated descriptions, some technical details of operation 192 are not explained and described any more here.
In operation 193, the decoder determines a reconstructed value of the current block according to the first intra prediction value of the current block.
Implementation methods and specific implementation details of operation 193 may be understood by referring to the above explanations of operation 183, and thus are not elaborated here.
In the embodiment of the disclosure, the multiple control methods of the above coding/decoding method are also provided, that is, the control methods are applicable to both control of the decoding method and control of the coding method.
A first control method is to use the coding/decoding method described in the embodiment of the disclosure by default.
A second method is to determine, according to a numerical value of a first flag bit, whether the first intra prediction value of the current block is determined by using the coding/decoding method.
In the second method, a further implementation is for example, when a numerical value of a first flag bit is equal to a first numerical value, whether the first intra prediction value of the current block is determined by using the coding/decoding method is determined according to a relationship between a template matching cost of the current block and a reference block obtained in an intraTMP mode and a first threshold.
Still further, in some embodiments, when the template matching cost is less than the first threshold, the first intra prediction value of the current block is equal to the sample value of the first reference block.
Still further, in some embodiments, when the template matching cost is equal to or greater than the first threshold, the first intra prediction value of the current block is determined by using the coding/decoding method.
A third method is to determine, according to a relationship between a template matching cost of the current block and a reference block obtained in the intraTMP mode and a first threshold, whether the first intra prediction value of the current block is determined by using the coding/decoding method.
In the third method, a further implementation is for example, when the template matching cost is less than the first threshold, the first intra prediction value of the current block is equal to the sample value of the first reference block.
In the third method, a further implementation is for example, when the template matching cost is equal to or greater than the first threshold, the first intra prediction value of the current block is determined by using the coding/decoding method.
In the embodiment of the disclosure, the magnitudes of the first numerical value and the first threshold are not limited, and a number of bits representing the first flag bit is not limited, for example, it may be 1 bit, and accordingly, the first numerical value may be 1 or 0.
An exemplary application of the embodiment of the disclosure in an actual application scenario will be described below.
A decoding process of the IBC may be generally summarized as follows. A bitstream is parsed, and whether the IBC is used by the current block is determined. If the IBC is used by the current block, the BV of the current block is determined. A reference block is determined according to the BV. The reference block is used as a prediction block of the current block.
Another statement of using the reference block as the prediction block is to set a value of each position of the prediction block as a value of a corresponding position of the reference block, or to set a prediction value as the value of the corresponding position of the reference block.
A decoding process of the IntraTMP may be generally summarized as follows. A bitstream is parsed, and whether the IntraTMP is used by the current block is determined. If the IntraTMP is used by the current block, the decoder determines a reference block by using template matching search. The reference block is used as a prediction block of the current block.
Another statement of using the reference block as the prediction block is to set a value of each position of the prediction block as a value of a corresponding position of the reference block, or to set a prediction value as the value of the corresponding position of the reference block.
It may be seen that a difference between the two decoding processes is how to determine the reference block. The IBC determines the BV by (parsing the bitstream) and determines the reference block according to the BV. As a special type of the IBC, the intraTMP determines the reference block through the template matching search. As to whether the BV is used when the intraTMP determines the reference block, the BV may be used or may not be used during implementation, which is not limited here.
In the embodiment of the disclosure, the problem to be discussed is how to generate a prediction block from a reference block. The solution may be used in a camera captured content or a natural sequence. The solution may be applied to the IBC, the intraTMP and other IBC technologies.
In the embodiment of the disclosure, the first intra prediction value is generated after a processing process according to the reference block. That is, a step is added after the reference block is found. As to a certain position of the current block, a value of a corresponding position of the reference block is referred to as a reference value. The solution generates the first intra prediction value after a processing process according to the reference value, which includes a method 1 and a method 2 described in the following embodiments.
In the method 1, the prediction block is obtained according to the reference block and reconstructed pixels around the current block.
As to the camera captured content, there may be a difference in color (luma and chroma) between the reference block and the current block, and there may be a strong correlation between the reconstructed pixels around the current block and the current block, especially between pixels inside and outside blocks neighbouring left and upper boundaries of the current block. As to the camera captured content, a block with a minimum cost may be found based on the IBC. Similarly, a block with a minimum template cost may be found based on the intraTMP. As shown in
More specifically, a first method is to filter, by using a value of the reference block and values of the reconstructed pixels around the current block, to obtain a prediction value. For example, a filter may be provided, and an example is that the filter is a rectangular filter, such as a 3×3 or 5×5 filter. The reference value and the values of the reconstructed pixels around the current block are placed at corresponding positions respectively and filtered with the filter. Specifically, an example is to filter pixels in one or several upper and left rows (columns), and another example is to filter all the pixels of the current block.
In the embodiment of the disclosure, a filter in a horizontal direction and a one-dimensional filter in a vertical direction may also be used for filtering respectively. In the embodiment of the disclosure, a filter with other numbers of taps may also be used. In the embodiment of the disclosure, more reconstructed pixels around the current block may also be used, such as two rows and two columns of reconstructed pixels, or more reconstructed pixels.
More specifically, a second method is to obtain a prediction value by weighting the value of the reference block and the values of the reconstructed pixels around the current block. Specific implementations of the second method may refer to the above explanations and descriptions of specific implementations of the second embodiment, of which repeated descriptions are not made here to save space.
More specifically, a third method is to obtain a new prediction value by weighting the value of the reference block and a prediction value generated by the reconstructed pixels around the current block. An example is to obtain a new prediction value by weighting the value of the reference block and a prediction value of the PLANAR mode. Specific implementations of the second method may refer to the above explanations and descriptions of specific implementations of the third embodiment, of which repeated descriptions are not made here to save space.
The above first to third methods may be used separately or in combination.
More specifically, a fourth method is to calculate an offset or a linear model or a nonlinear model by using the value of the reference block and the reconstructed pixels around the current block, and determine the first intra prediction value by using the reference block and the offset or the linear model or the nonlinear model. Specific implementations of determining the first intra prediction value by using the reference block and the offset may refer to the above descriptions and explanations of the fourth embodiment and the fifth embodiment, of which descriptions are not repeated here to avoid repetition. Specific implementations of determining the first intra prediction value by using the reference block and the linear model or the nonlinear model may refer to the above descriptions and explanations of the sixth embodiment and the seventh embodiment, of which descriptions are not repeated here to avoid repetition.
In the method 2, a method is to determine N reference blocks by using a BV or a template matching method, and determine a prediction block according to the N reference blocks. N is an integer greater than 1, and an example is that N is 2. It is known that it is difficult for the IBC or the intraTMP to find a completely matching block or a completely template matching block in the camera captured content. Therefore a method of weighting multiple reference blocks may be used to improve the average accuracy of prediction.
More specifically, in some embodiments, all of the N reference blocks may be determined by using the BV, which may be considered as changing single prediction into dual prediction or multi-prediction based on a general IBC.
In some other embodiments, all of the N reference blocks may be determined by using the template matching method, which may be considered as changing single prediction into dual prediction or multi-prediction based on the intraTMP.
In some other embodiments, some of the N reference blocks may be determined by using the BV, and some of the N reference blocks may be determined by using the template matching method. For example, if N is 2, one reference block is determined by using the BV, and another one reference block is determined by using template matching. It should be noted that there is an overhead for transmitting the BV in the bitstream, while there is no overhead if the template matching method is used. On the other hand, the coder has more operating space in the method of transmitting the BV in the bitstream, the coder may determine the BV according to a coding strategy and/or rate-distortion cost or other considerations, and the coder may use an original content of the current block when it makes decisions. The template matching method requires the coder and the decoder to perform the same operation. Therefore when the matching block is searched, only the template may be used, and the original content of the current block cannot be used, which has a certain limitation. Therefore, a method of combining the method of transmitting the BV in the bitstream and the template matching method may use respective advantages of the two methods to improve the compression efficiency.
It should be noted that embodiments not disclosed in the method 2 may be understood by referring to the above explanations and descriptions of specific implementations of operation 172, of which descriptions are not repeated here to save space.
The above method 1 and method 2 may be used separately or in combination.
In some embodiments, a control method of the above solution is also provided. One possibility is to use the above prediction solution by default. Another possibility is to indicate whether the above prediction solution may be used by a flag bit “flag”, which may be a sequence level (sps flag), a picture level (pps flag), a slice level (slice header flag) or a block level flag, etc. Yet another possible method is to adaptively determine whether the above prediction solution is used. For example, in the intraTMP, when the reference block is searched, a template cost of each searched block may be obtained. Then, whether the above method is used may be determined according to the cost. A threshold may be provided. If the template cost of the reference block is less than (or less than or equal to) the threshold, the above prediction solution is not used in this case, that is, the reference value is directly used as the prediction value. On the contrary, that is, if the template cost of the reference block is greater than (or equal to or greater than) the threshold, the above prediction solution is used, that is, a processing process is performed on the reference value to generate the prediction value. Specifically, a possible situation is that the threshold is 0.
Of course, an adaptive switching method may also be used when control is made by using the above flag bit. For example, there is a flag at the sequence level, to control whether the above prediction solution may be used at the current sequence. If the flag at the sequence level indicates that the above prediction solution may be used, an adaptive method may be used at the block level, to determine whether the method is used.
In the embodiment of the disclosure, the reference block based on the IBC or the intraTMP or other technologies is further processed, to make it more suitable for coding and decoding the camera captured content, thereby improving the compression efficiency. Specifically, the above method 1 simultaneously uses the reference block which is based on the IBC, the intraTMP or other technologies, and the correlation between the reconstructed pixels around the current block and the current block, and may reduce a boundary effect caused by direct copying the reference block. The method 2 uses multi-prediction to improve average accuracy of prediction.
In the embodiment of the disclosure, the most basic point is to generate a prediction value after a processing process according to the reference block, that is, generate a prediction value after a processing process according to the reference value. That is, a step is added after the reference block is found by using the IBC or the intraTMP or other technologies. Further, the method 1 is to generate a prediction block by using the reference block and the reconstructed pixels around the current block. The method 2 is multi-prediction.
It should be noted that “pixel” mentioned in the context may be understood as “sample”.
It should be noted that although operations of the method in the disclosure are described in a specific order in the drawings, it does not require or imply that the operations must be performed in the specific order, or that all of the illustrated operations must be performed to achieve a desired result. Additionally or alternatively, some operations may be omitted, multiple operations may be combined into one operation, and/or one operation may be decomposed into multiple operations, etc. Alternatively, operations in different embodiments may be combined into a new technical solution.
Based on the foregoing embodiments, an embodiment of the disclosure provides a decoding apparatus, which is applied to a decoder.
The first determination module 211 is configured to determine a first reference block of a current block.
The first prediction module 212 is configured to obtain a first intra prediction value of the current block according to sample values of a reconstructed area neighbouring the current block and a sample value of the first reference block.
The second determination module 213 is configured to determine a reconstructed value of the current block according to the first intra prediction value of the current block.
In some embodiments, the first prediction module 212 is configured to filter the sample values of the reconstructed area neighbouring the current block and the sample value of the first reference block to obtain the first intra prediction value of the current block.
In some embodiments, the first prediction module 212 is configured to filter the sample values of the reconstructed area neighbouring the current block and the sample value of the first reference block by using a filtering template to obtain the first intra prediction value of the current block.
In some embodiments, the first prediction module 212 is configured to obtain the first intra prediction value of the current block according to a weighted sum of the sample value of the first reference block and the sample values of the reconstructed area.
In some embodiments, the first prediction module 212 is configured to obtain a first intra prediction value of a fourth sample of the current block according to a weighted sum of a sample value of a first sample of the first reference block and sample values of a second sample and/or a third sample of the reconstructed area. A position of the first sample corresponds to a position of the fourth sample, the second sample at least includes at least one sample in a same column as the fourth sample in an upper neighbouring area of the current block, and the third sample at least includes at least one sample in a same row as the fourth sample in a left neighbouring area of the current block.
In some embodiments, a weight coefficient of the second sample and a weight coefficient of the third sample are preset. Alternatively, the weight coefficient of the second sample is determined according to the position of the fourth sample, a position of the second sample and/or a size of the current block, and the weight coefficient of the third sample is determined according to the position of the fourth sample, a position of the third sample and/or the size of the current block.
In some embodiments, the first prediction module 212 is configured to: perform intra prediction on the current block according to the sample values of the reconstructed area to obtain a second intra prediction value of the current block; and obtain the first intra prediction value of the current block according to a weighted sum of the sample value of the first reference block and a second intra prediction value of a corresponding sample in the current block.
In some embodiments, the intra prediction is performed on the current block by using at least one of a PLANAR mode, a DC mode, or an angular mode.
In some embodiments, the first prediction module 212 is configured to: determine a sample value offset between a neighbouring area of the first reference block and the reconstructed area, here a position of the neighbouring area of the first reference block relative to the first reference block is consistent with a position of the reconstructed area relative to the current block; and determine the first intra prediction value of the current block according to the sample value offset and the sample value of the first reference block.
In some embodiments, the first prediction module 212 is configured to determine a first average value of the sample values of the reconstructed area; determine a second average value of sample values of the neighbouring area of the first reference block; and determine the sample value offset according to a difference between the first average value and the second average value.
In some embodiments, the first prediction module 212 is configured to: determine a sample value offset between a partial area of the first reference block and the reconstructed area; and determine the first intra prediction value of the current block according to the sample value offset and the sample value of the first reference block.
In some embodiments, the first prediction module 212 is configured to: determine a first average value of the sample values of the reconstructed area; determine a third average value of sample values of the partial area of the first reference block; and determine the sample value offset according to a difference between the first average value and the third average value.
In some embodiments, the first prediction module 212 is configured to: determine a numerical relationship between the sample values of the reconstructed area and sample values of a partial area of the first reference block; and obtain the first intra prediction value of the current block according to the numerical relationship and the sample value of the first reference block.
In some embodiments, the first prediction module 212 is configured to: determine a numerical relationship between the sample values of the reconstructed area and sample values of a neighbouring area of the first reference block, here a position of the neighbouring area of the first reference block relative to the first reference block is consistent with a position of the reconstructed area relative to the current block; and obtain the first intra prediction value of the current block according to the numerical relationship and the sample value of the first reference block.
In some embodiments, the first reference block is obtained based on one reference block, or the first reference block is obtained based on a weighted sum of multiple reference blocks.
In some embodiments, the one reference block is a reference block obtained in an IBC mode or an intraTMP mode.
In some embodiments, the multiple reference blocks are reference blocks obtained in an IBC mode and/or an intraTMP mode.
In some embodiments, the decoding apparatus 21 further includes a first control module, which is configured to determine, according to a numerical value of a first flag bit, whether the first intra prediction value of the current block is determined by using the first prediction module 212.
In some other embodiments, the decoding apparatus 21 further includes a second control module, which is configured to, when the numerical value of the first flag bit is equal to a first numerical value, determine, according to a relationship between a template matching cost of the current block and a reference block obtained in an intraTMP mode and a first threshold, whether the first intra prediction value of the current block is determined by using the first prediction module 212.
In some other embodiments, the decoding apparatus 21 further includes a third control module, which is configured to determine, according to a relationship between a template matching cost of the current block and a reference block obtained in the intraTMP mode and a first threshold, whether the first intra prediction value of the current block is determined by using the first prediction module 212.
In some embodiments, when the template matching cost is less than the first threshold, the first intra prediction value of the current block is equal to the sample value of the first reference block.
In some embodiments, the second control module or the third control module is configured to determine the first intra prediction value of the current block by using the first prediction module 212 when the template matching cost is equal to or greater than the first threshold.
Based on the foregoing embodiments, an embodiment of the disclosure further provides a decoding apparatus, which is applied to a decoder.
The third determination module 221 is configured to determine multiple reference blocks of a current block. The multiple reference blocks are located in a picture where the current block is located.
The second prediction module 222 is configured to obtain a first intra prediction value of the current block according to sample values of the multiple reference blocks.
The second determination module 223 is configured to determine a reconstructed value of the current block according to the first intra prediction value of the current block.
In some embodiments, the second prediction module 222 is configured to obtain the first intra prediction value of the current block according to a weighted sum of the sample values of the multiple reference blocks.
In some embodiments, the multiple reference blocks are reference blocks obtained in an IBC mode and/or an intraTMP mode.
In some embodiments, the decoding apparatus 22 further includes a first control module, which is configured to determine, according to a numerical value of a first flag bit, whether the first intra prediction value of the current block is determined by using the second prediction module 222.
In some embodiments, the decoding apparatus 22 further includes a second control module, which is configured to, when the numerical value of the first flag bit is equal to a first numerical value, determine, according to a relationship between a template matching cost of the current block and a reference block obtained in an intraTMP mode and a first threshold, whether the first intra prediction value of the current block is determined by using the second prediction module 222.
In some other embodiments, the decoding apparatus 22 further includes a third control module, which is configured to determine, according to a relationship between a template matching cost of the current block and a reference block obtained in the intraTMP mode and a first threshold, whether the first intra prediction value of the current block is determined by using the second prediction module 222.
In some embodiments, the second control module or the third control module is configured to determine the first intra prediction value of the current block by using the second prediction module 222 when the template matching cost is equal to or greater than the first threshold.
The above descriptions of the decoding apparatus embodiments are similar to the above descriptions of the coding/decoding method embodiments, and have advantageous effects similar to the coding/decoding method embodiments. Technical details not disclosed in the apparatus embodiments of the disclosure may be understood by referring to the descriptions of the coding/decoding method embodiments of the disclosure.
An embodiment of the disclosure provides a coding apparatus applied to a coder.
The first determination module 231 is configured to determine a first reference block of a current block.
The first prediction module 232 is configured to obtain a first intra prediction value of the current block according to sample values of a reconstructed area neighbouring the current block and a sample value of the first reference block.
The generation module 233 is configured to generate a bitstream according to the first intra prediction value of the current block and a sample value of the current block.
In some embodiments, the generation module 233 is configured to: determine a sample residual value of the current block according to the sample value of the current block and the first intra prediction value of the current block; and code the sample residual value of the current block, and write the obtained coded bits into the bitstream.
An embodiment of the disclosure provides a coding apparatus applied to a coder.
The third determination module 241 is configured to determine multiple reference blocks of a current block. The multiple reference blocks are located in a picture where the current block is located.
The second prediction module 242 is configured to obtain a first intra prediction value of the current block according to sample values of the multiple reference blocks.
The generation module 243 is configured to generate a bitstream according to the first intra prediction value of the current block and a sample value of the current block.
In some embodiments, the second prediction module 242 is configured to obtain the first intra prediction value of the current block according to a weighted sum of the sample values of the multiple reference blocks.
The above descriptions of the coding apparatus embodiments are similar to the above descriptions of the coding/decoding method embodiments and the decoding apparatus embodiments, and have advantageous effects similar to the coding/decoding method embodiments and the decoding apparatus embodiments. Technical details not disclosed in the apparatus embodiments of the disclosure may be understood by referring to the descriptions of the coding/decoding method embodiments and the decoding apparatus embodiments of the disclosure.
It should be noted that division of the modules in the apparatus described in the embodiments of the disclosure is schematic and is only a logic function division. There may be other division manners in actual implementations. Furthermore, various functional units in each embodiment of the disclosure may be integrated into a processing unit or may physically exist independently, or two or more than two units may be integrated into a unit. The above integrated unit may be implemented in form of hardware, or in form of software functional units, or in form of a combination of software and hardware.
It should be noted that in the embodiments of the disclosure, if the above methods are implemented in form of a software functional module and sold or used as an independent product, the above methods may also be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of the embodiments of the disclosure substantially or parts making contributions to the related art may be embodied in form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable an electronic device to execute all or part of the method described in each of the embodiments of the disclosure. The foregoing storage medium includes various media capable of storing program codes such as a U disk, a mobile hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, etc. In this way, the embodiments of the disclosure are not limited to any particular combination of hardware and software.
An embodiment of the disclosure provides a computer-readable storage medium, the computer-readable storage medium has stored thereon a computer program, and a method for processing video pictures at the coder side or a method for processing video pictures at the decoder side is implemented when the computer program is executed.
An embodiment of the disclosure provides a decoder. As shown in
The first communication interface 251 is configured to receive and send signals in a process of receiving information from or sending information to other external network elements.
The first memory 252 is configured to store a computer program executable on the first processor 253.
The first processor 253 is configured to perform the decoding method described in the embodiments of the disclosure executing the computer program.
It may be understood that the first memory 252 in the embodiment of the disclosure may be a volatile memory or a nonvolatile memory, or may include both the volatile memory and the nonvolatile memory. The nonvolatile memory may be a ROM, a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM) or a flash memory. The volatile memory may be a Random Access Memory (RAM), and is used as an external high-speed cache. In exemplary but non-limiting descriptions, many forms of RAMs are available, such as a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDRSDRAM), an Enhanced SDRAM (ESDRAM), a Synchlink DRAM (SLDRAM) and a Direct Rambus RAM (DRRAM). The first memory 252 in the system and method described in the disclosure is intended to include, but is not limited to these and any other suitable types of memories.
Furthermore, the first processor 253 may be an integrated circuit chip with a signal processing capability. During implementation, each step in the above method may be completed by an integrated logical circuit in a hardware form in the first processor 253 or an instruction in a software form. The first processor 253 may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logical devices, a discrete gate or a transistor logical device, a discrete hardware component. Various methods, steps and logical block diagrams disclosed in the embodiments of the disclosure may be implemented or executed. The general purpose processor may be a microprocessor, or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the disclosure may be directly embodied to be executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware in the decoding processor and software modules. The software module may be located in a mature storage medium in this field such as a RAM, a flash memory, a ROM, a PROM, or an EEPROM, a register, etc. The storage medium is located in the first memory 252, and the first processor 253 reads information in the first memory 252 and completes the steps of the above method in combination with the hardware thereof.
It may be understood that these embodiments described in the disclosure may be implemented in hardware, software, firmware, middleware, microcode or a combination thereof. As to implementation in hardware, the processing unit may be implemented in one or more ASICs, DSPs, DSP Devices (DSPDs), Programmable Logic Devices (PLDs), FPGAs, general purpose processors, controllers, microcontrollers, microprocessors, other electronic units configured to perform functions described in the disclosure, or a combination thereof. As to implementation in software, the technologies described in the disclosure may be implemented by the modules (such as processes, functions, etc.) performing the functions described in the disclosure. The software codes may be stored in a memory and executed by a processor. The memory may be implemented in or out of the processor.
Optionally, as another embodiment, the first processor 253 is further configured to perform any one of the above method embodiments at the decoder 50 side when executing the computer program.
An embodiment of the disclosure provides a coder. As shown in
The second communication interface 261 is configured to receive and send signals in a process of receiving information from or sending information to other external network elements.
The second memory 262 is configured to store a computer program executable on the second processor 263.
The second processor 263 is configured to perform the coding method described in the embodiments of the disclosure executing the computer program.
It may be understood that hardware functions of the second memory 262 are similar to the hardware functions of the first memory 252, and hardware functions of the second processor 263 are similar to the hardware functions of the first processor 253, which are not described in detail here.
An embodiment of the disclosure provides an electronic device, which includes a processor and a computer-readable storage medium. The processor is configured to execute a computer program. The computer-readable storage medium has stored thereon a computer program. When the computer program is executed by the processor, the coding method and/or the decoding method described in the embodiments of the disclosure are implemented. The electronic device may be various types of devices with video coding and/or decoding capabilities. For example, the electronic device is a mobile phone, a tablet computer, a laptop computer, a personal computer, a television, a projection device, or a monitoring device, etc.
It should be noted here that the above descriptions of the storage medium and device embodiments are similar to the above descriptions of the method embodiments, and have advantageous effects similar to the method embodiments. Technical details not disclosed in the storage medium, storage media and device embodiments of the disclosure may be understood with reference to the descriptions of the method embodiments of the disclosure.
It should be understood that “one embodiment” or “an embodiment” or “some embodiments” mentioned throughout the description may mean that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the disclosure. Therefore, “in one embodiment” or “in an embodiment” or “in some embodiments” present throughout the description does not necessarily refer to the same embodiment. Furthermore, these specific features, structures or characteristics may be combined in one or more embodiments by any suitable manner. It should be understood that in various embodiments of the disclosure, sizes of serial numbers of the above processes do not mean a sequence of execution, and the sequence of execution of the processes should be determined by the function and internal logic, and should not constitute any limitation on implementation processes of the embodiments of the disclosure. The above serial numbers of the embodiments of the disclosure are only for the purpose of descriptions, and do not represent advantages and disadvantages of the embodiments. The above descriptions of various embodiments tend to emphasize differences between various embodiments, and the same or similar portions between various embodiments may refer to each other, which is not elaborated here for the sake of brevity.
In the disclosure, a term “and/or” is only an association relationship describing associated objects and represents that there may be three relationships. For example, object A and/or object B may represent three situations, i.e., independent existence of object A, simultaneous existence of object A and object B, and independent existence of object B.
It should be noted that in the disclosure, terms “including”, “include” or any other variants thereof are intended to encompass a non-exclusive inclusion, so that a process, method, article or apparatus including a series of elements includes not only those elements, but also other elements which are not explicitly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element defined by a statement “including a . . . ” does not preclude presence of additional identical elements in a process, method, article or apparatus including the element.
In several embodiments provided in the disclosure, it should be understood that the disclosed devices and methods may be implemented in other manners. The above embodiments are only schematic. For example, division of the modules is only a logic function division, and there may be other division manners in actual implementations. For example, multiple units or components may be combined or integrated into another system, or some features may be neglected or may not be executed. Furthermore, coupling or direct coupling or communication connection between various displayed or discussed components may be indirect coupling or communication connection implemented through some interfaces, devices or the modules, and may be in electrical, mechanical or other forms.
The above modules described as separate parts may be or may not be physically separated, and parts displayed as modules may be or may not be physical modules, that is, may be located in a place, or may be distributed to multiple network units. Part or all of the modules may be selected to achieve the purpose of the solutions in the embodiments according to actual requirements.
Furthermore, various functional modules in the embodiments of the disclosure may be all integrated into a processing unit, or each module may be separately used as a unit, or two or more than two modules may be integrated into a unit. The above integrated module may be implemented in form of hardware or in form of hardware plus software functional units.
It may be understood by those of ordinary skill in the art that all or part of steps implementing the above method embodiments may be completed by hardware relevant to program instructions, and the foregoing program may be stored in a computer-readable storage medium, and steps including the above method embodiments are executed when the program is executed. The foregoing storage medium includes various media capable of storing program codes such as a mobile storage device, a ROM, a magnetic disk, or an optical disk, etc.
Alternatively, if the above integrated unit of the disclosure is implemented in form of a software functional module and sold or used as an independent product, the above integrated unit may also be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of the embodiments of the disclosure substantially or parts making contributions to the related art may be embodied in form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable an electronic device to execute all or part of the method described in each of the embodiments of the disclosure. The foregoing storage medium includes various media capable of storing program codes such as a mobile storage device, a ROM, a magnetic disk, or an optical disk, etc.
The methods disclosed in several method embodiments provided in the disclosure may be arbitrarily combined without conflict to obtain new method embodiments.
The features disclosed in several product embodiments provided in the disclosure may be arbitrarily combined without conflict to obtain new product embodiments.
The features disclosed in several method or device embodiments provided in the disclosure may be arbitrarily combined without conflict to obtain new method or device embodiments.
The above descriptions are only implementations of the disclosure. However, the scope of protection of the disclosure is not limited thereto. Variation or replacement easily conceived by any technician familiar with this technical field within the technical scope disclosed in the disclosure should fall within the scope of protection of the disclosure. Therefore, the scope of protection of the disclosure should be subject to the scope of protection of the claims.
This application is a continuation of International Patent Application No. PCT/CN2022/125187 filed on Oct. 13, 2022, the content of which is hereby incorporated by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2022/125187 | Oct 2022 | WO |
Child | 19176280 | US |