Patents
US 12,812,112 B2#155750913 Most CitedActiveUnited States (USPTO)Utility

Encoding method and apparatus, and decoding method and apparatus

0Forward Citations (#155750913 Global)
0.0/yrCitation Velocity (#155750913 Global)
0.00Citation PageRank (#155750913 Global)
6Prior Art Cited
20Claims (3 Indep. · 17 Dep.)
8Drawings / Sheets

Abstract

A coding device estimates a number of coded bits of an (i+k) th coding unit based on a number of coded bits of an i th coding unit, where k is a positive integer greater than or equal to 2. The coding device further uses image content of the (i+k) th coding unit as an input of the QP decision.

Interactive Citation Constellation Global Citation Ranking

Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 6 · Forward citations: 0.

Claims (20 — 3 Independent, 17 Dependent)

  1. Claim 1Independent Claim

    A method comprising: obtaining consecutive coding units in a bitstream; obtaining a quantization parameter (QP) value of an (i+k) th coding unit in the consecutive coding units based on a first number of coded bits of an i th coding unit in the consecutive coding units and based on image content of the (i+k) th coding unit, wherein i is a positive integer, wherein k is a positive integer greater than or equal to 2, wherein the image content comprises a complexity level of the (i+k) th coding unit, wherein the complexity level is a texture complexity level that is based on differences between adjacent pixel values of the (i+k)th coding unit, and wherein obtaining the QP value comprises: obtaining a first buffer fullness of a bitstream buffer of a decoding device, wherein the first buffer fullness indicates a ratio of a first amount of data that is stored in the bitstream buffer to a storage capacity of the bitstream buffer; and obtaining an expected number of lossless coded bits of the (i+k)th coding unit based on the complexity level and a first record, wherein the first record indicates the expected number of lossless coded bits that correspond to a combination of a set moment and the complexity level, wherein the first record is a two-dimensional array having N locations each corresponding to a record table location associated with a current coding unit moment and K locations each corresponding to the complexity level, wherein the set moment is the record table location of the current coding unit moment, and wherein the expected number of lossless coded bits represents an expected number of coded bits of the (i+k)th coding unit in a case of non-quantization; and decoding the (i+k) th coding unit based on the QP value.

  2. Claim 2Depends on #1

    The method of claim 1, further comprising obtaining the complexity level of the (i+k) th coding unit from the bitstream, wherein the complexity level comprises at least one of a luminance complexity level or a chrominance complexity level.

  3. Claim 3Depends on #1

    The method of claim 1, wherein obtaining the QP value further comprises: obtaining an expected number of block bits of the (i+k) th coding unit based on the first buffer fullness, a number of unencoded original bits of the (i+k) th coding unit, and a bitstream compression rate, wherein the expected number of block bits is of coded bits of the (i+k) th coding unit without consideration of image content of the (i+k) th coding unit; and further obtaining the QP value based on the first buffer fullness, the second expected number of block bits.

  4. Claim 4Depends on #3

    The method of claim 3, wherein obtaining the expected number of block bits comprises: obtaining an adjustment value of the (i+k) th coding unit, wherein the adjustment value is inversely proportional to a fullness difference, and wherein the fullness difference is between the first buffer fullness and a second buffer fullness, and wherein the second buffer fullness is of the bitstream buffer and that is after decoding of the bitstream is ended; determining an initial value of the expected number of block bits based on the bitstream compression rate and a second number of coded bits of the (i+k) th coding unit; and obtaining the expected number of block bits based on the initial value and the adjustment value.

  5. Claim 5Depends on #3

    The method of claim 3, wherein obtaining the QP value comprises: determining a minimum target number of bits and a maximum target number of bits based on the first buffer fullness, the expected number of block bits, and the third expected number of lossless coded bits; clamping the minimum target number of bits, the maximum target number of bits, and a preset number of clamping bits to obtain a target number of bits of the (i+k) th coding unit; and further obtaining the QP value based on the target number of bits and the expected number of lossless coded bits.

  6. Claim 6Depends on #1

    The method of claim 1, wherein obtaining the first buffer fullness comprises: querying a second record based on a decoding moment corresponding to the i th coding unit to obtain a historical data amount of the bitstream buffer, wherein the second record indicates a second amount of data stored in the bitstream buffer at the set moment; and determining the first buffer fullness based on the historical data amount and the storage capacity.

  7. Claim 7Depends on #1

    The method of claim 1, further comprising: obtaining a second number of coded bits based on decoding the (i+k) th coding unit; obtaining a number of lossless coded bits of the (i+k) th coding unit based on the second number of coded bits and the QP value; and updating at least one of the first record or a second record based on the number of lossless coded bits, wherein the first record indicates the expected number of lossless coded bits that are of a coding block and that correspond to a combination of the set moment and the complexity level, wherein the second record indicates an amount of data stored in the bitstream buffer of the decoding device at the set moment, and wherein the set moment is associated with i+k.

  8. Claim 8Depends on #1

    The method of claim 1, further comprising: decoding the bitstream to obtain an image; and displaying the image.

  9. Claim 9Independent Claim

    A decoding apparatus comprising: a memory configured to store instructions; and one or more processors coupled to the memory and configured to execute the instructions to cause the decoding apparatus to: obtain consecutive coding units in a bitstream; obtain a quantization parameter (QP) value of an (i+k) th coding unit in the consecutive coding units based on a number of coded bits of an i th coding unit in the consecutive coding units and based on image content of the (i+k) th coding unit, wherein i is a positive integer, wherein k is a positive integer greater than or equal to 2, wherein the image content comprises a complexity level of the (i+k) th coding unit, wherein the complexity level is a texture complexity level that is based on differences between adjacent pixel values of the (i+k)th coding unit, and wherein obtaining the QP value comprises: obtaining a first buffer fullness of a bitstream buffer of a decoding device, wherein the first buffer fullness indicates a ratio of a first amount of data that is stored in the bitstream buffer to a storage capacity of the bitstream buffer; and obtaining an expected number of lossless coded bits of the (i+k)th coding unit based on the complexity level and a first record, wherein the first record indicates the expected number of lossless coded bits that correspond to a combination of a set moment and the complexity level, wherein the first record is a two-dimensional array having N locations each corresponding to a record table location associated with a current coding unit moment and K locations each corresponding to the complexity level, wherein the set moment is the record table location of the current coding unit moment, and wherein the expected number of lossless coded bits represents an expected number of coded bits of the (i+k)th coding unit in a case of non-quantization; and decode the (i+k) th coding unit based on the QP value.

  10. Claim 10Depends on #9

    The decoding apparatus of claim 9, wherein the complexity level comprises at least one of a luminance complexity level or a chrominance complexity level.

  11. Claim 11Depends on #9

    The decoding apparatus of claim 9, wherein the one or more processors is further configured to execute the instructions to cause the decoding apparatus to: divide the (i+k) th coding unit into sub-blocks; obtain texture complexity levels of the sub-blocks, wherein the texture complexity levels are one of set complexity levels; obtain a first texture complexity level of the (i+k) th coding unit based on the texture complexity levels; and determine the complexity level based on the first texture complexity level.

  12. Claim 12Independent Claim

    A method comprising: obtaining consecutive coding units corresponding to an image; obtaining a quantization parameter (QP) value of an (i+k) th coding unit in the consecutive coding units based on a first number of coded bits of an i th coding unit in the consecutive coding units and image content of the (i+k) th coding unit, wherein i is a positive integer, wherein k is a positive integer greater than or equal to 2, wherein the image content comprises a complexity level of the (i+k) th coding unit, wherein the complexity level is a texture complexity level that is based on differences between adjacent pixel values of the (i+k)th coding unit, and wherein obtaining the QP value comprises: obtaining a first buffer fullness of a bitstream buffer of a decoding device, wherein the first buffer fullness indicates a ratio of a first amount of data that is stored in the bitstream buffer to a storage capacity of the bitstream buffer; and obtaining an expected number of lossless coded bits of the (i+k)th coding unit based on the complexity level and a first record, wherein the first record indicates the expected number of lossless coded bits that correspond to a combination of a set moment and the complexity level, wherein the first record is a two-dimensional array having N locations each corresponding to a record table location associated with a current coding unit moment and K locations each corresponding to the complexity level, wherein the set moment is the record table location of the current coding unit moment, and wherein the expected number of lossless coded bits represents an expected number of coded bits of the (i+k)th coding unit in a case of non-quantization; and encoding the (i+k) th coding unit based on the QP value.

  13. Claim 13Depends on #12

    The method of claim 12, wherein the complexity level comprises at least one of a luminance complexity level or a chrominance complexity level.

  14. Claim 14Depends on #12

    The method of claim 12, further comprising: dividing the (i+k) th coding unit into sub-blocks; obtaining texture complexity levels of the sub-blocks, wherein the texture complexity levels are one of set complexity levels; obtaining a first texture complexity level of the (i+k) th coding unit based on the texture complexity levels; and determining the complexity level based on the first texture complexity level.

  15. Claim 15Depends on #14

    The method of claim 14, wherein determining the complexity level comprises processing the texture complexity levels according to a set rule to determine the complexity level.

  16. Claim 16Depends on #12

    The method of claim 12, wherein obtaining the QP value comprises: obtaining an expected number of block bits of the (i+k) th coding unit based on the first buffer fullness, a number of unencoded original bits of the (i+k) th coding unit, and a bitstream compression rate; and further obtaining the QP value based on the expected number of block bits.

  17. Claim 17Depends on #16

    The method of claim 16, wherein obtaining the expected number of block bits comprises: obtaining an adjustment value of the (i+k) th coding unit, wherein the adjustment value is inversely proportional to a fullness difference, wherein the fullness difference is a difference between the first buffer fullness and a second buffer fullness, wherein the second buffer fullness is of the bitstream buffer and that is after decoding of the bitstream buffer is ended; determining an initial value of the expected number of block bits of the (i+k) th coding unit based on the bitstream compression rate and a second number of coded bits of the (i+k) th coding unit; and obtaining the expected number of block bits based on the initial value and the adjustment value.

  18. Claim 18Depends on #16

    The method of claim 16, wherein obtaining the QP value further comprises: determining a minimum target number of bits and a maximum target number of bits based on the first buffer fullness, the expected number of block bits, and the expected number of lossless coded bits; clamping the minimum target number of bits, the maximum target number of bits, and a preset number of clamping bits to obtain a target number of bits of the (i+k) th coding unit; and obtaining the QP value based on the target number of bits and the expected number of lossless coded bits.

  19. Claim 19Depends on #12

    The method of claim 12, wherein obtaining the first buffer fullness comprises: querying a second record based on a decoding moment corresponding to the i th coding unit to obtain a historical data amount of the bitstream buffer, wherein the second record indicates a second amount of data stored in the bitstream buffer at the set moment; and determining the first buffer fullness based on the historical data amount and the storage capacity.

  20. Claim 20Depends on #12

    The method of claim 12, further comprising: obtaining a second number of coded bits based on encoding the (i+k) th coding unit; obtaining a number of lossless coded bits of the (i+k) th coding unit based on the second number of coded bits and the QP value; and updating at least one of the first record and a second record based on the number of lossless coded bits, wherein the first record indicates an expected number of lossless coded bits that are of a coding block and that correspond to a combination of the set moment and the complexity level, wherein the second record indicates an amount of data stored in the bitstream buffer of an encoding device at the set moment, and wherein the set moment is associated with i+k.

Technical Overview & Description

CROSS-REFERENCE TO RELATED APPLICATIONS This is a continuation of International Patent Application No. PCT/CN2023/103223 filed on Jun. 28, 2023, which claims priority to Chinese Patent Application No. 202211097267.8 filed on Sep. 8, 2022 and Chinese Patent Application No. 202211698666.X filed on Dec. 28, 2022, which are hereby incorporated by reference in their entireties. TECHNICAL FIELD This application relates to the field of video coding, and in particular, to an encoding method and apparatus, and a decoding method and apparatus. BACKGROUND A video is a sequence including a plurality of consecutive frames of images, and one frame corresponds to one image. Because the plurality of consecutive frames is highly similar, to facilitate storage and transmission, coding-based compression is performed on the video. Generally, in a rate control process of video coding, a coding device divides a frame of image into a plurality of coding blocks, and determines a quantization parameter (QP) value of each coding block. Generally, before each coding block is coded, a rate control module needs to determine the QP value of the coding block, and one of inputs of the rate control module is a number of coded bits of a previous coding block. However, because the rate control module can determine the number of coded bits of the previous coding block only after coding of the previous coding block of the coding block ends, coding time of a single coding block is significantly increased, and coding performance is affected. Therefore, how to quickly obtain a QP value of a coding block to improve coding efficiency becomes an urgent problem to be resolved currently. SUMMARY This application provides an encoding method and apparatus, and a decoding method and apparatus, to resolve a problem that efficiency of obtaining a QP value of a coding block is low and coding time corresponding to the coding block is significantly increased in a coding process. According to a first aspect, an embodim

Cited By — Indexed Forward Citations (0 of 0 total)

No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.