CN116016929A - Intra-frame prediction encoding and decoding method, electronic device, and computer-readable storage medium - Google Patents
Intra-frame prediction encoding and decoding method, electronic device, and computer-readable storage medium Download PDFInfo
- Publication number
- CN116016929A CN116016929A CN202211463047.2A CN202211463047A CN116016929A CN 116016929 A CN116016929 A CN 116016929A CN 202211463047 A CN202211463047 A CN 202211463047A CN 116016929 A CN116016929 A CN 116016929A
- Authority
- CN
- China
- Prior art keywords
- prediction
- current block
- scheme
- block
- blocks
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The application discloses an intra-frame prediction encoding and decoding method, electronic equipment and a computer readable storage medium. The intra prediction encoding method includes obtaining a current block and at least two prediction blocks of the current block; configuring block weights of at least two prediction blocks according to the magnitude relation of difference values of the at least two prediction blocks and the current block; obtaining a predicted value of the current block by using at least two predicted blocks according to the corresponding block weights; and encoding the current block according to the predicted value of the current block to obtain an encoded code stream. By means of the method, the original image content is better utilized, and the compression rate of the code stream is improved.
Description
Technical Field
The present invention relates to the field of video encoding and decoding, and in particular, to an intra-frame prediction encoding and decoding method, an electronic device, and a computer readable storage medium.
Background
With the development of communication technology, people have higher requirements on the quality of transmitted pictures or videos, and pictures or videos with better quality have more data information. Because the amount of video image data is relatively large, it is often necessary to compress the video pixel data, thereby reducing the amount of data in the video. The compressed data is called video code stream, the video code stream is transmitted to the user terminal through a wired or wireless network, and then decoding and watching are carried out, so that the purposes of reducing network bandwidth and reducing storage space in the transmission process can be realized.
The whole video coding flow comprises the processes of prediction, transformation, quantization, coding and the like, wherein the prediction is divided into two parts of intra-frame prediction and inter-frame prediction. Intra prediction predicts a pixel value of a current pixel according to pixel values (i.e., reference pixels) of pixels surrounding the current pixel within a frame of image. Current Intra prediction techniques include a variety of Intra prediction modes, in which Intra template matching prediction (Intra TMP, intra Template Matching Prediction) is a special Intra prediction mode that searches for a template most similar to a current template from a partially encoded region in the current frame using a reference pixel region formed above and to the left of the current block as the current template. And then obtaining the corresponding matching block as a prediction block of the current block according to the most similar template. The existing IntraTMP only selects one matching block to serve as a prediction block of the current block, and does not utilize more image information, so that the prediction accuracy and the compression efficiency are not improved.
Disclosure of Invention
The main purpose of the present application is to provide an intra-frame prediction encoding and decoding method, an electronic device, and a computer readable storage medium, which can solve the technical problem of how to better utilize original image content in an intra-frame prediction mode and improve the encoding compression rate.
In order to solve the technical problems, a first technical scheme adopted by the application is as follows: an intra prediction encoding method is provided. The method includes obtaining a current block and at least two predicted blocks of the current block; configuring block weights of at least two prediction blocks according to the magnitude relation of difference values of the at least two prediction blocks and the current block; obtaining a predicted value of the current block by using at least two predicted blocks according to the corresponding block weights; and encoding the current block according to the predicted value of the current block to obtain an encoded code stream.
In order to solve the technical problems, a second technical scheme adopted by the application is as follows: an intra prediction decoding method is provided. The method comprises the following steps: acquiring a coded code stream; determining at least two prediction blocks of the current block according to the coded code stream; configuring block weights of at least two prediction blocks according to the magnitude relation of difference values of the at least two prediction blocks and the current block; obtaining a predicted value of the current block by using at least two predicted blocks according to the corresponding block weights; and obtaining the current block according to the coded code stream and the predicted value.
In order to solve the technical problem, a third technical scheme adopted in the application is as follows: an electronic device is provided. The electronic device comprises a memory for storing program data executable by the processor for implementing the method as described in the first and second solutions.
In order to solve the technical problem, a fourth technical scheme adopted in the application is as follows: a computer-readable storage medium is provided. The computer readable storage medium stores program data executable by a processor to implement the method as described in the first and second aspects.
The beneficial effects of this application are: different from the prior art, the method acquires at least two prediction blocks corresponding to the current block. By acquiring more prediction blocks and configuring corresponding block weights for each prediction block in the magnitude relation with the current block difference value, more intra information is combined by using the prediction blocks and the corresponding block weights, i.e. by using more prediction block information. The prediction blocks and the corresponding block weights are further utilized to obtain the prediction value of the current block, and coding is carried out to obtain a code stream, and because more prediction block information is utilized, compared with a single prediction block for predicting the current block to obtain the prediction value and the coded code stream, the prediction result obtained by utilizing more prediction block information is closer to the current block than the single prediction block obtained by directly searching in the search range of the prediction block, so that the compression rate of the finally obtained coded code stream can be improved, and the image quality of the decoded current block can be better.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a first embodiment of an intra prediction encoding method of the present application;
FIG. 2 is a schematic diagram of a prediction block obtained according to a position distance value;
FIG. 3 is a flow chart of a second embodiment of an intra prediction encoding method of the present application;
FIG. 4 is a flow chart of a third embodiment of an intra prediction encoding method of the present application;
FIG. 5 is a flowchart of a fourth embodiment of an intra prediction encoding method of the present application;
FIG. 6 is a flowchart of a fifth embodiment of an intra prediction encoding method of the present application;
FIG. 7 is a flowchart of a sixth embodiment of an intra prediction encoding method of the present application;
FIG. 8 is a flowchart of a seventh embodiment of an intra prediction encoding method of the present application;
FIG. 9 is a flowchart of a first embodiment of an intra prediction decoding method of the present application;
FIG. 10 is a schematic diagram of an embodiment of an electronic device of the present application;
FIG. 11 is a schematic diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The terms "first," "second," and the like in this application are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
Referring to fig. 1, fig. 1 is a flowchart of a first embodiment of an intra prediction encoding method of the present application. Which comprises the following steps:
s11: the method comprises the steps of obtaining a current block and at least two prediction blocks of the current block.
And determining a block needing to be subjected to coding processing, and acquiring at least two corresponding prediction blocks. The at least two prediction blocks are used for processing to encode the current block.
S12: and configuring block weights of at least two prediction blocks according to the magnitude relation of the difference values of the at least two prediction blocks and the current block.
Corresponding block weights are configured for the predicted blocks according to the difference values of the predicted blocks, so that the predicted blocks are combined according to the weight information, and more image information can be utilized.
S13: and obtaining the predicted value of the current block by using at least two predicted blocks according to the corresponding block weights.
And performing weighting operation by using the obtained at least two prediction blocks and the corresponding block weights thereof to obtain a prediction value.
S14: and encoding the current block according to the predicted value of the current block to obtain an encoded code stream.
And encoding the current block according to the obtained predicted value, wherein the obtained code stream comprises residual information between the current block and the predicted value. The receiving end can generate the current block according to the residual information and the prediction block corresponding to the decoded area.
In this embodiment, more prediction blocks are acquired, corresponding block weights are configured for each prediction block according to the magnitude relation of the difference values, and more intra-frame information is combined by using the prediction blocks and the corresponding block weights, that is, by using more prediction block information. The prediction blocks and the corresponding block weights are further utilized to obtain the prediction value of the current block, and coding is carried out to obtain a code stream, and because more prediction block information is utilized, compared with a single prediction block for predicting the current block to obtain the prediction value and the coded code stream, the prediction result obtained by utilizing more prediction block information is closer to the current block than the single prediction block obtained by directly searching in the search range of the prediction block, so that the compression rate of the finally obtained coded code stream can be improved, and the image quality of the decoded current block can be better.
In an embodiment, the discrepancy value is determined based on at least one of the cost value and the location distance value.
The step of configuring the block weights of the at least two prediction blocks according to the magnitude relation of the difference values of the at least two prediction blocks includes: and sequencing at least two prediction blocks from small to large according to the magnitude of the difference value, and obtaining weights of at least two prediction blocks from large to small after sequencing.
In one embodiment, the variance value is a cost value. And taking the cost value of the matching block template and the current block template as the difference value of the matching block and the current block to obtain a prediction block. And (3) using the reference pixel areas formed above and on the left side of the current block as templates, performing template search in a preset encoded area with a certain range, and selecting a certain number of templates according to SAD (Sum of Absolute Difference, sum of absolute errors) results to obtain corresponding matching blocks. And calculating a cost value of the template corresponding to the obtained matching block, sequencing the matching blocks according to the cost value of the template from small to large, and selecting at least two matching blocks with the front sequencing as at least two prediction blocks of the current block. The block weights of at least two predicted blocks are also set according to the corresponding cost values, and the smaller the cost value is, the earlier the ordering is, and the larger the corresponding block weights are.
In one embodiment, the discrepancy value is a location distance value. And using the position distance value of the matching block and the current block as a difference value. And selecting matching blocks with the same size as the current block in the area where the encoding is finished, and calculating the position distance values of the matching blocks and the current block. The matching blocks are ordered from small to large according to the position distance values, and the position distance of the matching blocks is smaller as the matching blocks are closer to the current block. And if the position distance values are the same, sequencing the position distance values according to a preset sequence. After the sorting is completed, at least two matching blocks are selected as at least two prediction blocks of the current block according to the sorting result. The block weights of at least two predicted blocks are also set according to the sizes of the corresponding position distance values, and the smaller the position distance value is, the earlier the ordering is, and the larger the corresponding block weights are. Referring to fig. 2, fig. 2 is a schematic diagram illustrating a prediction block obtained according to a position distance value. As shown in the figure, the current block R1 needs to be encoded, and a prediction block corresponding to R1 needs to be selected. A1, A2, A3, A4, A5 are matching blocks for which encoding has been completed. The position distance between A1, A2 and R1 is a, the position distance between A3, A4 and R1 is b, and the position distance between A5 and R1 is greater than b. Since the position distance values of A1 and A2 are the same, the position distance values of A3 and A4 are further ordered according to the preset sequence, and assuming that the preset sequence is "left side, upper left side", 3 matching blocks are required to be selected as the prediction blocks of the current block, the finally selected prediction blocks and the sequence thereof are "A1, A2, A3".
In one embodiment, the variance values are cost values and location distance values. And selecting a plurality of matching blocks with the same size as the current block according to the position distance value in the region after the encoding is completed, calculating cost values of templates corresponding to the matching blocks according to the templates of the reference pixel region used by the current block, sorting the plurality of matching blocks according to the cost values from small to large, and selecting at least two matching blocks with the front sorting as at least two prediction blocks of the current block. The block weights of at least two predicted blocks are also set according to the corresponding cost values, and the smaller the cost value is, the earlier the ordering is, and the larger the corresponding block weights are.
And obtaining a matching block which is close to the pixel information or the position information of the current block through the difference value information such as the cost value, the position distance value and the like to serve as a prediction block, so that the pixel information in the current frame is utilized better.
Referring to fig. 3, fig. 3 is a flowchart illustrating a second embodiment of an intra prediction encoding method according to the present application. The method is a further extension of step S11, comprising the steps of:
s21: and respectively acquiring target template areas of the current block according to a plurality of template types.
And acquiring a target template area according to the preset template type. More template types may be set for the current block to obtain the prediction block. For example, a general template type is to use the reference pixel regions above and to the left of the current block as templates, only this. In this embodiment, more template types may be set, such as three types of left side, upper side, left side and upper side. The left template type target template region corresponds to a left reference pixel region, the upper template type target template region corresponds to an upper reference pixel region, and the left and upper template type target template regions correspond to upper and left reference pixel regions.
S22: and acquiring a candidate prediction block of the current block according to the target template area of each template type.
Candidate prediction blocks of the current block are acquired in the encoded region according to each target template region, and the selection mode can be selected according to the SAD absolute error and the result.
S23: and sequencing the candidate prediction blocks corresponding to each target template area according to the difference value, and acquiring a preset number of candidate prediction blocks in the sequencing result corresponding to each target template area to form at least two prediction blocks of the current block.
After the corresponding candidate prediction blocks are obtained according to the target template areas of each template type, each target template area is provided with a corresponding candidate prediction block queue, and each candidate prediction block queue is ordered according to the corresponding difference value. For example, in the candidate prediction block queue corresponding to the target template region of the left template type, the template cost value is calculated according to the left template, and the candidate prediction blocks in the candidate prediction block queue are ranked according to the cost value from small to large, and similarly, in the candidate prediction block queue corresponding to the target template region of the upper template type, the template cost value is calculated according to the upper template, and the candidate prediction blocks in the candidate prediction block queue are ranked according to the cost value from small to large. Of course, the candidate prediction blocks in each candidate prediction block queue may be ordered according to the position distance value.
And selecting a preset number of candidate prediction blocks as the prediction blocks of the current block according to the sequencing results corresponding to the target template areas of each template type. If the template types are classified into three template types of left side, upper side, left side and upper side, selecting one candidate prediction block from the sequencing result corresponding to the left side template type, selecting one candidate prediction block from the sequencing result corresponding to the upper side template type, selecting one candidate prediction block from the sequencing result corresponding to the left side template type and the upper side template type, and taking the three candidate prediction blocks as the prediction blocks of the current block. The number of candidate prediction blocks selected from each sorting result is not necessarily the same, and may be set according to specific situations, for example, one of the sorting results corresponding to the left template type is selected, two of the sorting results corresponding to the upper template type are selected, and three of the sorting results corresponding to the left template type and the upper template type are selected.
In an embodiment, after the target template areas of the current block are respectively obtained according to the plurality of template types, determining the template type for obtaining the candidate prediction block according to the preset template type may be further included.
After classifying several template types, some of them may be selected for further candidate prediction block acquisition. If there are three template types, i.e., left side, upper side, left side and upper side, the preset template type is left side, upper side, then the candidate prediction block is further acquired according to the template type of left side, upper side. The number of preset template types can be set according to specific situations, and at least one template type is included, and at most, all the template types are classified.
Referring to fig. 4, fig. 4 is a flowchart illustrating a third embodiment of an intra prediction encoding method according to the present application. The method is a further extension of step S11, comprising the steps of:
s31: and respectively acquiring target template areas of the current block according to a plurality of template types.
And acquiring a target template area according to the preset template type. More template types may be set for the current block to obtain the prediction block. For example, a general template type is to use the reference pixel regions above and to the left of the current block as templates, only this. In this embodiment, more template types may be set, such as three types of left side, upper side, left side and upper side. The left template type target template region corresponds to a left reference pixel region, the upper template type target template region corresponds to an upper reference pixel region, and the left and upper template type target template regions correspond to upper and left reference pixel regions.
S32: and acquiring a candidate prediction block of the current block according to the target template area of each template type.
Candidate prediction blocks of the current block are acquired in the encoded region according to each target template region, and the selection mode can be selected according to the SAD absolute error and the result.
S33: and obtaining the difference value of the best candidate prediction block of each target template area by using the difference value of the candidate prediction block corresponding to each target template area.
And calculating the difference value of the candidate prediction block corresponding to each target template area. The difference value includes a cost value. And determining the minimum difference value corresponding to the candidate prediction block in the candidate prediction block set corresponding to each target template area, wherein the candidate prediction block corresponding to the minimum difference value is the best candidate prediction block of the target template area.
S34: and sequencing all the target template areas according to the difference value of the optimal candidate prediction block to obtain a preset number of candidate target template areas in the sequencing result.
And sequencing all the target template areas according to the obtained difference value of the optimal candidate prediction block, and selecting a preset number of candidate target template areas with higher priority according to the sequencing result.
For example, there are three template types, left, top, left and top. Obtaining candidate prediction blocks by using a left template type and calculating cost values to obtain a plurality of candidate prediction blocks, { MVlt0, MVlt1, …, MVltn }, wherein the cost value corresponding to MVlt0 is minimum in the queue set; obtaining candidate prediction blocks by using the upper template type and calculating cost values to obtain a plurality of candidate prediction blocks, wherein the cost value corresponding to { MVl0, MVl1, …, MVln }, MVl0 is minimum in the queue set; candidate prediction block acquisition and cost value calculation are carried out by using the left side and upper template types to obtain a plurality of candidate prediction blocks, wherein the cost value corresponding to { MVt0, MVt, …, MVtn }, MVt0 is minimum in the queue set. And comparing the cost values of MVlt0, MVl0 and MVt0, it is found that MVl0< MVlt0< MVt0. The priorities of the three template types, or target template regions, are top, left and top from high to low. Assuming that only two target template regions are required, only the target template regions of both the upper and left template types need to be selected. The predetermined number of candidate target template regions selected is at least one and at most all types of target template regions.
S35: and respectively acquiring candidate prediction blocks corresponding to the candidate target template areas to form at least two prediction blocks of the current block.
After the candidate target template areas are determined, the candidate prediction blocks corresponding to each candidate target template area are ranked according to the difference value, and at least two prediction blocks of the current block are formed according to the candidate prediction blocks in the ranking result corresponding to each candidate target template area. After each candidate target template area obtains the corresponding candidate prediction block, each candidate target template area is provided with the corresponding candidate prediction block queue, and each candidate prediction block queue is ordered according to the corresponding difference value. For example, in the candidate prediction block queue corresponding to the target template region of the left template type, the template cost value is calculated according to the left template, and the candidate prediction blocks in the candidate prediction block queue are ranked according to the cost value from small to large, and similarly, in the candidate prediction block queue corresponding to the target template region of the upper template type, the template cost value is calculated according to the upper template, and the candidate prediction blocks in the candidate prediction block queue are ranked according to the cost value from small to large.
Then, a preset number of candidate prediction blocks are selected from the sorting results corresponding to each candidate target template area to serve as the prediction blocks of the current block.
In one embodiment, after candidate prediction blocks are continuously selected from a preset number of candidate target template areas, all candidate prediction blocks are ranked from small to large according to cost values, and then a preset number of candidate prediction blocks ranked ahead are selected from ranking results to serve as prediction blocks of the current block. If all the target template areas are selected as candidate target template areas, the matching blocks corresponding to each candidate target template area are used as candidate prediction blocks to carry out cost value sorting, and finally a preset number of candidate prediction blocks with the front sorting are selected according to sorting results to serve as prediction blocks of the current block.
In the above embodiment, the method for obtaining the prediction block by using multiple template types can adapt to diversified image contents, enhance the universality of the prediction algorithm and improve the encoding compression capability of the prediction algorithm.
Referring to fig. 5, fig. 5 is a flowchart illustrating a fourth embodiment of an intra prediction encoding method according to the present application. The method is a further extension of the above embodiment, comprising the steps of:
s41: and acquiring a plurality of prediction schemes, and acquiring at least two prediction blocks of the current block according to each prediction scheme.
A plurality of prediction schemes are acquired, each of which is capable of obtaining at least two prediction blocks. The prediction scheme may be any one of the above methods and possible combinations of the methods for obtaining the prediction block, for example, obtaining the prediction block according to the magnitude relation of the cost value, obtaining the prediction block according to the magnitude relation of the position distance value, obtaining the prediction block according to the template type, and so on.
S42: according to the magnitude relation of the difference values of at least two prediction blocks of each prediction scheme and the current block, the block weights of the at least two prediction blocks of each prediction scheme are configured.
Under each prediction scheme, corresponding block weights are configured according to the difference values of the prediction blocks acquired under the corresponding scheme, so that the prediction blocks are combined according to the weight information, and more image information can be utilized.
The setting of the weights can be referred to the above-described embodiments.
S43: and obtaining the weighted value of each prediction scheme by utilizing at least two prediction blocks of each prediction scheme according to the corresponding block weights.
And weighting at least two prediction blocks obtained according to each prediction scheme according to the corresponding block weights, and obtaining a weighted value corresponding to the prediction scheme.
S44: and obtaining the predicted value of the current block by using the scheme weight and the weighted value of each prediction scheme.
And weighting the weighted value of the prediction scheme and the scheme weight corresponding to the prediction scheme to obtain a final prediction result. And comparing the prediction result with the current block to obtain the prediction value of the current block under the prediction scheme.
S45: and encoding the current block according to the predicted value of the current block to obtain an encoded code stream.
Encoding is performed according to the obtained predicted value, so that the receiving end can generate the current block according to the predicted value and the predicted block corresponding to the decoded area.
In a specific embodiment, the obtaining of the prediction block according to the magnitude relation of the cost value is regarded as a scheme one, the obtaining of the prediction block according to the magnitude relation of the position distance value is regarded as a scheme two, and the obtaining of the prediction block according to the template type is regarded as a scheme three. All schemes are selected for weighting, and assuming that the first scheme obtains two predicted blocks P0, P1 and P0 in sequence before P1, the second scheme obtains two predicted blocks P2, P3 and P2 in sequence before P3, the third scheme obtains two predicted blocks P4, P5 and P4 in sequence before P5, the block weight of the first scheme is {0.6,0.4}, the block weight of the second scheme is {0.7,0.3}, and the block weight of the third scheme is {0.9,0.1}. Then the weight of scheme one is (p0.6+p1.0.4), the weight of scheme two is (p2.0.7+p3.0.3), and the weight of scheme three is (p4.0.9+p5.0.1).
If the scheme weight assigned to scheme one is 0.5, the scheme weight assigned to scheme two is 0.3, and the weight assigned to scheme three is 0.2. The final prediction result is p= (p0.6+p1.0.4) ×0.5+ (p2.0.7+p3.0.3) ×0.3+ (p4.0.9+p5.0.1) ×0.2.
The scheme weight may be zero, and if the scheme weight allocated to the scheme one is 0.8, the scheme weight allocated to the scheme two is 0.2, and the weight allocated to the scheme three is 0. The final prediction result is p= (p0.6+p1×0.4) ×0.8+ (p2×0.7+p3×0.3) ×0.2.
Referring to fig. 6, fig. 6 is a flowchart illustrating a fifth embodiment of an intra prediction encoding method according to the present application. The method is a further extension of step S41 of the fourth embodiment, comprising the steps of:
s51: at least one prediction combination scheme is determined, wherein the prediction combination scheme comprises at least one prediction scheme and scheme weights corresponding to the at least one prediction scheme.
Before the prediction scheme is obtained, at least one prediction combination scheme is determined, wherein the prediction combination scheme comprises at least one prediction scheme and scheme weights corresponding to the included prediction scheme.
S52: and obtaining a prediction scheme in the used prediction combination scheme and a scheme weight corresponding to the prediction scheme.
According to the determined prediction combination scheme, a prediction scheme and scheme weight in the scheme are further determined, so that a prediction value of the current block corresponding to each scheme is obtained according to the prediction scheme and the scheme weight of the scheme.
Referring to fig. 7, fig. 7 is a flowchart of a fifth embodiment of the intra prediction encoding method of the present application. The method is a further extension of step S45, comprising the steps of:
s61: and obtaining a scheme difference value corresponding to each prediction combination scheme by using the prediction scheme and the scheme weight in each prediction combination scheme.
And obtaining a predicted value of the current block corresponding to the scheme according to the prediction scheme in each prediction combination scheme and the corresponding scheme weight, and obtaining a scheme difference value corresponding to each prediction combination scheme according to the predicted value and the current block. The scheme difference value may be a cost value of the prediction value and the current block.
S62: and determining the prediction combination scheme corresponding to the minimum scheme difference value as the currently used prediction combination scheme.
And taking the prediction combination scheme with the minimum scheme difference value as an optimal prediction combination scheme, and acquiring a prediction value by using the prediction combination scheme to encode the current block.
S63: and obtaining the predicted value of the current block by using the prediction scheme and the scheme weight in the currently used prediction combination scheme.
And obtaining a prediction result by using the prediction scheme and the scheme weight in the prediction combination scheme with the minimum scheme difference value, and obtaining the prediction value of the current block by using the prediction result and the current block. The predicted value may include residual value information. The current block may be encoded based on the prediction value.
Referring to fig. 8, fig. 8 is a flowchart of a fifth embodiment of the intra prediction encoding method of the present application. The method is a further extension of step S14, comprising the steps of:
s71: identification information of a used predictive combining scheme is acquired, wherein the identification information comprises a first identification used for distinguishing whether the predictive combining scheme is used or not.
In order to determine whether the currently used coding scheme is the weighted coding scheme, so that decoding at a decoding end is clearer, and whether the prediction combination scheme is used in coding is distinguished by using identification information. When the first identifier indicates that a prediction combination scheme is used, if the scheme difference value is not compared for each prediction combination scheme during encoding, the weights of each scheme in the prediction combination scheme are equal. If two schemes are included in the prediction combination scheme, the weights of the two schemes are fifty percent, and if four schemes are included, the weights of the four schemes are twenty-five percent.
In an embodiment, the identification information further comprises a second identification. After the first identifier is used for distinguishing whether to use the predictive combination scheme, if the first identifier indicates that the predictive combination scheme is used and the scheme difference value of each predictive combination scheme is compared in the process of encoding, the second identifier is used for distinguishing the type of the predictive combination scheme used. Since the comparison of the scheme difference values of the combining schemes is performed, different scheme weight allocation methods are provided in different kinds of combining schemes, and thus the second identifier is used to determine the kind of combining scheme and further determine the scheme weight allocation. In a specific embodiment, if the second flag is one, the prediction combination scheme includes a scheme one, a scheme two, a scheme one weight seventy-five percent, and a scheme two weight twenty-five percent; when the second identifier is two, the prediction combination scheme comprises a scheme one and a scheme two, wherein the weight of the scheme one is eighty percent, and the weight of the scheme two is twenty percent; when the second identifier is three, the prediction combining scheme is represented to include a scheme one, a scheme two and a scheme three, wherein the scheme one weight percent is thirty, the scheme two weight percent is thirty, and the scheme three weight percent is forty.
In an embodiment, only one identifier may be used to identify both of the above-described distinguishing cases. For example, the combination schemes described above are not used to mark 0, and other non-0 natural numbers are used to correspond to each predicted combination scheme category, such as 1, 2, or 3, etc.
S72: and encoding the current block according to the predicted value and the identification information of the current block to obtain an encoded code stream.
When a certain prediction combination scheme is selected to encode the current block, the prediction value obtained according to the prediction combination scheme and the identification information corresponding to the prediction combination scheme are encoded into the encoding code stream of the current block together, so that a receiving end can distinguish which prediction combination scheme the prediction of the current block is performed according to.
In one embodiment, during encoding, a block-level syntax flag intra_weight_mode may be set, where intra_weight_mode equal to 0 represents the prior art technique using intra tmp, and left and upper pixel regions are used to obtain a prediction block for predictive encoding, and intra_weight_mode equal to 1 represents the weighting scheme mentioned in this application.
Further, the application has a plurality of weighted prediction combination schemes, wherein a first weighted prediction combination scheme is represented by syntactically identifying intra_weight_sub=0, and a second weighted prediction combination scheme is represented by syntactically identifying intra_weight_sub=1.
The present embodiment uses two kinds of flags to set two kinds of distinguishing cases.
Referring to fig. 9, fig. 9 is a flowchart illustrating a first embodiment of an intra prediction decoding method according to the present application. Which comprises the following steps:
s81: and obtaining a coded code stream.
And obtaining the coded code stream obtained by the intra-frame predictive coding method.
S82: at least two predicted blocks of the current block are determined from the encoded bitstream.
It is possible to determine which intra prediction combination scheme is used according to the encoded bitstream, and at least two prediction blocks of the current block are determined using the same intra prediction combination scheme. The acquisition step may be described with reference to the above-described embodiments of the encoding method.
S83: and configuring block weights of at least two prediction blocks according to the magnitude relation of the difference values of the at least two prediction blocks and the current block.
S84: and obtaining the predicted value of the current block by using at least two predicted blocks according to the corresponding block weights.
The step of configuring the block weights for the obtained at least two prediction blocks and obtaining the prediction value of the current block according to the block weights may also refer to the description in the above embodiment of the encoding method, which is not repeated herein.
The step of obtaining the predicted value in the decoding method may refer to the step of obtaining the predicted value in the method provided by any embodiment and possible combinations of the encoding methods.
S85: and obtaining the current block according to the coded code stream and the predicted value.
After obtaining the predicted value of the current block, the predicted value and the residual value are combined according to residual value information and the like included in the coded code stream to obtain the current block.
Fig. 10 is a schematic structural diagram of an embodiment of an electronic device according to the present application.
The electronic device comprises a processor 110, a memory 120.
The processor 110 controls the operation of the electronic device, the processor 110 may also be referred to as a CPU (Central Processing Unit ). The processor 110 may be an integrated circuit chip with processing capabilities for signal sequences. Processor 110 may also 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 logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The processor 110 is configured to execute instructions to implement the methods provided by any of the embodiments and possible combinations of the intra prediction encoding methods described herein.
As shown in fig. 11, fig. 11 is a schematic structural diagram of an embodiment of a computer readable storage medium of the present application.
An embodiment of the readable storage medium of the present application includes a memory 210, where the memory 210 stores program data that, when executed, implements the methods provided by any one embodiment and possible combinations of the intra prediction encoding methods of the present application.
The Memory 210 may include a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other media capable of storing program instructions, or may be a server storing the program instructions, and the server may send the stored program instructions to other devices for execution, or may also self-execute the stored program instructions.
In summary, more prediction blocks are acquired, corresponding block weights are configured for each prediction block according to the magnitude relation of the difference values, and more intra-frame information is combined by using the prediction blocks and the corresponding block weights, that is, by using more prediction block information. The prediction blocks and the corresponding block weights are further utilized to obtain the prediction value of the current block, and coding is carried out to obtain a code stream, and because more prediction block information is utilized, compared with a single prediction block for predicting the current block to obtain the prediction value and the coded code stream, the prediction result obtained by utilizing more prediction block information is closer to the current block than the single prediction block obtained by directly searching in the search range of the prediction block, so that the compression rate of the finally obtained coded code stream can be improved, and the image quality of the decoded current block can be better. The method and the device also utilize various template types to acquire the prediction block, and the more diversified acquisition templates enable the prediction algorithm to adapt to diversified image contents, so that the universality of the prediction algorithm is enhanced, and the coding compression capacity of the prediction algorithm is further improved.
In the several embodiments provided in the present application, it should be understood that the disclosed methods and apparatuses may be implemented in other manners. For example, the above-described device embodiments are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist alone physically, or two or more units may be integrated into one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units of the other embodiments described above may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as stand alone products. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution, in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description is only exemplary embodiments of the present application and is not intended to limit the scope of the present application, and all equivalent structures or equivalent processes using the descriptions and the drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the present application.
Claims (13)
1. An intra prediction encoding method, the method comprising:
acquiring a current block and at least two prediction blocks of the current block;
configuring block weights of the at least two prediction blocks according to the magnitude relation of difference values of the at least two prediction blocks and the current block;
obtaining a predicted value of the current block according to the corresponding block weights by utilizing the at least two predicted blocks;
and encoding the current block according to the predicted value of the current block to obtain an encoded code stream.
2. The method of claim 1, wherein the at least two prediction blocks are ordered from small to large according to the magnitude of the difference value, and wherein the ordered at least two prediction blocks are configured with block weight combinations from large to small.
3. The method according to claim 1 or 2, wherein the difference value is determined based on at least one of a cost value and a location distance value.
4. The method of claim 1, wherein obtaining at least two prediction blocks of the current block comprises:
respectively acquiring target template areas of the current block according to a plurality of template types;
obtaining a candidate prediction block of the current block according to a target template area of each template type;
and sequencing the candidate prediction blocks corresponding to each target template area according to the difference value, and obtaining a preset number of candidate prediction blocks in a sequencing result corresponding to each target template area to form at least two prediction blocks of the current block.
5. The method of claim 1, wherein obtaining at least two prediction blocks of the current block comprises:
respectively acquiring target template areas of the current block according to a plurality of template types;
obtaining a candidate prediction block of the current block according to a target template area of each template type;
obtaining the difference value of the optimal candidate prediction block of each target template area by using the difference value of the candidate prediction block corresponding to each target template area;
sorting all the target template areas according to the difference value of the optimal candidate prediction block to obtain a preset number of candidate target template areas in a sorting result;
and respectively acquiring candidate prediction blocks corresponding to the candidate target template areas to form at least two prediction blocks of the current block.
6. The method according to claim 1, wherein the intra prediction encoding method comprises:
acquiring a plurality of prediction schemes, and acquiring at least two prediction blocks of the current block according to each prediction scheme;
according to the magnitude relation of the difference values of the at least two prediction blocks of each prediction scheme and the current block, configuring the block weights of the at least two prediction blocks of each prediction scheme;
acquiring a weighted value of each prediction scheme by utilizing at least two prediction blocks of each prediction scheme according to the corresponding block weights;
obtaining a predicted value of the current block by using the scheme weight and the weighted value of each predicted scheme;
and encoding the current block according to the predicted value of the current block to obtain an encoded code stream.
7. The method of claim 6, wherein the obtaining a plurality of test protocols comprises:
determining at least one prediction combination scheme, wherein the prediction combination scheme comprises at least one prediction scheme and scheme weights corresponding to the at least one prediction scheme;
and acquiring the prediction scheme in the used prediction combination scheme and the scheme weight corresponding to the prediction scheme.
8. The method according to claim 7, wherein before encoding the current block according to the predicted value of the current block, the method further comprises:
obtaining a scheme difference value corresponding to each prediction combination scheme by using the prediction scheme and the scheme weight in each prediction combination scheme;
determining the prediction combination scheme corresponding to the minimum scheme difference value as the currently used prediction combination scheme;
and obtaining the predicted value of the current block by using the prediction scheme and the scheme weight in the currently used prediction combination scheme.
9. The method of claim 7, wherein the encoding the current block according to the predicted value of the current block to obtain the encoded code stream comprises:
acquiring identification information of the used prediction combination scheme, wherein the identification information comprises a first identification used for distinguishing whether the prediction combination scheme is used or not;
and encoding the current block according to the predicted value of the current block and the identification information to obtain an encoded code stream.
10. The method of claim 9, wherein the identification information further comprises a second identification for distinguishing the kind of the predictive combining scheme used.
11. An intra prediction decoding method, the method comprising:
acquiring a coded code stream;
determining at least two prediction blocks of the current block according to the coded code stream;
configuring block weights of the at least two prediction blocks according to the magnitude relation of difference values of the at least two prediction blocks and the current block;
obtaining a predicted value of the current block according to the corresponding block weights by utilizing the at least two predicted blocks;
and obtaining the current block according to the coded code stream and the predicted value.
12. An electronic device comprising a memory and a processor, the memory for storing program data, the program data being executable by the processor to implement the method of any one of claims 1-10 or 11.
13. A computer readable storage medium storing program data executable by a processor to implement the method of any one of claims 1-10 or 11.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211463047.2A CN116016929A (en) | 2022-11-21 | 2022-11-21 | Intra-frame prediction encoding and decoding method, electronic device, and computer-readable storage medium |
PCT/CN2023/132292 WO2024109650A1 (en) | 2022-11-21 | 2023-11-17 | Systems and methods for image processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211463047.2A CN116016929A (en) | 2022-11-21 | 2022-11-21 | Intra-frame prediction encoding and decoding method, electronic device, and computer-readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116016929A true CN116016929A (en) | 2023-04-25 |
Family
ID=86032394
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211463047.2A Pending CN116016929A (en) | 2022-11-21 | 2022-11-21 | Intra-frame prediction encoding and decoding method, electronic device, and computer-readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116016929A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116708934A (en) * | 2023-05-16 | 2023-09-05 | 深圳东方凤鸣科技有限公司 | Video coding processing method and device |
WO2024109650A1 (en) * | 2022-11-21 | 2024-05-30 | Zhejiang Dahua Technology Co., Ltd. | Systems and methods for image processing |
-
2022
- 2022-11-21 CN CN202211463047.2A patent/CN116016929A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024109650A1 (en) * | 2022-11-21 | 2024-05-30 | Zhejiang Dahua Technology Co., Ltd. | Systems and methods for image processing |
CN116708934A (en) * | 2023-05-16 | 2023-09-05 | 深圳东方凤鸣科技有限公司 | Video coding processing method and device |
CN116708934B (en) * | 2023-05-16 | 2024-03-22 | 深圳东方凤鸣科技有限公司 | Video coding processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11394994B2 (en) | Image encoding method and apparatus, and image decoding method and apparatus | |
CN116016929A (en) | Intra-frame prediction encoding and decoding method, electronic device, and computer-readable storage medium | |
US20060039476A1 (en) | Methods for efficient implementation of skip/direct modes in digital video compression algorithms | |
CN110166775B (en) | Intra-frame prediction method, encoder and storage device | |
CN108401185B (en) | Reference frame selection method, video transcoding method, electronic device and storage medium | |
CN111586415B (en) | Video coding method, video coding device, video coder and storage device | |
US20130163674A1 (en) | Encoding of the Link to a Reference Block in Video Compression by Image Content Based on Search and Ranking | |
CN113691809A (en) | Intra-frame prediction method, encoding and decoding methods, electronic device and storage medium | |
CN100385957C (en) | Kinematic vector predicting method | |
CN111586416B (en) | Video coding method, device, coder and storage device | |
CN110062237B (en) | Intra-frame coding mode selection method and device for video coding | |
CN110166774B (en) | Intra-frame prediction method, video encoding method, video processing apparatus, and storage medium | |
CN113099269A (en) | String matching prediction method, encoding and decoding method, related equipment and device | |
CN109618152A (en) | Depth divides coding method, device and electronic equipment | |
WO2022141683A1 (en) | Scalable feature stream | |
CN113542768B (en) | Motion search method, motion search device and computer-readable storage medium | |
CN117459732B (en) | Video encoding method, apparatus, device, readable storage medium, and program product | |
JP3941900B2 (en) | Motion vector detection device | |
CN112004099B (en) | Intra-frame block copy prediction method and device and computer readable storage medium | |
CN115955572A (en) | Encoding method, decoding method, electronic device, and computer-readable storage medium | |
CN115019227A (en) | AI-based video processing method, device and equipment and readable storage medium | |
CN114697678A (en) | Image encoding method, image encoding device, storage medium, and image encoding apparatus | |
CN117956161A (en) | Parameter deriving method, image encoding method, image decoding method and device thereof | |
JP4002212B2 (en) | Moving picture encoding method, apparatus, program, and program recording medium | |
CN116980622A (en) | Image encoding method, image decoding device, and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |