Encoding and decoding methods and electronic devices

By nesting other intra-prediction modes within block-copy intra-prediction modes and using block vectors to indicate prediction modes, the problem of high search costs is solved, and the prediction accuracy and compression performance of coding units are improved.

CN118646867BActive Publication Date: 2025-12-02HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410627070.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2025-12-02
Estimated Expiration
2043-03-13

AI Technical Summary

Technical Problem

In the existing technology, for coding units with block copy intra-prediction mode, the search cost is high, resulting in poor prediction performance and affecting compression performance.

Method used

By extending the functionality of block vectors, other intra-prediction modes can be nested within block-copy intra-prediction modes. Block vectors can be used to indicate prediction modes, reducing search costs and improving prediction accuracy.

Benefits of technology

This approach improves the prediction flexibility and compression performance of coding units and enhances prediction accuracy without increasing the bitrate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646867B_ABST
    Figure CN118646867B_ABST
Patent Text Reader

Abstract

This application provides an encoding / decoding method and an electronic device. The method includes: receiving a bit stream; parsing the block vector (BV) of a current sub-block from the bit stream, wherein the prediction mode of the coding unit (CU) to which the current sub-block belongs is Block Copy Intra-Block Prediction (IBC) mode; for the current sub-block, determining whether to use another intra-frame prediction mode to replace the IBC mode based on the BV of the current sub-block; if yes, performing other intra-frame predictions on the current sub-block to obtain the predicted value of the current sub-block; if no, performing IBC predictions on the current sub-block based on the BV of the current sub-block to obtain the predicted value of the current sub-block; and reconstructing the current sub-block based on the predicted value of the current sub-block to obtain the reconstructed block of the current sub-block. This does not increase the bitrate or the search area for IBC prediction. Furthermore, it increases the flexibility of coding unit prediction, achieves finer-grained prediction, improves prediction accuracy, and thus improves compression performance.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The original application has the application number 202310284038.5 and the original application date is March 13, 2023. The entire contents of the original application are incorporated herein by reference. Technical Field

[0002] This application relates to the field of encoding and decoding, and more particularly to an encoding and decoding method and an electronic device. Background Technology

[0003] The encoding process typically includes operations such as prediction, quantization, and entropy coding. Among these, prediction is often used to remove redundant information from images or videos to make them easier to compress; therefore, improving the accuracy of prediction is one way to improve compression performance.

[0004] Since there may be sub-blocks with different content characteristics (such as different texture orientations) within a coding unit, if the same intra-prediction mode is used for all sub-blocks in the coding unit, the prediction effect of some sub-blocks may be poor. Therefore, existing technologies have proposed a scheme to increase the search area for coding units with the intra-block copy (IBC) mode to improve the prediction effect of each sub-block within the coding block, but the search cost is high. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides an encoding / decoding method that can reduce search costs during the prediction process and improve compression performance.

[0006] It should be noted that this application is an encoding and decoding method for CUs with IBC prediction mode; by extending the functionality of the block vector (BV) of each sub-block, other intra-prediction modes can be nested in IBC mode, thereby reducing the search cost in the prediction process and improving compression performance.

[0007] In a first aspect, embodiments of this application provide a decoding method, the method comprising: receiving a bit stream; then, parsing the block vector (BV) of a current sub-block from the bit stream, wherein the prediction mode of the coding unit (CU) to which the current sub-block belongs is the block copy intra-prediction (IBC) mode; subsequently, for the current sub-block, determining whether to use another intra-prediction mode to replace the IBC mode based on the BV of the current sub-block; if yes, performing other intra-prediction on the current sub-block to obtain the prediction value of the current sub-block; if no, performing IBC prediction on the current sub-block based on the BV of the current sub-block to obtain the prediction value of the current sub-block; and then, reconstructing the current sub-block based on the prediction value of the current sub-block to obtain the reconstructed block of the current sub-block.

[0008] In other words, the Block Vector (BV) can be not only the absolute vector offset between a sub-block and its corresponding reference block, but also an indication of other intra-prediction modes. Since the BV is an existing syntax element in the bitstream for a CU using the IBC prediction mode, this application's nesting of other intra-prediction modes within the IBC mode does not increase the bitrate or the search area for IBC prediction. Furthermore, it increases the flexibility of coding unit prediction, enabling finer-grained prediction and improving prediction accuracy, thereby enhancing compression performance.

[0009] For example, the IBC preset refers to using the region to the left of the current sub-block as the search region, searching for reference blocks that match the current sub-block within the search region; and determining the predicted value of the current sub-block based on the reconstruction value of the reference block that matches the current sub-block. For example, the reconstruction value of the reference block that matches the current sub-block can be used as the predicted value of the current sub-block.

[0010] For example, other intra-prediction modes can refer to intra-prediction modes other than IBC mode.

[0011] It should be noted that other intra-frame prediction modes in this application refer to modes in which no additional information needs to be transmitted at the encoding end, and the decoding end can achieve intra-frame prediction using the decoded information and pre-agreed parameters.

[0012] For example, the quantized prediction residual of the current sub-block can be parsed from the bit stream; then, the quantized prediction residual of the current sub-block is dequantized to obtain the prediction residual of the current sub-block; then, the prediction value of the current sub-block and the residual of the current sub-block are added together to obtain the reconstructed block of the current sub-block.

[0013] For example, when it is determined that no other intra-prediction mode will be used to replace the IBC mode for the current sub-block, the reference block of the current sub-block can be determined based on the BV of the current sub-block and the position of the current sub-block; then the prediction value of the current sub-block can be determined based on the reconstruction value of the reference block of the current sub-block.

[0014] For example, a BV set as the first preset information can be used to indicate that the prediction mode of the current sub-block is another intra-prediction mode; a BV set as the second preset information can be used to indicate that the prediction mode of the current sub-block is IBC mode; then, by determining whether the BV of the current sub-block is the first preset information, it can be determined whether to use another intra-prediction mode to replace the IBC mode for the current sub-block. If the BV of the current sub-block is the first preset information, then it is determined that another intra-prediction mode will be used to replace the IBC mode for the current sub-block. If the BV of the current sub-block is not the first preset information, that is, if the BV of the current sub-block is the second preset information, then it is determined that another intra-prediction mode will not be used to replace the IBC mode for the current sub-block.

[0015] For example, multiple sub-blocks of reconstruction can be stitched together into a single CU reconstruction block.

[0016] According to the first aspect, other intra-frame prediction modes are vertical prediction modes. Other intra-frame predictions are performed on the current sub-block to obtain the predicted value of the current sub-block, including: performing vertical prediction on the current sub-block to obtain the predicted value of the current sub-block. Thus, vertical prediction modes can be nested within IBC modes.

[0017] According to the first aspect, or any implementation of the first aspect above, other intra-prediction is performed on the current sub-block to obtain the predicted value of the current sub-block, including: selecting other intra-prediction modes corresponding to the BV of the current sub-block from R other intra-prediction modes; and performing intra-prediction on the current sub-block based on the other intra-prediction modes corresponding to the BV of the current sub-block to obtain the predicted value of the current sub-block.

[0018] Thus, when the encoder performs intra-prediction on the current sub-block based on one of the R other intra-prediction modes, the decoder can select the corresponding intra-prediction mode from the R other intra-prediction modes based on the BV of the current sub-block for intra-prediction.

[0019] For example, the encoder can use one of the following modes—vertical prediction, angle prediction, or direct current (DC) prediction—to perform intra-frame prediction for the current sub-block. When the encoder performs vertical prediction for the current sub-block, the decoder can also perform vertical prediction for the current sub-block. Similarly, when the encoder performs angle prediction for the current sub-block, the decoder can also perform angle prediction for the current sub-block. And when the encoder performs DC prediction for the current sub-block, the decoder can also perform DC prediction for the current sub-block.

[0020] According to the first aspect, or any implementation of the first aspect above, when it is determined that another intra-frame prediction mode will be used to replace the IBC mode for the current sub-block, the method further includes: determining the flatness of the current sub-block; determining the quantization parameter QP_intra corresponding to the current sub-block based on the flatness of the current sub-block; reconstructing the current sub-block based on the predicted value of the current sub-block to obtain the reconstructed block of the current sub-block, including: dequantizing the quantized prediction residual obtained from parsing in the bit stream based on the quantization parameter QP_intra corresponding to the current sub-block to obtain the prediction residual of the current sub-block; adding the predicted value of the current sub-block and the prediction residual of the current sub-block to obtain the reconstructed block of the current sub-block.

[0021] In other words, during the decoding of sub-blocks in the CU that use other intra-prediction modes to replace the IBC mode, inverse quantization is performed using the quantization parameter QP_intra determined based on the flatness of the current sub-block; this can improve the subjective quality of sub-blocks that use other intra-prediction modes to replace the IBC mode.

[0022] According to the first aspect, or any implementation of the first aspect above, the quantization parameter QP_intra corresponding to the current sub-block is determined based on the flatness of the current sub-block, including: parsing the complexity information of the CU from the bit stream and determining the quantization parameter QP_IBC corresponding to the CU; and determining the quantization parameter QP_intra corresponding to the current sub-block based on the flatness, complexity information and quantization parameter QP_IBC of the current sub-block.

[0023] For example, the quantization parameter QP_IBC corresponding to the CU can be determined by the rate control module in the decoder.

[0024] In one possible approach, the rate control module can control the rate based on the number of encoded bits (or the full size of the buffer) of the previous CU and output the quantization parameter QP_IBC.

[0025] In one possible approach, the rate control module can control the rate based on the number of encoded bits (or the full size of the buffer) of the previous CU and the complexity information of the current CU, and output the quantization parameter QP_IBC.

[0026] In other words, this application does not restrict the way the rate control module determines the quantization parameter QP_IBC.

[0027] For example, complexity information can be a complexity level. For example, the complexity level of the current CU can be determined based on the texture complexity level and the IBC complexity level of the current CU; for example, the minimum value between the texture complexity level and the IBC complexity level of the current CU can be determined as the complexity level of the current CU.

[0028] For example, the number of encoded bits of the previous CU can be obtained during entropy decoding of the bit stream of the previous CU.

[0029] According to the first aspect, or any implementation of the first aspect above, the quantization parameter QP_intra corresponding to the current sub-block is determined based on the flatness and complexity information of the current sub-block and the quantization parameter QP_IBC, including: when the flatness and complexity information of the current sub-block meets a first preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined based on the quantization parameter QP_IBC and a first preset step size; when the flatness and complexity information of the current sub-block meets a second preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined based on the quantization parameter QP_IBC and a second preset step size; when the flatness and complexity information of the current sub-block meets a third preset condition, the quantization parameter QP_IBC is used as the quantization parameter QP_intra corresponding to the current sub-block.

[0030] For example, the first preset condition is: flatness is less than or equal to (QpRefineTh0 << (bdIdx >> 1)), and the complexity level of the encoding unit is greater than or equal to BwqComplexTh; the first quantization parameter is determined as: QP_intra = Max(QP_IBC – S0, 0). Where QpRefineTh0 is the 0th gradient threshold for quantization parameter adjustment, BwqComplexTh is the complexity threshold for sub-block quantization parameter adjustment, S0 is the adjustment step size corresponding to the 0th gradient threshold (i.e., the first preset step size, e.g., S0 = 2), bdIdx = Clip3(0, S2, BitDepth – S3), and BitDepth is the bit depth of the image. Where S2 represents the maximum bit depth difference, e.g., S2 = 8; it can be set according to requirements, and this application does not impose any restrictions on it. Furthermore, S3 can be preset according to requirements, and this application does not impose any restrictions on it. Where Clip3 is the clamping function.

[0031] For example, the second preset condition is: {flatness is less than or equal to (QpRefineTh1<<(bdIdx>>1))}, and {flatness is greater than (QpRefineTh0<<(bdIdx>>1))}, and / or, the complexity level of the encoding unit is less than BwqComplexTh}; the second quantization parameter is determined as: QP_intra=Max(QP_IBC–S1,0). Where QpRefineTh1 is the first gradient threshold for quantization parameter adjustment, and S1 is the adjustment step size corresponding to the first gradient threshold (i.e., the second preset step size, for example, S1=1). Where QpRefineTh0 is less than QpRefineTh1.

[0032] For example, the third preset condition is: flatness greater than (QpRefineTh1<<(bdIdx>>1)); the third quantization parameter is determined as: QP_intra=QP_IBC.

[0033] Determine the flatness of the current sub-block according to the first aspect, or any implementation of the first aspect above, including: determining the flatness of the current sub-block based on the reconstructed sub-blocks adjacent to the current sub-block.

[0034] For example, the difference between the reconstructed values ​​of adjacent pixels in the previous row of the current sub-block can be calculated to obtain multiple differences; the absolute values ​​of the multiple differences are added together to obtain the flatness of the current sub-block.

[0035] Secondly, embodiments of this application provide an encoding method, the method comprising: first, obtaining an encoding unit (CU) and dividing the CU into multiple sub-blocks, wherein the prediction mode of the CU is a block copy intra-prediction (IBC) mode; then, for the current sub-block, determining whether to use another intra-prediction mode to replace the IBC mode; if so, setting the BV of the current sub-block to a first preset information and setting the prediction value of the current sub-block to a first prediction value; wherein the BV set to the first preset information is used to indicate that the prediction mode of the current sub-block is another intra-prediction mode, and the first prediction value is based on its If the prediction is determined by the intra-frame prediction, then the block vector (BV) of the current sub-block is set to the second preset information, and the prediction value of the current sub-block is set to the second prediction value. The BV set to the second preset information is used to indicate that the prediction mode of the current sub-block is IBC mode, and the second preset information is the vector absolute value offset between the current sub-block and the reference block. The reference block and the second prediction value are determined based on IBC prediction. Subsequently, the current sub-block is encoded based on the prediction value of the current sub-block to obtain the bit stream of the current sub-block. Then, the BV of the current sub-block is written into the bit stream of the current sub-block.

[0036] For example, the prediction residual between the predicted value of the current sub-block and the prediction residual can be calculated; then, the prediction residual can be entropy encoded to obtain the bit stream of the current sub-block.

[0037] For example, the first preset information and the second preset information are different.

[0038] For example, the first preset information can be set as needed. For instance, when other intra-frame prediction modes are vertical prediction modes, the first preset information can be a preset value Y1; for instance, when other intra-frame prediction modes are angle prediction modes, the first preset information can be a preset value Y2; for instance, when other intra-frame prediction modes are DC prediction modes, the first preset information can be a preset value Y3.

[0039] For example, the second preset information can be obtained by calculating the absolute value of the difference between the x-coordinate of the current sub-block and the x-coordinate of the reference block.

[0040] For example, this application does not limit the number of sub-blocks or the size of the sub-blocks. For instance, the decoder can divide the CU into multiple sub-blocks of the same size.

[0041] For example, the image to be encoded can be divided into multiple CUs. For CUs with the prediction mode of IBC mode, the second encoding method can be used. The bit streams of multiple sub-blocks included in a CU can be concatenated to form the bit stream of that CU.

[0042] According to the second aspect, for the current sub-block, determining whether to use other intra-prediction modes to replace the IBC mode includes: performing IBC prediction on the current sub-block to determine a reference block; calculating the sum of absolute errors between the current sub-block and the reference block to obtain SAD_IBC; performing other intra-prediction on the current sub-block to obtain a first prediction value; calculating the sum of absolute errors between the current sub-block and the first prediction value to obtain SAD_intra; and for the current sub-block, determining whether to use other intra-prediction modes to replace the IBC mode based on SAD_IBC and SAD_intra.

[0043] According to the second aspect, or any implementation of the second aspect above, for the current sub-block, based on SAD_IBC and SAD_intra, it is determined whether to use another intra-prediction mode to replace the IBC mode. This includes: determining the sum between SAD_IBC and a preset bias, where the preset bias is the bias for other intra-prediction modes; determining whether SAD_intra is less than the sum; and when SAD_intra is less than the sum, determining whether to use another intra-prediction mode to replace the IBC mode for the current sub-block. The preset bias can be set according to requirements; this allows for flexible setting of the bias for the vertical prediction mode according to the coding scenario, enabling the selection of a better intra-prediction mode for each sub-block in the CU, thereby improving prediction accuracy.

[0044] According to the second aspect, or any implementation of the second aspect above, determining whether to use another intra-prediction mode to replace the IBC mode based on SAD_IBC and SAD_intra further includes: when SAD_intra is less than the sum of its values, determining whether SAD_intra is less than SAD_TH, where SAD_TH is the maximum upper limit of the sum of absolute errors corresponding to other intra-prediction modes; when SAD_intra is less than SAD_TH, determining whether to use another intra-prediction mode to replace the IBC mode for the current sub-block. This improves the prediction accuracy of other intra-prediction modes, thereby improving compression performance.

[0045] According to the second aspect, or any implementation of the second aspect above, other intra-frame prediction modes are vertical prediction modes, and the first prediction value is determined based on vertical prediction.

[0046] According to the second aspect, or any implementation of the second aspect above, determining the sum of absolute errors between the current sub-block and the first predicted values ​​to obtain SAD_intra includes: calculating the sum of absolute errors between the current sub-block and R first predicted values ​​to obtain R SAD_R; wherein, a first predicted value is determined based on another intra-frame prediction mode, and R is a positive integer; taking the SAD_R with the smallest value as SAD_intra; the method further includes: selecting a preset value from R preset values ​​based on the other intra-frame prediction mode corresponding to the SAD_R with the smallest value, as the first preset information; wherein, the R preset values ​​correspond one-to-one with the R other intra-frame prediction modes; the BV set as the first preset information is used to indicate the prediction mode of the current sub-block, which is the other intra-frame prediction mode corresponding to the SAD_R with the smallest value; the first predicted value is determined based on the other intra-frame prediction corresponding to the SAD_R with the smallest value.

[0047] In other words, the encoder can select one of R other intra-prediction modes; for the current sub-block, it determines whether to replace the IBC mode with another intra-prediction mode. This allows for the nesting of any one or more of the R other intra-coding methods within the IBC mode, further improving the flexibility of CU coding unit prediction and thus enhancing prediction accuracy.

[0048] According to the second aspect, or any implementation of the second aspect above, when it is determined that another intra-frame prediction mode will be used to replace the IBC mode, the method further includes: determining the flatness of the current sub-block; determining the quantization parameter QP_intra corresponding to the current sub-block based on the flatness of the current sub-block; encoding the current sub-block based on the prediction value of the current sub-block to obtain the bit stream of the current sub-block, including: quantizing the prediction residual between the prediction values ​​of the current sub-block and the prediction value of the current sub-block based on the quantization parameter QP_intra corresponding to the current sub-block; and entropy encoding the quantized prediction residual to obtain the bit stream of the current sub-block.

[0049] According to the second aspect, or any implementation of the second aspect above, the quantization parameter QP_intra corresponding to the current sub-block is determined based on the flatness of the current sub-block, including: determining the complexity information of the CU and the quantization parameter QP_IBC corresponding to the CU; and determining the quantization parameter QP_intra corresponding to the current sub-block based on the flatness, complexity information and quantization parameter QP_IBC of the current sub-block.

[0050] According to the second aspect, or any implementation of the second aspect above, the quantization parameter QP_intra corresponding to the current sub-block is determined based on the flatness and complexity information of the current sub-block and the quantization parameter QP_IBC, including: when the flatness and complexity information of the current sub-block meets the first preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined based on the quantization parameter QP_IBC and the first preset step size; when the flatness and complexity information of the current sub-block meets the second preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined based on the quantization parameter QP_IBC and the second preset step size; when the flatness and complexity information of the current sub-block meets the third preset condition, the quantization parameter QP_IBC is used as the quantization parameter QP_intra corresponding to the current sub-block.

[0051] Determine the flatness of the current sub-block according to the second aspect, or any implementation of the second aspect above, including: determining the flatness of the current sub-block based on the reconstructed sub-blocks adjacent to the current sub-block.

[0052] The second aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects of the second aspect and any implementation thereof are similar to those of the first aspect and any implementation thereof, and will not be repeated here.

[0053] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor, the memory being coupled to the processor; the memory storing program instructions, which, when executed by the processor, cause the electronic device to perform the decoding method in the first aspect or any possible implementation of the first aspect.

[0054] The third aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects of the third aspect and any implementation thereof are similar to those of the first aspect and any implementation thereof, and will not be repeated here.

[0055] Fourthly, embodiments of this application provide an electronic device, including: a memory and a processor, the memory being coupled to the processor; the memory storing program instructions, which, when executed by the processor, cause the electronic device to perform the encoding method in the second aspect or any possible implementation of the second aspect.

[0056] The fourth aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects of the fourth aspect and any implementation thereof can be found in the technical effects of the second aspect and any implementation thereof, as described above, and will not be repeated here.

[0057] Fifthly, embodiments of this application provide a chip including one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits, and when the one or more processors execute computer instructions, the processors execute the decoding method in the first aspect or any possible implementation of the first aspect.

[0058] The fifth aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects of the fifth aspect and any implementation thereof are similar to those of the first aspect and any implementation thereof, and will not be repeated here.

[0059] In a sixth aspect, embodiments of this application provide a chip including one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits, and when the one or more processors execute computer instructions, the processors execute the encoding method in the second aspect or any possible implementation of the second aspect.

[0060] The sixth aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects of the sixth aspect and any implementation thereof are similar to those of the second aspect and any implementation thereof, and will not be repeated here.

[0061] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer or processor, causes the computer or processor to execute the decoding method in the first aspect or any possible implementation thereof.

[0062] The seventh aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects of the seventh aspect and any implementation thereof are similar to those of the first aspect and any implementation thereof, and will not be repeated here.

[0063] Eighthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer or processor, causes the computer or processor to execute the encoding method in the second aspect or any possible implementation thereof.

[0064] The eighth aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects corresponding to the eighth aspect and any implementation thereof are similar to those corresponding to the second aspect and any implementation thereof, and will not be repeated here.

[0065] Ninthly, embodiments of this application provide a computer program product, the computer program product including computer instructions, which, when executed by a computer or processor, cause the computer or processor to perform the decoding method in the first aspect or any possible implementation of the first aspect.

[0066] The ninth aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects corresponding to the ninth aspect and any implementation thereof are similar to those corresponding to the first aspect and any implementation thereof, and will not be repeated here.

[0067] In a tenth aspect, embodiments of this application provide a computer program product, the computer program product including computer instructions, which, when executed by a computer or processor, cause the computer or processor to perform the encoding method in the second aspect or any possible implementation of the second aspect.

[0068] The tenth aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects corresponding to the tenth aspect and any implementation thereof are similar to those corresponding to the second aspect and any implementation thereof, and will not be repeated here.

[0069] Eleventhly, embodiments of this application provide an apparatus for storing bit streams, the apparatus comprising: a receiver and at least one storage medium, the receiver being used to receive the bit stream; the at least one storage medium being used to store the bit stream; the bit stream being generated according to the second aspect and any implementation thereof.

[0070] The eleventh aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects corresponding to the eleventh aspect and any implementation thereof can be found in the technical effects corresponding to the second aspect and any implementation thereof, as described above, and will not be repeated here.

[0071] In a twelfth aspect, embodiments of this application provide an apparatus for transmitting a bit stream, the apparatus comprising: a transmitter and at least one storage medium, the at least one storage medium being used to store the bit stream, the bit stream being generated according to the second aspect and any implementation thereof; the transmitter being used to obtain the bit stream from the storage medium and transmit the bit stream to an end-side device via the transmission medium.

[0072] The twelfth aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects corresponding to the twelfth aspect and any implementation thereof are similar to those corresponding to the second aspect and any implementation thereof, and will not be repeated here.

[0073] In a thirteenth aspect, embodiments of this application provide a system for distributing bitstreams, the system comprising: at least one storage medium for storing at least one bitstream, the at least one bitstream being generated according to the second aspect and any implementation thereof; and a streaming media device for acquiring a target bitstream from the at least one storage medium and sending the target bitstream to an end-side device, wherein the streaming media device includes a content server or a content distribution server.

[0074] The thirteenth aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects corresponding to the thirteenth aspect and any implementation thereof are similar to those corresponding to the second aspect and any implementation thereof, and will not be repeated here. Attached Figure Description

[0075] Figure 1a This is a schematic diagram illustrating an application scenario;

[0076] Figure 1b This is a schematic diagram illustrating the structure of an encoder and decoder as an example.

[0077] Figure 2a This is a schematic diagram of the encoding process as an example.

[0078] Figure 2b This is a schematic diagram illustrating the encoding process as an example.

[0079] Figure 3aThis is a schematic diagram illustrating the decoding process as an example.

[0080] Figure 3b This is a schematic diagram illustrating the decoding process as an example.

[0081] Figure 4a This is a schematic diagram illustrating the encoding process as an example.

[0082] Figure 4b This is a schematic diagram illustrating the search area for IBC prediction as an example.

[0083] Figure 4c A schematic diagram of a reference block for vertical prediction, as exemplarily shown;

[0084] Figure 5 This is a schematic diagram illustrating the decoding process as an example.

[0085] Figure 6 This is a schematic diagram illustrating the encoding process as an example.

[0086] Figure 7 This is a schematic diagram illustrating the decoding process as an example.

[0087] Figure 8a This is a schematic diagram of the encoding process as an example.

[0088] Figure 8b This is a schematic diagram illustrating the encoding process as an example.

[0089] Figure 9a This is a schematic diagram illustrating the decoding process as an example.

[0090] Figure 9b This is a schematic diagram illustrating the decoding process as an example.

[0091] Figure 10 This is a schematic diagram of the structure of an exemplary device. Detailed Implementation

[0092] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0093] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0094] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first target object" and "second target object," etc., are used to distinguish different target objects, not to describe a specific order of target objects.

[0095] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0096] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple processing units means two or more processing units; multiple systems means two or more systems.

[0097] The encoding and decoding method of this application can be applied to various video service scenarios, such as video conferencing scenarios, video phone scenarios, online education scenarios, remote tutoring scenarios, low-latency live streaming scenarios, cloud gaming scenarios, wireless screen sharing scenarios, and wireless extended screen scenarios, etc. The embodiments of this application do not limit this.

[0098] Figure 1a This is a schematic diagram illustrating an application scenario.

[0099] Reference Figure 1a For example, the first device may include a video acquisition module, an encoding module (or encoder), and a transmission module. For example, the encoding module may be a software module or a hardware module, and this application embodiment is not limited in this regard. It should be understood that... Figure 1a This is merely one example of the first device; in other embodiments of this application, the first device has a greater... Figure 1a The embodiments of this application do not limit the number of modules shown.

[0100] Reference Figure 1a For example, the second device may include a display module, a decoding module (or decoder), and a receiving module. For example, the decoding module may be a software module or a hardware module, and this application embodiment is not limited in this regard. It should be understood that... Figure 1a This is merely one example of a second device; in other embodiments of this application, the second device has a greater... Figure 1a The embodiments of this application do not limit the number of modules shown.

[0101] Continue to refer to Figure 1aFor example, after the video acquisition module of the first device acquires the raw video data, the process of sending the acquired raw video data to the second device for display is as follows: The video acquisition module can output the acquired raw video data to the encoding module; then, the encoding module can encode the raw video data to obtain a bit stream (wherein, a bit stream can also be called a bitstream or code stream), and output the encoded bit stream to the sending module; afterwards, the sending module can send the bit stream to the second device. Subsequently, the receiving module of the second device can receive the bit stream; then, it outputs the bit stream to the decoding module; next, the decoding module can decode the bit stream to obtain reconstructed video data and output the reconstructed video data to the display module, which then displays the reconstructed video data.

[0102] For example, the first device includes, but is not limited to: a server, a PC (Personal Computer), a laptop, a tablet, a mobile phone, and a watch.

[0103] For example, the second device includes, but is not limited to: PC, laptop, tablet, mobile phone, and watch.

[0104] For example, in a video conferencing scenario, the first device can be a PC or a laptop, and the second device can be a PC or a laptop.

[0105] For example, in an online education scenario, the first device can be a PC or laptop, and the second device can be a tablet.

[0106] For example, in a cloud gaming scenario, the first device can be a server, and the second device can be a tablet, PC, laptop, or mobile phone.

[0107] It should be understood that this application can also be applied to scenarios involving image encoding and decoding, and this application does not limit it in this regard.

[0108] Figure 1b This is a schematic diagram illustrating the structure of an encoder and decoder as an example.

[0109] Reference Figure 1b (1) For example, the encoder may include a prediction module, a quantization module, and an entropy coding module. The prediction module can be used for encoding prediction (e.g., inter-frame prediction, intra-frame prediction); the quantization module can perform quantization based on quantization parameters; and the entropy coding module can be used for entropy coding (e.g., arithmetic coding, Huffman coding, etc.). For example, after the image to be encoded is input to the encoder, the encoder sequentially inputs the image to be encoded into the prediction module, the quantization module, and the entropy coding module for processing, and outputs a bitstream.

[0110] It should be understood that the encoder of this application may include more than Figure 1b(1) Other modules shown, for example, the encoder may also include a bit rate control module (which adjusts the output bit rate by changing the quantization parameters, encoding mode, etc. of the encoding), etc., and this application does not limit this.

[0111] Reference Figure 1b (2) For example, the decoder may include a prediction module, an inverse quantization module, and an entropy decoding module. The entropy decoding module is used for entropy decoding; the inverse quantization module is used for inverse quantization based on quantization parameters; and the prediction module is used for decoding prediction. For example, after the bitstream is input to the decoder, it is processed sequentially by the entropy decoding, inverse quantization, and prediction modules to output a reconstructed image.

[0112] It should be understood that the decoder of this application may include more than Figure 1b (2) Further modules are shown, for example, the decoder may also include a rate control module (for determining quantization parameters), etc., which are not limited in this application.

[0113] The following is Figure 1b Taking intra-frame prediction as an example, the encoding and decoding process (i.e., intra-frame encoding and intra-frame decoding) is explained.

[0114] To address the high search costs (such as low search efficiency, high computational requirements, and high hardware costs) of existing technologies for coding units with IBC prediction modes, this application proposes an encoding / decoding method for coding units with IBC prediction modes. One key concept is to nest other intra-frame prediction modes within the IBC mode and identify each sub-block using a block vector (BV). The BV can be not only the absolute vector offset between the sub-block and its corresponding reference block but also an indication of other intra-frame prediction modes. This approach avoids increasing the bitrate and the search area for IBC prediction while increasing the flexibility of coding unit prediction, achieving finer-grained prediction, improving prediction accuracy, and ultimately enhancing compression performance.

[0115] Other intra-frame prediction modes can refer to intra-frame prediction modules other than IBC mode, such as vertical prediction mode, angle prediction mode, and direct current (DC) prediction mode, etc. This application does not limit them.

[0116] The following uses the encoding and decoding of an image as an example to illustrate the encoding and decoding method of this application.

[0117] Figure 2a This is a schematic diagram illustrating the encoding process as an example.

[0118] Reference Figure 2aFor example, after the image to be encoded is input into the encoder, the encoder can divide the image into multiple coding units (CUs), such as CU1, CU2, ... Then, after performing prediction, quantization, and entropy coding operations on CU1 in sequence, the bit stream of CU1 can be obtained; after performing prediction, quantization, and entropy coding operations on CU2 in sequence, the bit stream of CU2 can be obtained; and so on, after encoding all CUs of the image to be encoded, the bit streams of all CUs are concatenated to obtain the bit stream of the image to be encoded.

[0119] During the encoding of CU1, quantization can be performed according to preset quantization parameters. When encoding subsequent CUs, the complexity information (such as complexity level) of the current CU can be determined first based on its image content. Then, bitrate control is performed based on the number of encoded bits of the previous CU and the complexity level of the current CU (bitrate control is executed by the bitrate control module, which adjusts the output bitrate by changing the quantization parameters and encoding mode based on the analysis of the number of encoded bits of the previous CU and the complexity level of the current CU), to obtain the quantization parameters. Afterwards, the quantization module can perform quantization based on the quantization parameters determined by the bitrate control. The encoder can also write the complexity information of the CU into the CU's bitstream so that the decoder can obtain the CU's complexity information from the bitstream to determine the quantization parameters required for inverse quantization.

[0120] It should be understood that the rate control module can also perform rate control and output quantization parameters based solely on the number of encoded bits (or the full size of the buffer) of the previous CU; that is, this application does not restrict the way the rate control module determines the quantization parameters. This application uses the example of the rate control module performing rate control based on the number of encoded bits of the previous CU and the complexity information of the current CU for illustration.

[0121] The following uses a CU with IBC prediction mode as an example to illustrate the encoding process.

[0122] Figure 2b This is a schematic diagram illustrating the encoding process as an example.

[0123] S201, acquire the coding unit CU and divide the CU into multiple sub-blocks. The prediction mode of the CU is IBC mode.

[0124] For example, for a CU with IBC prediction mode, the encoder can divide the CU into multiple sub-blocks; this application does not limit the number of sub-blocks or the size of the sub-blocks. For example, the decoder can divide the CU into multiple sub-blocks of the same size.

[0125] The following explanation uses a sub-block as an example.

[0126] S202, for the current sub-block, determine whether to use other intra-prediction modes to replace the IBC mode.

[0127] For example, for the current sub-block, it can be determined whether to still use the IBC mode for intra-frame prediction or to use another intra-frame prediction mode. That is, for the current sub-block, it can be determined whether to use another intra-frame prediction mode to replace the IBC mode. The specific determination method will be explained later.

[0128] For example, if it is determined that another intra-prediction mode will be used instead of the IBC mode for the current sub-block, S203 can be executed; if it is determined that another intra-prediction mode will not be used instead of the IBC mode for the current sub-block, S205 can be executed.

[0129] S203, set the BV of the current sub-block to the first preset information; wherein, the BV set to the first preset information is used to indicate that the prediction mode of the current sub-block is another intra-frame prediction mode.

[0130] For example, when it is determined that another intra-prediction mode will be used instead of the IBC mode, the BV of the current sub-block can be set to the first preset information; in this case, the BV set to the first preset information can be used to indicate that the prediction mode of the current sub-block is another intra-prediction mode.

[0131] The first preset information can be set as needed. For example, when other intra-frame prediction modes are vertical prediction modes, the first preset information can be a preset value Y1; for example, when other intra-frame prediction modes are angle prediction modes, the first preset information can be a preset value Y2; for example, when other intra-frame prediction modes are DC prediction modes, the first preset information can be a preset value Y3.

[0132] S204, set the prediction value of the current sub-block to the first prediction value; wherein the first prediction value is determined based on other intra-frame predictions.

[0133] For example, when it is determined that an other intra-prediction mode should be used instead of the IBC mode, the prediction value of the current sub-block can also be set to a first prediction value determined based on other intra-prediction performed on the current sub-block.

[0134] S205, set the BV of the current sub-block to the second preset information; wherein, the BV set to the second preset information is used to indicate that the prediction mode of the current sub-block is IBC mode, and the second preset information is the vector absolute value offset between the current sub-block and the reference block, and the reference block is determined based on IBC prediction.

[0135] For example, when it is determined that no other intra-prediction mode will be used to replace the IBC mode, the absolute vector offset between the current sub-block and the reference block (which can be represented by the second preset information) can be used as the BV of the current sub-block. The reference block is determined by performing IBC prediction on the current sub-block. In this case, the BV set as the second preset information can be used to indicate that the prediction mode of the current sub-block is IBC mode.

[0136] S206, set the predicted value of the current sub-block to the second predicted value; wherein the second predicted value is determined based on the IBC prediction.

[0137] For example, if it is determined that no other intra-prediction mode will be used to replace the IBC mode for the current sub-block, the prediction value of the current sub-block can be set to a second prediction value determined based on the IBC prediction performed for the current sub-block.

[0138] It should be noted that in this application, the search area corresponding to the IBC prediction is the left region of the current sub-block (excluding the top-left corner region of the current sub-block), and the second prediction value is determined based on the reconstruction value of the reference block. The reconstruction value of the reference block is the second prediction value.

[0139] The second preset information can be obtained by calculating the absolute value of the difference between the x-coordinate of the current sub-block and the x-coordinate of the reference block.

[0140] It should be noted that the second preset information is different from the first preset information.

[0141] S207, Encode the current sub-block based on the predicted value of the current sub-block to obtain the bit stream of the current sub-block.

[0142] For example, the prediction value of the current sub-block and the prediction residual between the current sub-block can be calculated; then, the prediction residual can be quantized based on the quantization parameters; after that, the quantized prediction residual can be entropy encoded to obtain the bit stream of the current sub-block.

[0143] S208, write the BV of the current sub-block to the bit stream.

[0144] For example, in order for the decoder to determine the prediction mode of the current sub-block, the BV of the current sub-block can be written into the bit stream.

[0145] For example, the bit streams of multiple sub-blocks included in a CU can be concatenated to form the bit stream of that CU.

[0146] Figure 3a This is a schematic diagram illustrating the decoding process as an example.

[0147] Reference Figure 3aFor example, after the bitstream of CU1 is input to the decoder, the decoder can sequentially perform entropy decoding, inverse quantization, and prediction operations to output the reconstructed image of CU1. Next, after the bitstream of CU2 is input to the encoder, the decoder can sequentially perform entropy decoding, inverse quantization, and prediction operations to output the reconstructed image of CU2; and so on, after decoding all CUs of the same image, the reconstructed images of all CUs can be stitched together to obtain a complete image.

[0148] In the process of decoding CU1, dequantization can be performed according to preset quantization parameters. In the process of decoding other subsequent CUs, the quantization parameters can be determined by first performing code rate control based on the complexity information (such as complexity level) obtained from the bit stream of the current CU (i.e., entropy decoding) and the number of encoded bits of the previous CU. After that, the dequantization module can perform dequantization based on the quantization parameters determined by the code rate control.

[0149] The following example uses a sub-block of a CU with IBC prediction mode to illustrate the decoding process.

[0150] Figure 3b This is a schematic diagram illustrating an exemplary decoding process. Figure 3b The decoding process and Figure 2b The encoding process corresponds to this.

[0151] S301, Receive bit stream.

[0152] S302, parse the BV of the current sub-block from the bit stream. The intra-prediction mode of the coding unit (CU) to which the current sub-block belongs is IBC mode.

[0153] For example, the encoder writes the BV of the current sub-block into the bit stream; then, after the decoder receives the bit stream, it can parse (i.e., entropy decode) the BV of the current sub-block from the bit stream.

[0154] S303, for the current sub-block, determine whether to use other intra-prediction modes to replace the IBC mode based on the BV of the current sub-block.

[0155] For example, since the encoder nests other intra-frame coding modes in the IBC mode, after the decoder parses the BV of the current sub-block from the bit stream, it can determine whether the prediction mode of the current sub-block is the IBC mode or another intra-frame prediction mode based on the BV of the current sub-block; that is, for the current sub-block, it determines whether to use another intra-frame prediction mode to replace the IBC mode based on the BV of the current sub-block.

[0156] For example, by determining whether the BV of the current sub-block is the first preset information, it can be determined whether to use another intra-prediction mode to replace the IBC mode for the current sub-block. If the BV of the current sub-block is the first preset information, then for the current sub-block, it can be determined that another intra-prediction mode will be used to replace the IBC mode; at this time, S304 can be executed. If the BV of the current sub-block is not the first preset information, then it can be determined that the BV of the current sub-block is the second preset information; at this time, for the current sub-block, it can be determined that another intra-prediction mode will not be used to replace the IBC mode; at this time, S305 can be executed.

[0157] S304, perform other intra-frame predictions on the current sub-block to obtain the predicted value of the current sub-block.

[0158] For example, if it is determined that another intra-prediction mode will be used instead of the IBC mode for the current sub-block, then other intra-prediction modes can be performed on the current sub-block to obtain the predicted value of the current sub-block.

[0159] S305, perform IBC prediction on the current sub-block based on the BV of the current sub-block to obtain the predicted value of the current sub-block.

[0160] For example, if it is determined that no other intra-frame prediction mode will be used to replace the IBC mode for the current sub-block, then IBC prediction can be performed on the current sub-block based on the BV (i.e., the second preset information) of the current sub-block to obtain the prediction value of the current sub-block.

[0161] For example, the reference block of the current sub-block can be determined from the decoded sub-blocks based on the position coordinates of the current sub-block and the second preset information; the reconstructed value of the reference block of the current sub-block is used as the predicted value of the current sub-block.

[0162] S306, Reconstruct the current sub-block based on the predicted value of the current sub-block to obtain the reconstructed block of the current sub-block.

[0163] For example, after receiving the bit stream, the decoder can parse (i.e., entropy decoding) the bit stream to obtain the quantized prediction residual; then, the quantized prediction residual is dequantized to obtain the prediction residual of the current sub-block. Afterwards, the prediction value of the current sub-block can be added to the prediction residual of the current sub-block to obtain the reconstructed block of the current sub-block.

[0164] For example, the reconstruction blocks of multiple sub-blocks included in a CU can be stitched together to form a reconstructed image of the CU.

[0165] Thus, according to Figure 2b Encoding methods in the embodiments and Figure 3bThe decoding method described in the text can be used for encoding and decoding without increasing the bit rate or the search area for IBC prediction. It can also increase the flexibility of coding unit prediction, achieve finer-grained prediction, improve prediction accuracy, and thus improve compression efficiency.

[0166] The following explanation uses vertical prediction mode as an example of other intra-frame prediction modes to illustrate the encoding and decoding process.

[0167] Figure 4a This is a schematic diagram illustrating the encoding process as an example.

[0168] S401, acquire the coding unit CU and divide the CU into multiple sub-blocks, the prediction mode of the CU is IBC mode.

[0169] For example, S401 can be described with reference to the above description of S201, and will not be repeated here.

[0170] S402, for the current sub-block, determine whether to use vertical prediction mode instead of IBC mode.

[0171] For example, for the current sub-block, it can be determined whether to still use the IBC mode for intra-frame prediction or to use the vertical prediction mode for intra-frame prediction. That is, for the current sub-block, it can be determined whether to use the vertical prediction mode instead of the IBC mode. The specific determination process can be as follows: S4021 to S4023:

[0172] S4021, perform IBC prediction on the current sub-block to determine the reference block; calculate the sum of absolute differences (SAD) between the current sub-block and the reference block to obtain SAD_IBC.

[0173] For example, the search region corresponding to the IBC prediction in this application is the left region of the current sub-block. (See reference...) Figure 4b ,exist Figure 4b In the diagram, each sub-block has a size of 2*2; gray sub-blocks are encoded sub-blocks, white sub-blocks are uncoded sub-blocks, and the sub-block within the dashed box is the current sub-block. The area to the left of the current sub-block can be used as the search area, such as... Figure 4b As shown.

[0174] For example, the search region may include n candidate reference blocks (n is a positive integer, which can be set as needed, and this application does not impose any restrictions on it). The absolute vector offset between the first candidate reference block and the current sub-block can be set to X1 (the first candidate reference block can be called the candidate reference block corresponding to X1); the absolute vector offset between the second candidate reference block and the current sub-block can be set to X2 (the second candidate reference block can be called the candidate reference block corresponding to X2); and so on, the absolute vector offset between the nth candidate reference block and the current sub-block can be set to Xn (the nth candidate reference block can be called the candidate reference block corresponding to Xn). It should be understood that the n values ​​from X1 to Xn can be set as needed, and X1 to Xn are all different. For example, X1 = 1, X2 = 2, ..., Xn = n.

[0175] For example, the sum of absolute errors between the candidate reference block corresponding to X1 and the current sub-block can be calculated to obtain SAD_X1; the sum of absolute errors between the candidate reference block corresponding to X2 and the current sub-block can be calculated to obtain SAD_X2; ...; and the sum of absolute errors between the candidate reference block corresponding to Xn and the current sub-block can be calculated to obtain SAD_Xn. Then, based on SAD_X1, SAD_X2, ..., SAD_Xn, a second preset information can be selected from the range X1 to Xn. Specifically, by comparing SAD_X1, SAD_X2, ..., SAD_Xn, the candidate reference block with the smallest sum of absolute errors can be selected from multiple candidate reference blocks as the reference block. Assuming that the sum of absolute errors SAD_Xm of the m-th (m∈[1,n], m is an integer) candidate reference block is the smallest, then Xm is selected from the range X1 to Xn as the second preset information, i.e., the second preset information = Xm. Correspondingly, the SAD_IBC of the current sub-block and the reference block = SAD_Xm.

[0176] S4022, perform vertical prediction on the current sub-block to obtain the first predicted value; calculate the sum of absolute errors between the current sub-block and the first predicted value to obtain SAD_intra.

[0177] For example, during the vertical prediction process, the pixel point in the row above the current sub-block with the same horizontal coordinate as the current sub-block (the pixel point can also be called a sample) can be determined as the reference block of the current sub-block; then, based on the reconstruction value of the reference block of the current sub-block, the first predicted value of the current sub-block is determined; then, the sum of the absolute errors between the current sub-block and the first predicted value is calculated to obtain SAD_intra.

[0178] Reference Figure 4c In the example, in Figure 4cIn the diagram, each sub-block has a size of 2*2; gray sub-blocks are encoded sub-blocks, white sub-blocks are uncoded sub-blocks, and the sub-block within the dashed box is the current sub-block. The vertical prediction process can be as follows: the 1*2 area above the current sub-block can be used as a reference block; then, the reconstructed value of the pixel corresponding to "1" is used as the first predicted value of the pixel corresponding to "A"; the reconstructed value of the pixel corresponding to "2" is used as the first predicted value of the pixel corresponding to "B"; the first predicted value of the pixel corresponding to "A" is used as the first predicted value of the pixel corresponding to "C"; and the first predicted value of the pixel corresponding to "B" is used as the first predicted value of the pixel corresponding to "D".

[0179] For example, a preset value Y1 can be used as the first preset information; wherein the preset value Y1 is different from all of the above X1 to Xn; wherein the preset value Y1 can be set as needed, such as 0, and this application does not limit it.

[0180] S4023, for the current sub-block, based on SAD_IBC and SAD_intra, determine whether to use other intra-prediction modes to replace the IBC mode.

[0181] Then, for the current sub-block, it can be determined whether to use other intra-prediction modes to replace the IBC mode by comparing SAD_IBC and SAD_intra.

[0182] In one possible approach, the sum of SAD_IBC and a preset bias, where the preset bias is the bias for the vertical prediction mode, can be determined. Then, it can be determined whether SAD_intra is less than the sum. If SAD_intra is less than the sum, it is determined that for the current sub-block, another intra-prediction mode should be used instead of the IBC mode. If SAD_intra is greater than or equal to the sum, it is determined that for the current sub-block, another intra-prediction mode should not be used instead of the IBC mode.

[0183] For example, the prediction bias can be represented by M1, where M1 is an integer and can be set according to requirements; this application does not impose any restrictions on this. This allows for flexible setting of the bias for the vertical prediction mode according to the coding scenario, enabling the selection of a better intra-frame prediction mode for each sub-block in the CU, thereby improving prediction accuracy. Specifically, the larger M1 is, the higher the bias for the vertical prediction mode; conversely, the smaller M1 is, the lower the bias. In one example, M1 = 0. In another example, M1 = 2.

[0184] In one possible approach, the sum of SAD_IBC and a preset bias, where the preset bias is the bias for the vertical prediction mode, can be determined. Then, it can be determined whether SAD_intra is less than the sum. If SAD_intra is less than the sum, it can be determined whether SAD_intra is less than SAD_TH. If SAD_intra is less than SAD_TH, for the current sub-block, it can be determined that the vertical prediction mode will be used instead of the IBC mode. If SAD_intra is greater than or equal to the sum, or if SAD_intra is greater than SAD_TH, for the current sub-block, it can be determined that the vertical prediction mode will not be used instead of the IBC mode.

[0185] SAD_TH represents the maximum upper limit of the sum of absolute errors for other intra-frame prediction modes. SAD_TH can be set according to requirements, for example, based on parameters such as bit depth, encoding format, and number of sub-block pixels. This can improve the prediction performance of vertical prediction.

[0186] For example, if it is determined that the vertical prediction mode will not be used to replace the IBC mode for the current sub-block, S403 can be executed; if it is determined that the vertical prediction mode will be used to replace the IBC mode, S405 can be executed.

[0187] S403, set the BV of the current sub-block to the first preset information; wherein, the BV set to the first preset information is used to indicate that the prediction mode of the current sub-block is the vertical prediction mode.

[0188] S404, set the predicted value of the current sub-block to the first predicted value; wherein the first predicted value is determined based on the vertical prediction.

[0189] S405, set the block vector BV of the current sub-block to the second preset information; wherein, the BV set to the second preset information is used to indicate that the prediction mode of the current sub-block is IBC mode, and the second preset information is the vector absolute value offset between the current sub-block and the reference block, and the reference block is determined based on IBC prediction.

[0190] S406, set the predicted value of the current sub-block to the second predicted value; wherein the second predicted value is determined based on the IBC prediction.

[0191] For example, in the above S402 process, IBC prediction is performed for the current sub-block to determine the reference block of the current sub-block; the reconstruction value of the reference block can be used as the second prediction value.

[0192] For example, S405 to S406 can be referred to the description of S205 to S206 above, and will not be repeated here.

[0193] S407, Encode the current sub-block based on the predicted value of the current sub-block to obtain the bit stream of the current sub-block.

[0194] S408, write the BV of the current sub-block to the bit stream.

[0195] For example, S407 to S408 can be referred to the description of S207 to S208 above, and will not be repeated here.

[0196] Figure 5 This is a schematic diagram illustrating the decoding process as an example. Figure 5 The encoding process and Figure 4a The encoding process corresponds to this.

[0197] S501, receive bit stream.

[0198] S502, the BV of the current sub-block is parsed from the bit stream. The intra-prediction mode of the coding unit (CU) to which the current sub-block belongs is the block copy intra-prediction (IBC) mode.

[0199] For example, S501 to S502 can be referred to the description of S201 to S202 above, and will not be repeated here.

[0200] S503, determine whether the BV of the current sub-block is the first preset information.

[0201] For example, if the BV of the current sub-block is the first preset information, then S504 can be executed; if the BV of the current sub-block is not the first preset information, then S505 can be executed.

[0202] S504, perform vertical prediction on the current sub-block to obtain the predicted value of the current sub-block.

[0203] For example, the process of vertical prediction of the current sub-block in S504 can be referred to the above description, and will not be repeated here.

[0204] S505, perform IBC prediction on the current sub-block based on the BV of the current sub-block to obtain the predicted value of the current sub-block.

[0205] S506, Reconstruct the current sub-block based on the predicted value of the current sub-block to obtain the reconstructed block of the current sub-block.

[0206] For example, S505 to S506 can be referred to the description of S305 to S306 above, and will not be repeated here.

[0207] For example, one of the R other intra-prediction modes can be selected. For the current sub-block, it can be determined whether to use the selected other intra-prediction mode to replace the IBC mode; where R is a positive integer.

[0208] Figure 6 This is a schematic diagram illustrating the encoding process as an example.

[0209] S601, acquire the coding unit CU and divide the CU into multiple sub-blocks, the prediction mode of the CU is IBC mode.

[0210] For example, S601 can be described with reference to the above description of S201, and will not be repeated here.

[0211] For example, one of the R other intra-prediction modes can be selected; then, for the current sub-block, it can be determined whether to use the selected other intra-prediction mode to replace the IBC mode; the specific determination process can be as follows: S602 to S606:

[0212] S602, perform IBC prediction on the current sub-block to determine the reference block; calculate the sum of absolute errors between the current sub-block and the reference block to obtain SAD_IBC.

[0213] For example, S602 can be described with reference to the above description of S4021, and will not be repeated here.

[0214] S603, perform R other intra-frame predictions on the current sub-block to determine R first prediction values; calculate the sum of absolute errors between the current sub-block and the R first prediction values ​​to obtain R SAD_R values.

[0215] For example, R other intra-frame predictions can be performed on the current sub-block to determine R first prediction values, where each first prediction value is determined based on one of the other intra-frame predictions for the current sub-block. Then, the sum of the absolute errors between each of the R first prediction values ​​and the current sub-block can be calculated to obtain R SAD_R values. Each of the R SAD_R values ​​corresponds to one of the other intra-frame prediction modes.

[0216] S604 sets the smallest value of SAD_R as SAD_intra.

[0217] Then, the SAD_R with the smallest value can be selected from the R SAD_R values.

[0218] S605, based on the other intra-frame prediction modes corresponding to the smallest SAD_R, selects a preset value from R preset values ​​as the first preset information.

[0219] For example, corresponding preset values ​​R can be set in advance for R other intra-frame prediction modes; wherein, the R preset values ​​correspond one-to-one with the R other intra-frame prediction modes, and the preset values ​​corresponding to different other intra-frame prediction modes are different.

[0220] Suppose that the smallest SAD_R is the i-th SAD_R among R SAD_Rs, then the i-th SAD_R can be taken as SAD_intra. Here, the i-th SAD_R is the sum of absolute errors between the current sub-block and the i-th first prediction value determined based on the i-th other intra-prediction method. The i-th preset value corresponds to the i-th other intra-prediction mode, and i is an integer between 1 and R (inclusive). Furthermore, the preset value corresponding to the i-th other intra-prediction mode can also be used as the first preset information.

[0221] For example, R=3, the three other intra-frame prediction modes include: vertical prediction mode, angle prediction mode and DC prediction mode; where the vertical prediction mode corresponds to the preset value Y1, the angle prediction mode corresponds to the preset value Y2, and the DC prediction mode corresponds to the preset value Y3.

[0222] Calculate the sum of absolute errors between the current sub-block and the first predicted value determined based on vertical prediction to obtain SAD1_intra. Calculate the sum of absolute errors between the current sub-block and the first predicted value determined based on angle prediction to obtain SAD2_intra. Calculate the sum of absolute errors between the current sub-block and the third predicted value determined based on DC prediction to obtain SAD3_intra.

[0223] Next, the first preset information and SAD_intra can be determined based on SAD1_intra, SAD2_intra, and SAD3_intra. When SAD1_intra is the smallest, the preset value Y1 is used as the first preset information, and SAD1_intra is used as SAD_intra. When SAD2_intra is the smallest, the preset value Y2 is used as the first preset information, and SAD2_intra is used as SAD_intra. When SAD3_intra is the smallest among SAD1_intra, SAD2_intra, and SAD3_intra, the preset value Y3 is used as the first preset information, and SAD3_intra is used as SAD_intra.

[0224] S606, for the current sub-block, based on SAD_IBC and SAD_intra, determine whether to use other intra-prediction modes to replace the IBC mode.

[0225] For example, S606 can be described with reference to the above description of S4023, and will not be repeated here.

[0226] For example, if it is determined that no other intra-prediction mode will be used to replace the IBC mode for the current sub-block, S607 can be executed; if it is determined that no other intra-prediction mode will be used to replace the IBC mode for the current sub-block, S609 can be executed.

[0227] S607, set the BV of the current sub-block to the first preset information; wherein, the BV set to the first preset information is used to indicate the prediction mode of the current sub-block, which is the other intra-frame prediction mode corresponding to the smallest SAD_R value.

[0228] S608, set the prediction value of the current sub-block to the first prediction value; wherein the first prediction value is determined based on the other intra-frame predictions corresponding to the smallest SAD_R value.

[0229] S609, set the block vector BV of the current sub-block to the second preset information; wherein, the BV set to the second preset information is used to indicate that the prediction mode of the current sub-block is IBC mode, the second preset information is the vector absolute value offset between the current sub-block and the reference block, and the second prediction value is determined based on IBC prediction.

[0230] S610, set the predicted value of the current sub-block to the second predicted value; wherein the second predicted value is determined based on the IBC prediction.

[0231] S611, Encode the current sub-block based on the predicted value of the current sub-block to obtain the bit stream of the current sub-block.

[0232] S612, write the BV of the current sub-block to the bit stream.

[0233] For example, S607 to S612 can be described with reference to the above description of S403 to S408, and will not be repeated here.

[0234] Figure 7 This is a schematic diagram illustrating the decoding process as an example.

[0235] S701, receive bit stream.

[0236] S702, the BV of the current sub-block is parsed from the bit stream. The intra-prediction mode of the coding unit (CU) to which the current sub-block belongs is the block copy intra-prediction (IBC) mode.

[0237] For example, S701 to S702 can be referred to the description of S301 to S302 above, and will not be repeated here.

[0238] S703, determine whether the BV of the current sub-block is the first preset information.

[0239] For example, if the BV of the current sub-block is the first preset information, then S704 can be executed; if the BV of the current sub-block is not the first preset information, then S706 can be executed.

[0240] S704: Select another intra-frame prediction mode corresponding to the first preset information from R other intra-frame prediction modes.

[0241] S705, based on other intra-frame prediction modes corresponding to the first preset information, perform intra-frame prediction on the current sub-block to obtain the prediction value of the current sub-block.

[0242] For example, when the BV of the current sub-block is the first preset information and the first preset information is the preset value Y1, vertical prediction can be performed on the current sub-block to obtain the predicted value of the current sub-block.

[0243] For example, when the BV of the current sub-block is the first preset information and the first preset information is the preset value Y2, the angle of the current sub-block can be predicted to obtain the predicted value of the current sub-block.

[0244] For example, when the BV of the current sub-block is the first preset information and the first preset information is the preset value Y3, DC prediction can be performed on the current sub-block to obtain the predicted value of the current sub-block.

[0245] S706, perform IBC prediction on the current sub-block based on the second preset information to obtain the predicted value of the current sub-block.

[0246] S707, Reconstruct the current sub-block based on the predicted value of the current sub-block to obtain the reconstructed block of the current sub-block.

[0247] For example, S706 to S707 can be described with reference to the above description of S305 to S306, and will not be repeated here.

[0248] For example, to improve the subjective quality of sub-blocks in the CU that use other intra-prediction modes instead of IBC mode, during the encoding and decoding process of these sub-blocks, the quantization parameter QP_intra is calculated based on the flatness of these sub-blocks; then, quantization or dequantization is performed based on the quantization parameter QP_intra. For sub-blocks in the CU whose prediction mode is IBC mode, quantization or dequantization is performed based on the quantization parameter QP_IBC.

[0249] Figure 8a This is a schematic diagram illustrating an exemplary encoding process. Figure 8a The diagram illustrates the process of encoding a single CU (i.e., CU2) of an image to be encoded. Figure 8a In the embodiments described above, the complexity information is the complexity level.

[0250] Reference Figure 8aFor example, after the encoder performs prediction, quantization, and entropy coding operations on CU2 sequentially, the bitstream of CU2 can be obtained. During the encoding of sub-blocks in CU2 that use other intra-prediction modes instead of IBC mode, the quantization parameter QP_intra for each sub-block is calculated based on the flatness of each sub-block; then, the prediction residual of each sub-block is quantized based on the quantization parameter QP_intra. For sub-blocks in CU2 whose prediction mode is IBC mode, the prediction residual of each sub-block is quantized based on the quantization parameter QP_IBC.

[0251] Figure 8b This is a schematic diagram illustrating the encoding process as an example.

[0252] S801, obtain the current CU and divide the current CU into multiple sub-blocks. The prediction mode of the current CU is IBC mode.

[0253] S802, for the current sub-block, determines whether to use other intra-prediction modes to replace the IBC mode.

[0254] For example, if it is determined that no other intra-prediction mode will be used to replace the IBC mode for the current sub-block, then S803 can be executed; if it is determined that no other intra-prediction mode will be used to replace the IBC mode for the current sub-block, then S807 can be executed.

[0255] S803, set the block vector BV of the current sub-block to the second preset information; wherein, the BV set to the second preset information is used to indicate that the prediction mode of the current sub-block is IBC mode, the second preset information is the vector absolute value offset between the current sub-block and the reference block, and the second prediction value is determined based on IBC prediction.

[0256] S804, set the predicted value of the current sub-block to the second predicted value; wherein the second predicted value is determined based on the IBC prediction.

[0257] S805 determines the quantization parameter QP_IBC corresponding to the current sub-block based on the complexity information of the current CU and the number of encoded bits of the previous CU.

[0258] In one possible approach, the complexity information of the current CU to which the current sub-block belongs can be a complexity level. For example, the complexity level of the current CU can be determined based on the texture complexity level and the IBC complexity level of the current CU; for instance, the minimum value between the texture complexity level and the IBC complexity level of the current CU can be used to determine the complexity level of the current CU.

[0259] For example, the process of calculating the texture complexity level of the current CU can be as follows:

[0260] First, for each sub-block in the current CU, the differences between adjacent pixel values ​​can be calculated step by step in the horizontal, vertical, and diagonal directions to obtain multiple difference values. Then, the absolute values ​​of the multiple differences are summed to obtain the complexity value corresponding to that sub-block.

[0261] Next, the complexity value is compared with multiple complexity thresholds to obtain the complexity level of the sub-block. For example, the multiple complexity thresholds are A1, A2, A3, and A4; the complexity levels are 5, namely K1, K2, K3, K4, and K5. When the complexity value of the sub-block is less than A1, the complexity level of the sub-block can be determined as K1; when the complexity value of the sub-block is greater than A1 and less than A2, the complexity level of the sub-block can be determined as K2; when the complexity value of the sub-block is greater than A2 and less than A3, the complexity level of the sub-block is K3; when the complexity value of the sub-block is greater than A3 and less than A4, the complexity level of the sub-block can be determined as K4; when the complexity value of the sub-block is greater than A4, the complexity level of the sub-block can be determined as K5.

[0262] Next, the complexity levels of each sub-block are calculated using rules to obtain the texture complexity level of the current CU encoding unit. For example, if the current CU includes 10 sub-blocks, and 8 of them have a complexity level of K4, then the complexity level of the current CU can be K4. Or, if the current CU includes 10 sub-blocks, and 5 of them have a complexity level of K4 and 5 have a complexity level of K2, then the complexity level of the current CU can be K3. In other words, the rules used to determine the texture complexity level of the current CU can be set according to requirements, and this application does not impose any restrictions on this.

[0263] For example, the process of calculating the IBC complexity level of the current CU can be as follows: For each sub-block of the current CU, perform similarity IBC prediction on each sub-block to determine the IBC similarity prediction value (also called the similarity sample matrix) of each sub-block. Next, calculate the difference between the IBC similarity prediction value and the original value of each pixel in each sub-block, which can yield multiple difference values; then sum the absolute values ​​of these multiple differences to obtain the absolute error sum of the sub-block; compare the absolute error sum of the sub-block with multiple complexity thresholds to obtain the complexity level of the sub-block; the details can be referred to the above description and will not be repeated here. Afterwards, perform rule-based operations on the complexity levels of each sub-block to obtain the IBC complexity level of the current CU coding unit; the details can be referred to the above description and will not be repeated here.

[0264] The similarity IBC prediction is as follows: when the search area is a pixel outside the current sub-block (also known as a reconstructed sample), if it is a pixel on the upper side (including the pixel on the upper left corner of the current sub-block), the reconstructed value of the pixel on the upper side is used for IBC prediction; if it is a pixel on the left side (excluding the pixel on the upper left corner of the current coding block), the original value of the pixel on the left side is used for IBC prediction.

[0265] S806, based on the quantization parameter QP_IBC corresponding to the current sub-block, quantizes the prediction residual between the prediction values ​​of the current sub-block and the prediction values ​​of the current sub-block.

[0266] S807, set the BV of the current sub-block to the first preset information; wherein, the BV set to the first preset information is used to indicate that the prediction mode of the current sub-block is another intra-frame prediction mode.

[0267] S808, set the prediction value of the current sub-block to the first prediction value; wherein the first prediction value is determined based on other intra-frame predictions.

[0268] S809, determine the flatness of the current sub-block.

[0269] The process of determining the flatness of the current sub-block will be explained later.

[0270] S810 determines the quantization parameter QP_intra corresponding to the current sub-block based on the flatness of the current sub-block.

[0271] For example, S810 may include the following S8101 to S8102:

[0272] S8101 determines the quantization parameter QP_IBC based on the complexity information of the current CU and the number of encoded bits of the previous CU;

[0273] S8102, based on the flatness, complexity information and quantization parameter QP_IBC of the current sub-block, determine the quantization parameter QP_intra corresponding to the current sub-block.

[0274] For example, when the flatness and complexity information of the current sub-block meets the first preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined according to the quantization parameter QP_IBC and the first preset step size; when the flatness and complexity information of the current sub-block meets the second preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined according to the quantization parameter QP_IBC and the second preset step size; when the flatness and complexity information of the current sub-block meets the third preset condition, the quantization parameter QP_IBC is used as the quantization parameter QP_intra corresponding to the current sub-block.

[0275] S8101 to S8102 can be referred to in the following sections. Figure 9b As described in the embodiments.

[0276] S811 quantizes the prediction residual between the predicted values ​​of the current sub-block based on the quantization parameter QP_intra corresponding to the current sub-block.

[0277] S812 performs entropy encoding on the quantized prediction residual to obtain the bit stream of the current sub-block;

[0278] S813, write the BV of the current sub-block to the bit stream.

[0279] Figure 9a This is a schematic diagram illustrating an exemplary decoding process. Figure 9a The diagram illustrates the decoding process for a single CU (i.e., CU2). Figure 9a Medium complexity information refers to the complexity level.

[0280] Reference Figure 9a For example, after the decoder sequentially performs entropy decoding, dequantization, and prediction operations on the bitstream of CU2, it can obtain the reconstructed image of CU2. During the decoding process for sub-blocks in CU2 that use other intra-prediction modes instead of IBC mode, the corresponding quantization parameter QP_intra for each sub-block is calculated based on the flatness of each sub-block; then, based on the quantization parameter QP_intra for each sub-block, the quantized prediction residual of each sub-block obtained through parsing (i.e., entropy decoding) is dequantized. For sub-blocks in CU2 whose prediction mode is IBC mode, the quantized prediction residual of each sub-block obtained through parsing (i.e., entropy decoding) is dequantized based on the quantization parameter QP_IBC.

[0281] Figure 9b This is a schematic diagram illustrating the decoding process as an example.

[0282] S901, receive bit stream.

[0283] S902, the block vector (BV) of the current sub-block is parsed from the bit stream. The prediction mode of the current CU to which the current sub-block belongs is the block copy intra-prediction (IBC) mode.

[0284] S903, determine whether the BV of the current sub-block is the first preset information.

[0285] For example, when it is determined that the BV of the current sub-block is the second preset information, S904 can be executed; when it is determined that the BV of the current sub-block is the first preset information, S908 can be executed.

[0286] S904, perform IBC prediction on the current sub-block based on the second preset information to obtain the predicted value of the current sub-block.

[0287] S905: Based on the complexity information of the current CU and the number of encoded bits of the previous CU, determine the quantization parameter QP_IBC corresponding to the current sub-block.

[0288] S906, based on the quantization parameter QP_IBC corresponding to the current sub-block, performs inverse quantization on the quantized prediction residual obtained from the parsed bit stream to obtain the prediction residual of the current sub-block.

[0289] S907, perform other intra-frame predictions on the current sub-block to obtain the predicted value of the current sub-block.

[0290] For example, S904 to S907 can be referred to the description above, and will not be repeated here.

[0291] S908 determines the flatness of the current sub-block.

[0292] For example, the flatness of the current sub-block can be determined based on the reconstructed blocks adjacent to the current sub-block. For example, the difference between the reconstructed values ​​of adjacent pixels in the reconstructed blocks adjacent to the current sub-block can be calculated to obtain multiple difference values; the flatness of the current sub-block can be obtained by summing these multiple difference values.

[0293] Specifically, suppose the horizontal index of the top-left pixel in the current sub-block is x, and the vertical index is y. Let I represent the reconstruction matrix of the image corresponding to the current coding unit to which the current sub-block belongs (the reconstruction matrix includes the reconstructed values ​​of the reconstructed pixels). If other intra-frame prediction modes are vertical prediction modes, the difference between adjacent pixels in the previous row of the current sub-block can be calculated to obtain multiple difference values. The flatness of the current sub-block can be obtained by summing the absolute values ​​of multiple differences. For example, assuming the current sub-block is a 2x2 sub-block, then = Abs(I[x][y–1]–I[x+1][y–1]).

[0294] If other intra-frame prediction modes are angle prediction mode or DC prediction mode, then calculate the difference between adjacent pixels in some or all reconstructed pixels in the previous row of the current sub-block to obtain multiple difference values; sum the absolute values ​​of multiple difference values ​​to obtain the flatness of the current sub-block. For example, if the current sub-block is a 2x2 sub-block and the prediction mode of the current sub-block is DC prediction mode, then =Abs(I[x][y–1]–I[x+1][y–1])+Abs(I[x+1][y–1]–I[x+2][y–1])+Abs(I[x+2][y–1]–I[x+3][y–1]).

[0295] S909, based on the flatness of the current sub-block, determine the quantization parameter QP_intra corresponding to the current sub-block.

[0296] Next, the quantization parameter QP_intra corresponding to the current sub-block can be determined based on the flatness of the current sub-block.

[0297] One possible approach is to determine the quantization parameter QP_IBC based on the complexity information of the current CU and the number of encoded bits of the previous CU; details can be found in the description above and will not be repeated here. Then, based on the flatness, complexity information, and quantization parameter QP_IBC of the current sub-block, the corresponding quantization parameter QP_intra is determined.

[0298] For example, multiple preset conditions can be set by adjusting the gradient threshold, the complexity threshold, and the bit depth of the image based on the quantization parameters; and for each preset condition, a corresponding method for determining the quantization parameters can be set.

[0299] The preset conditions may include a first preset condition, a second preset condition, and a third preset condition. Correspondingly, the methods for determining the quantization parameters may include a first method for determining the quantization parameters, a second method for determining the quantization parameters, and a third method for determining the quantization parameters.

[0300] For example, the first preset condition is: flatness is less than or equal to (QpRefineTh0 << (bdIdx >> 1)), and the complexity level of the encoding unit is greater than or equal to BwqComplexTh; the first quantization parameter is determined as: QP_intra = Max(QP_IBC – S0, 0). Where QpRefineTh0 is the 0th gradient threshold for quantization parameter adjustment, BwqComplexTh is the complexity threshold for sub-block quantization parameter adjustment, S0 is the adjustment step size corresponding to the 0th gradient threshold (i.e., the first preset step size, e.g., S0 = 2), bdIdx = Clip3(0, S2, BitDepth – S3), and BitDepth is the bit depth of the image. Where S2 represents the maximum bit depth difference, e.g., S2 = 8; it can be set according to requirements, and this application does not impose any restrictions on it. Furthermore, S3 can be preset according to requirements, and this application does not impose any restrictions on it. Where Clip3 is the clamping function.

[0301] For example, the second preset condition is: {flatness is less than or equal to (QpRefineTh1<<(bdIdx>>1))}, and {flatness is greater than (QpRefineTh0<<(bdIdx>>1))}, and / or, the complexity level of the encoding unit is less than BwqComplexTh}; the second quantization parameter is determined as: QP_intra=Max(QP_IBC–S1,0). Where QpRefineTh1 is the first gradient threshold for quantization parameter adjustment, and S1 is the adjustment step size corresponding to the first gradient threshold (i.e., the second preset step size, for example, S1=1). Where QpRefineTh0 is less than QpRefineTh1.

[0302] For example, the third preset condition is: flatness greater than (QpRefineTh1<<(bdIdx>>1)); the third quantization parameter is determined as: QP_intra=QP_IBC.

[0303] Thus, when the flatness and complexity information of the current sub-block meet the first preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined according to the quantization parameter QP_IBC and the first preset step size; for example, the first quantization parameter determination method described above can be referred to.

[0304] When the flatness and complexity information of the current sub-block meet the second preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined according to the quantization parameter QP_IBC and the second preset step size; for example, the second quantization parameter determination method described above can be referred to.

[0305] When the flatness and complexity information of the current sub-block meet the third preset condition, the quantization parameter QP_IBC is used as the quantization parameter QP_intra for the current sub-block. For example, the method for determining the third quantization parameter described above can be referenced.

[0306] S910, based on the quantization parameter QP_intra corresponding to the current sub-block, performs inverse quantization on the quantized prediction residual obtained from the bit stream to obtain the prediction residual of the current sub-block.

[0307] S911, add the predicted value of the current sub-block and the predicted residual of the current sub-block to obtain the reconstructed block of the current sub-block.

[0308] In one example, Figure 10 The schematic block diagram illustrating an embodiment of the present application shows an apparatus 1000. The apparatus 1000 may include a processor 1001 and a transceiver / transceiver pin 1002, and optionally, a memory 1003.

[0309] The various components of device 1000 are coupled together via bus 1004, which includes a data bus, a power bus, a control bus, and a status signal bus. However, for clarity, all buses are referred to as bus 1004 in the figure.

[0310] Optionally, the memory 1003 can be used to store instructions from the foregoing method embodiments. The processor 1001 can be used to execute the instructions in the memory 1003, control the receive pin to receive signals, and control the transmit pin to transmit signals.

[0311] The device 1000 may be an electronic device or a chip of an electronic device in the above method embodiments.

[0312] For example, the electronic device can be a terminal device or a server.

[0313] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0314] This application also provides a chip, including one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits, and when the one or more processors execute computer instructions, the electronic device implements the synchronization method in the above embodiments through the aforementioned related method steps. The interface circuit is a transceiver / transceiver pin 1002.

[0315] This embodiment also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the encoding / decoding method in the above embodiment.

[0316] This embodiment also provides a computer program product containing computer instructions. When the computer instructions are executed by a computer or processor, the computer performs the aforementioned related steps to implement the encoding and decoding method in the above embodiment.

[0317] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory. The memory is used to store computer execution instructions. When the apparatus is running, the processor can execute the computer execution instructions stored in the memory to cause the chip to execute the encoding and decoding methods in the above-described method embodiments.

[0318] In this embodiment, the electronic device, computer-readable storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0319] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0320] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0321] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0322] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0323] Any content in the various embodiments of this application, as well as any content in the same embodiment, can be freely combined. Any combination of the above content is within the scope of this application.

[0324] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0325] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

[0326] The steps of the methods or algorithms described in conjunction with the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium well known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.

[0327] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer-readable storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0328] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A decoding method, characterized in that, The method includes: Receive bit stream; The block vector (BV) of the current sub-block is parsed from the bit stream, and the prediction mode of the coding unit to which the current sub-block belongs is the block copy intra-prediction (IBC) mode. For the current sub-block, determine whether to use other intra-prediction modes to replace the IBC mode based on the BV of the current sub-block; If so, then the other intra-prediction modes are used to perform intra-prediction on the current sub-block to obtain the predicted value of the current sub-block; If not, then IBC prediction is performed on the current sub-block based on the BV of the current sub-block to obtain the predicted value of the current sub-block; The current sub-block is reconstructed based on the predicted value of the current sub-block to obtain the reconstructed block of the current sub-block.

2. The method according to claim 1, characterized in that, The other intra-frame prediction mode is a vertical prediction mode. The step of using the other intra-frame prediction mode to perform intra-frame prediction on the current sub-block to obtain the predicted value of the current sub-block includes: Perform vertical prediction on the current sub-block to obtain the predicted value of the current sub-block.

3. The method according to claim 1, characterized in that, The step of using the other intra-prediction modes to perform intra-prediction on the current sub-block to obtain the predicted value of the current sub-block includes: Select other intra prediction modes that correspond to the BV of the current sub-block from a variety of other intra prediction modes; Based on other intra-prediction modes corresponding to the BV of the current sub-block, intra-prediction is performed on the current sub-block to obtain the predicted value of the current sub-block.

4. The method according to any one of claims 1 to 3, characterized in that, When determining to replace the IBC mode with the other intra-prediction mode for the current sub-block, the method further includes: Determine the flatness of the current sub-block; Based on the flatness of the current sub-block, determine the quantization parameter QP_intra corresponding to the current sub-block; The process of reconstructing the current sub-block based on its predicted value to obtain a reconstructed block includes: Based on the quantization parameter QP_intra corresponding to the current sub-block, the quantized prediction residual obtained from the parsed bit stream is dequantized to obtain the prediction residual of the current sub-block. The predicted value of the current sub-block and the predicted residual of the current sub-block are added together to obtain the reconstructed block of the current sub-block.

5. The method according to claim 4, characterized in that, The step of determining the quantization parameter QP_intra corresponding to the current sub-block based on the flatness of the current sub-block includes: The complexity information of the coding unit and the quantization parameter QP_IBC corresponding to the coding unit are parsed from the bit stream. Based on the flatness of the current sub-block, the complexity information, and the quantization parameter QP_IBC, the quantization parameter QP_intra corresponding to the current sub-block is determined.

6. The method according to claim 5, characterized in that, The step of determining the quantization parameter QP_intra corresponding to the current sub-block based on the flatness of the current sub-block, the complexity information, and the quantization parameter QP_IBC includes: When the flatness and complexity information of the current sub-block meet the first preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined according to the quantization parameter QP_IBC and 2. When the flatness and / or complexity information of the current sub-block meet the second preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined according to the quantization parameter QP_IBC and 1. When the flatness and complexity information of the current sub-block meet the third preset condition, the quantization parameter QP_IBC is used as the quantization parameter QP_intra corresponding to the current sub-block.

7. The method according to claim 4, characterized in that, Determining the flatness of the current sub-block includes: The flatness of the current sub-block is determined based on the reconstructed sub-blocks adjacent to it.

8. The method according to claim 7, characterized in that, Determining the flatness of the current sub-block based on the reconstructed sub-blocks adjacent to the current sub-block includes: Calculate the difference between the reconstructed values ​​of adjacent pixels in the reconstructed blocks adjacent to the current sub-block to obtain multiple difference values; The flatness of the current sub-block is obtained by summing the absolute values ​​of the multiple differences.

9. The method according to claim 2, characterized in that, The step of performing vertical prediction on the current sub-block to obtain the predicted value of the current sub-block includes: For the current pixel in the current sub-block, the reconstructed value of the pixel with the same horizontal coordinate as the current pixel in the row above the current pixel is determined as the predicted value of the current pixel.

10. An encoding method, characterized in that, The method includes: The coding unit is obtained and the coding unit is divided into multiple sub-blocks. The prediction mode of the coding unit is the block copy intra-prediction (IBC) mode. For the current sub-block, determine whether to use another intra-frame prediction mode to replace the IBC mode; If so, the BV of the current sub-block is set to the first preset information, and the prediction value of the current sub-block is set to the first prediction value; wherein, the BV set to the first preset information is used to indicate that the prediction mode of the current sub-block is the other intra-frame prediction mode, and the first prediction value is determined based on the other intra-frame prediction. If not, the block vector BV of the current sub-block is set to the second preset information, and the prediction value of the current sub-block is set to the second prediction value; wherein, the BV set to the second preset information is used to indicate that the prediction mode of the current sub-block is the IBC mode, the second preset information is the vector absolute value offset between the current sub-block and the reference block, and the reference block and the second prediction value are determined based on the IBC prediction; The current sub-block is encoded based on the predicted value of the current sub-block to obtain the bit stream of the current sub-block; Write the BV of the current sub-block into the bit stream of the current sub-block.

11. The method according to claim 10, characterized in that, The step of determining whether to use other intra-frame prediction modes to replace the IBC mode for the current sub-block includes: IBC prediction is performed on the current sub-block to determine the reference block; the sum of absolute errors between the current sub-block and the reference block is calculated to obtain SAD_IBC; Perform other intra-frame predictions on the current sub-block to obtain the first predicted value; calculate the sum of absolute errors between the current sub-block and the first predicted value to obtain SAD_intra; For the current sub-block, based on the SAD_IBC and the SAD_intra, it is determined whether to use the other intra-prediction modes to replace the IBC mode.

12. The method according to claim 11, characterized in that, The step of determining whether to use other intra-prediction modes to replace the IBC mode for the current sub-block, based on the SAD_IBC and SAD_intra, includes: Determine the sum between the SAD_IBC and the preset bias, where the preset bias is the bias for the other intra-frame prediction modes; Determine whether the SAD_intra is less than the sum value; When SAD_intra is less than the sum value, for the current sub-block, it is determined that the other intra-prediction mode will be used instead of the IBC mode.

13. The method according to claim 12, characterized in that, The step of determining whether to use other intra-frame prediction modes to replace the IBC mode for the current sub-block, based on the SAD_IBC and the SAD_intra, further includes: When SAD_intra is less than the sum value, it is determined whether SAD_intra is less than SAD_TH, where SAD_TH is the maximum upper limit value of the sum of absolute errors corresponding to the other intra-frame prediction modes; When SAD_intra is less than SAD_TH, for the current sub-block, it is determined that the other intra-prediction mode will be used instead of the IBC mode.

14. The method according to any one of claims 10 to 13, characterized in that, The other intra-frame prediction mode is the vertical prediction mode, and the first prediction value is determined based on the vertical prediction.

15. The method according to any one of claims 10 to 13, characterized in that, When it is determined that another intra-frame prediction mode should be used instead of the IBC mode, the method further includes: Determine the flatness of the current sub-block; Based on the flatness of the current sub-block, determine the quantization parameter QP_intra corresponding to the current sub-block; Encoding the current sub-block based on the predicted value of the current sub-block to obtain the bitstream of the current sub-block includes: Based on the quantization parameter QP_intra corresponding to the current sub-block, the prediction residual between the prediction values ​​of the current sub-block and the prediction values ​​of the current sub-block is quantized; The quantized prediction residual is entropy encoded to obtain the bit stream of the current sub-block.

16. The method according to claim 15, characterized in that, The step of determining the quantization parameter QP_intra corresponding to the current sub-block based on the flatness of the current sub-block includes: Determine the complexity information of the coding unit and the quantization parameter QP_IBC corresponding to the coding unit; Based on the flatness of the current sub-block, the complexity information, and the quantization parameter QP_IBC, the quantization parameter QP_intra corresponding to the current sub-block is determined.

17. The method according to claim 16, characterized in that, The step of determining the quantization parameter QP_intra corresponding to the current sub-block based on the flatness of the current sub-block, the complexity information, and the quantization parameter QP_IBC includes: When the flatness and complexity information of the current sub-block meet the first preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined according to the quantization parameter QP_IBC and 2. When the flatness and / or complexity information of the current sub-block meet the second preset condition, the quantization parameter QP_intra corresponding to the current sub-block is determined according to the quantization parameter QP_IBC and 1. When the flatness and complexity information of the current sub-block meet the third preset condition, the quantization parameter QP_IBC is used as the quantization parameter QP_intra corresponding to the current sub-block.

18. The method according to claim 15, characterized in that, Determining the flatness of the current sub-block includes: The flatness of the current sub-block is determined based on the reconstructed sub-blocks adjacent to it.

19. The method according to claim 18, characterized in that, Determining the flatness of the current sub-block based on the reconstructed sub-blocks adjacent to the current sub-block includes: Calculate the difference between the reconstructed values ​​of adjacent pixels in the reconstructed blocks adjacent to the current sub-block to obtain multiple difference values; The flatness of the current sub-block is obtained by summing the multiple differences.

20. The method according to any one of claims 10 to 13, characterized in that, The other intra-frame prediction mode is a vertical prediction mode, and the method further includes: If it is determined that the vertical prediction mode will be used instead of the IBC mode, then for the current pixel in the current sub-block, the reconstructed value of the pixel with the same horizontal coordinate as the current pixel in the row above the current pixel is determined as the predicted value of the current pixel.

21. An electronic device, characterized in that, include: A memory and a processor, wherein the memory is coupled to the processor; The memory stores program instructions that, when executed by the processor, cause the electronic device to perform the decoding method as described in any one of claims 1 to 9.

22. An electronic device, characterized in that, include: A memory and a processor, wherein the memory is coupled to the processor; The memory stores program instructions that, when executed by the processor, cause the electronic device to perform the encoding method as described in any one of claims 10 to 20.

23. A chip, characterized in that, It includes one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits, and when the one or more processors execute computer instructions, they cause the processors to perform the method as described in any one of claims 1 to 9.

24. A chip, characterized in that, It includes one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits, and when the one or more processors execute computer instructions, they cause the processors to perform the method as described in any one of claims 10 to 20.

25. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed on a computer or processor, causes the computer or processor to perform the method as described in any one of claims 1 to 20.

26. A computer program product, characterized in that, The computer program product includes computer instructions that, when executed by a computer or processor, cause the steps of the method as described in any one of claims 1 to 20 to be performed.

27. A device for storing bit streams, characterized in that, The device includes: a receiver and at least one storage medium. The receiver is used to receive bit streams; The at least one storage medium is used to store the bit stream; The bitstream is generated according to the encoding method described in any one of claims 10 to 20.

28. A device for transmitting a bit stream, characterized in that, The device includes: a transmitter and at least one storage medium. The at least one storage medium is used to store a bit stream, which is generated according to the encoding method according to any one of claims 10 to 20; The transmitter is used to obtain the bit stream from the storage medium and transmit the bit stream to the end-side device through the transmission medium.

29. A system for distributing bit streams, characterized in that, The system includes: At least one storage medium for storing at least one bit stream, said at least one bit stream being generated according to the encoding method according to any one of claims 10 to 20; A streaming media device is configured to acquire a target bitstream from the at least one storage medium and send the target bitstream to an end-side device, wherein the streaming media device includes a content server or a content distribution server.

Citation Information

Patent Citations

  • Encoding and decoding method and electronic equipment

    CN118646866A