Coding and decoding method and device

By considering the number of substream header bits in video encoding, the problem of affecting the accuracy of the rate control module is solved, and the video encoding quality and bit rate are improved.

CN118632001AActive Publication Date: 2024-09-10HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410643699.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-09-08
Filing Date
2022-12-28
Publication Date
2024-09-10
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

During the video encoding process, when the code rate control module only controls based on the number of encoding bits of the encoding unit, the accuracy is affected and the video encoding quality is low.

Method used

By obtaining the substream of the image to be encoded, and encoding according to the number of encoding bits and the estimated number of substream header bits, the accuracy of the code rate control is ensured, and the impact of the substream header bits in the video encoding process is considered.

Benefits of technology

It improves the quality and bit rate of video encoding, avoids the problem of too small quantization parameter values ​​caused by sub-stream header bits not being considered, and improves the image quality in the bit stream.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118632001A
    Figure CN118632001A
Patent Text Reader

Abstract

The invention discloses a coding and decoding method and device, and relates to the technical field of video coding and decoding. The decoding device can decode the coding unit according to the coding bit number corresponding to the coding unit and the estimated bit number indicating the sub-stream header bits corresponding to the plurality of sub-streams, thereby avoiding errors when a code rate control module performs code rate control only according to the coding bit number corresponding to the coding unit. And the accuracy of code rate control is influenced, and the video decoding quality can be improved. Moreover, the decoding equipment considers the bit number occupied by the sub-stream header bits, so that the sub-stream header bits of the part are also considered in the video decoding process, the problem that the QP value is too small due to the fact that the sub-stream header bits of the part are not considered by the code rate control module is avoided, and the decoding efficiency is improved. And the image quality of the video content obtained by analyzing the bit stream by the decoding equipment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office on September 8, 2022, with application number 202211097579.9 and application name “Encoding and Decoding Method”, all contents of which are incorporated by reference in this application.

[0002] This application is a divisional application. The application number of the original application is 202211698950.7, and the original application date is December 28, 2022. The entire contents of the original application are incorporated into this application by reference. Technical Field

[0003] The present application relates to the field of video coding and decoding technology, and in particular to a coding and decoding method and device. Background Art

[0004] Video is an image sequence including multiple continuous frames, one frame corresponds to one image. Since the similarity between multiple continuous frames is extremely high, the video will be encoded and compressed for the convenience of storage and transmission. In the video encoding process, multiple entropy encoders interleave multiple sub-streams corresponding to the coding units corresponding to the image, thereby obtaining the bit stream (or bit stream) corresponding to the coding unit. Among them, the rate control module takes the number of coding bits of the data content corresponding to the coding unit as input, thereby realizing the rate control in video encoding. However, the data packets corresponding to different sub-streams have sub-stream header bits corresponding to their respective sub-streams, resulting in errors when the rate control module performs rate control only according to the number of coding bits corresponding to the coding unit, the accuracy of the rate control is affected, and the quality of video encoding is low. Therefore, how to provide a more effective encoding and decoding method has become a problem that needs to be solved urgently. Summary of the invention

[0005] The present application provides a coding and decoding method and device, which solves the problem that errors occur when the bit rate control module performs bit rate control only according to the number of coding bits corresponding to the coding unit, the accuracy of the bit rate control is affected, and the quality of video coding is low.

[0006] In a first aspect, an embodiment of the present application provides a coding method, which is applied to a video coding system, such as the coding method is executed by a coding device included in the video coding system. The coding method includes: the coding device obtains at least one sub-stream of the coding unit of the image to be encoded, and performs entropy coding on the at least one sub-stream to obtain a first bit number. Furthermore, the coding device encodes the at least one sub-stream according to the first bit number, and outputs the bit stream of the coding unit. Among them, the aforementioned first bit number includes the coding bit number and the estimated bit number, the coding bit number is used to indicate the number of bits occupied by the data body content included in at least one sub-stream, and the estimated bit number is used to indicate the sub-stream header bits of each sub-stream in at least one sub-stream.

[0007] In this embodiment, the encoding device can encode the encoding unit according to the number of encoding bits corresponding to the encoding unit and the estimated number of bits indicating the sub-stream header bits corresponding to multiple sub-streams, thereby avoiding the problem that the rate control module makes an error when performing rate control only according to the number of encoding bits corresponding to the encoding unit, and the accuracy of the rate control is affected, which is conducive to improving the quality of video encoding. Moreover, since the encoding device considers the number of bits occupied by the sub-stream header bits, the sub-stream header bits of this part are also considered in the process of video encoding, avoiding the problem of the quantizer parameter (QP) value being too small due to the fact that the sub-stream header bits of this part are not considered by the rate control module, which is conducive to improving the bit rate of video encoding and improving the image quality corresponding to the video content in the bitstream.

[0008] Exemplarily, the substream slice corresponding to each of the above substreams includes: the substream slice data body and substream index of each substream. The substream slice data body refers to the data body content carried by the substream slice, and the substream index refers to the substream header bit carried by the substream slice. In some optional examples, the above substream slices are also called data packets corresponding to the substream, and the data packets carry the data body content and the substream header bit.

[0009] In an optional implementation, the encoding device performs entropy encoding on at least one substream to obtain a first number of bits, including: the encoding device performs entropy encoding on the at least one substream to obtain a number of coded bits; and, for a substream slice corresponding to each substream in the at least one substream, the encoding device estimates the number of substream header bits of each substream, and determines the estimated number of bits according to at least one substream header bit number corresponding to the at least one substream. Further, the encoding device obtains the first number of bits according to the number of coded bits and the estimated number of bits.

[0010] In this embodiment, the encoding device obtains the encoding bit number and the estimated bit number in the first bit number respectively, wherein the estimated bit number not only indicates the sub-stream header bit corresponding to a sub-stream, but takes into account the sub-stream header bits of all sub-streams corresponding to the encoding unit, thereby further avoiding the problem of too small QP value caused by the fact that this part of the sub-stream header bits are not considered by the bit rate control module, which is beneficial to improving the bit rate of video encoding and improving the image quality corresponding to the video content in the bitstream.

[0011] In an optional implementation, the encoding device estimates the number of substream header bits of each substream, including: the encoding device obtains a first number of substream slices before encoding the first substream according to the number of coded bits of the first historical substream in the historical coding unit; wherein the first substream is a substream corresponding to the first historical substream in at least one substream. And the encoding device updates the number of substream header bits of the first substream according to the first number and the substream index length of the substream slice corresponding to the first substream.

[0012] In this embodiment, the encoding device uses the number of encoded bits of the first historical sub-stream in the historical encoding unit to determine the first number of sub-stream slices before encoding the first sub-stream, thereby updating the number of sub-stream header bits contained in the first sub-stream, which is beneficial to avoiding the problem of incorrect estimation of the number of sub-stream header bits, improves the accuracy of the first bit number, and is beneficial to improving the accuracy of QP decision making based on the first bit number, thereby improving the quality of video encoding using the QP value obtained by the decision.

[0013] In an optional implementation, the encoding device updates the number of substream header bits of the first substream according to the first number and the substream index length of the substream slice corresponding to the first substream, including: the encoding device obtains a second number according to the number of encoded bits of the first substream, and obtains the difference between the second number and the first number. The second number is used to indicate the second number of encoded substream slices corresponding to the first substream, and the second number includes not only the number of substream slices in the first historical substream, but also the number of substream slices corresponding to the first substream in the unit to be encoded. And, the encoding device updates the number of substream header bits of the first substream according to the aforementioned difference and the substream index length of the substream slice corresponding to the first substream.

[0014] For example, the encoding device not only takes into account the sub-stream header bits of the historical sub-streams in the historical encoding unit, but also takes into account the number of sub-stream slices of the first sub-stream in the unit to be encoded before encoding, so that the number of input bits required for the QP value decision (such as the aforementioned first bit number) is more accurate, which is beneficial to improving the quality of video encoding.

[0015] In an optional implementation, the encoding device includes at least one encoding substream buffer, the at least one encoding substream buffer includes a first buffer, and the first buffer is used to temporarily store the substream slices corresponding to the first historical substream and the substream slices corresponding to the first substream. The encoding method provided in the embodiment of the present application also includes: the encoding device updates the number of substream slices stored in the first buffer according to the aforementioned second number.

[0016] In this embodiment, each time the encoding device updates the number of sub-stream header bits, it updates the number of encoded data packets in the encoding sub-stream buffer. Thus, in the process of the encoding device encoding the unencoded sub-stream slices in the encoding sub-stream buffer, the sub-stream header bits corresponding to the sub-stream are updated, thereby improving the accuracy of the first number of bits required for QP decision, which is beneficial to improving the quality of video encoding.

[0017] In an optional example, if the substream slice only includes the above substream slice data body and substream index, the above estimated number of bits can be the sum of the number of substream header bits corresponding to the coding unit. In the case where the substream slice corresponding to the substream includes the data body content corresponding to the substream and the substream header bit, the number of coded bits indicates these data contents, and the estimated number of bits indicates these substream header bits (substream index), thereby avoiding the problem of too small QP value caused by the fact that this part of the substream header bits is not considered by the bit rate control module, which is beneficial to improving the bit rate of video encoding and improving the image quality corresponding to the video content in the bitstream.

[0018] In an optional implementation, the substream slice corresponding to each substream in the aforementioned at least one substream further includes a preset flag bit, and the estimated number of bits is also used to indicate the flag bit. The flag bit here can be used to implement the custom function required by the user, or provide the developer with the encryption function required for video encoding and decoding, or implement other optional functions, etc.

[0019] In this embodiment, the encoding device may also consider other preset flag bits in the estimated number of bits. These flag bits can be used to implement specific functions required by users, and during the video encoding process, these flag bits are also used by the encoding device as input to the bit rate control module, thereby improving the accuracy of QP value decisions and further improving the quality of video encoding.

[0020] In an optional implementation, the encoding device encodes at least one substream according to a first bit number and outputs a bitstream of the encoding unit, including: the encoding device decides the QP value of the encoding unit according to the first bit number, encodes at least one substream according to the QP value, and outputs the bitstream of the encoding unit. In this embodiment, since the first bit number not only includes the number of encoded bits indicating the data content, but also includes the estimated number of bits indicating the substream header bits, when the encoding device makes a QP decision according to the first bit number, the problem of too small QP value caused by the substream header bits not being considered by the bit rate control module is avoided, which is conducive to improving the bit rate of video encoding and improving the image quality corresponding to the video content in the bitstream.

[0021] In an optional implementation, the encoding device outputs the bit stream of the encoding unit, including: the encoding device sends the bit stream corresponding to the aforementioned encoding unit. For example, the encoding device sends the bit stream to a storage device included in the video codec system, or the encoding device sends the bit stream to a decoding device included in the video codec system, etc. Since the encoding device generates the bit stream corresponding to the encoding unit taking into account the sub-stream header bits of multiple sub-streams, the QP value required for encoding also takes into account these sub-stream header bits, thereby avoiding the problem of image quality degradation caused by too small QP value, which is beneficial to improving the quality of video encoding.

[0022] In the second aspect, an embodiment of the present application also provides a decoding method, which is applied to a video coding system, such as the decoding method is executed by a decoding device included in the video coding system. The decoding method includes: the decoding device obtains at least one sub-stream corresponding to the coding unit according to the bit stream, and performs entropy decoding on the at least one sub-stream to obtain a first bit number. Furthermore, the decoding device decodes the at least one sub-stream according to the first bit number, and outputs a reconstructed image of the coding unit. Among them, the first bit number includes the coding bit number and the estimated bit number, the coding bit number is used to indicate the number of bits occupied by the data body content included in the aforementioned at least one sub-stream, and the estimated bit number is used to indicate the sub-stream header bit of each sub-stream in the aforementioned at least one sub-stream.

[0023] In this embodiment, the decoding device can decode the coding unit according to the number of coded bits corresponding to the coding unit and the estimated number of bits indicating the substream header bits corresponding to the multiple substreams, thereby avoiding the problem that the rate control module makes an error when performing rate control only according to the number of coded bits corresponding to the coding unit, and the accuracy of the rate control is affected, which is conducive to improving the quality of video decoding. Moreover, since the decoding device considers the number of bits occupied by the substream header bits, the substream header bits of this part are also considered in the process of video decoding, avoiding the problem of too small QP value caused by the substream header bits of this part not being considered by the rate control module, which is conducive to improving the image quality of the video content obtained by the decoding device parsing the bit stream.

[0024] Exemplarily, the sub-stream slice corresponding to each sub-stream includes: a sub-stream slice data body and a sub-stream index of each sub-stream.

[0025] In an optional implementation, the decoding device entropy decodes at least one substream to obtain a first number of bits, including: the decoding device entropy decodes at least one substream to obtain a coded number of bits. And, for each substream slice corresponding to each substream in the at least one substream, the decoding device estimates the number of substream header bits of each substream, and determines the estimated number of bits according to at least one substream header bit number corresponding to the at least one substream. Then, the decoding device obtains the first number of bits according to the coded number of bits and the estimated number of bits.

[0026] In an optional implementation, the decoding device estimates the number of substream header bits of each substream, including: the decoding device obtains a first number of substream slices before decoding the first substream according to the number of coded bits of the first historical substream in the historical coding unit; and the decoding device updates the number of substream header bits of the first substream according to the first number and the substream index length of the substream slice corresponding to the first substream. The first substream is a substream corresponding to the first historical substream in at least one substream of the coding unit to be encoded.

[0027] In an optional implementation, the decoding device updates the number of substream header bits of the first substream according to the first number and the substream index length of the substream slice corresponding to the first substream, including: the decoding device obtains a second number according to the number of coded bits of the first substream, and obtains the difference between the second number and the first number. The second number is used to indicate the second number of pre-decoding substream slices corresponding to the first substream. Furthermore, the decoding device updates the number of substream header bits of the first substream according to the difference and the substream index length of the substream slice corresponding to the first substream.

[0028] In an optional implementation, the decoding device includes at least one decoding substream buffer, and the at least one decoding substream buffer includes a first buffer, and the first buffer is used to temporarily store the substream slices corresponding to the first historical substream and the substream slices corresponding to the first substream. The decoding method provided in the embodiment of the present application also includes: the decoding device updates the number of substream slices stored in the first buffer according to the second number.

[0029] In a feasible situation, the aforementioned estimated number of bits is the sum of the number of bits of at least one substream header corresponding to at least one substream of the unit to be encoded.

[0030] In an optional implementation, the sub-stream slice corresponding to each sub-stream in the aforementioned at least one sub-stream further includes a preset flag bit, and the estimated number of bits is also used to indicate the flag bit.

[0031] In an optional implementation, a decoding device decodes at least one sub-stream according to a first number of bits and outputs a reconstructed image of a coding unit, including: the decoding device determines a QP value of the coding unit according to the first number of bits, and decodes at least one sub-stream according to the QP value, and outputs a reconstructed image corresponding to the coding unit.

[0032] In an optional implementation, the decoding device outputs the reconstructed image corresponding to the coding unit, including: the decoding device displays the reconstructed image corresponding to the coding unit. The decoding device can display one or more frames of the image, thereby realizing the viewing of the image information carried by the bitstream, which is beneficial to the display of video content, etc.

[0033] In a third aspect, an embodiment of the present application provides a coding device, which includes a module for implementing the coding method provided by any one of the implementation methods in the first aspect. Exemplarily, the coding device includes: an acquisition module, a bit number determination module and a coding module. The acquisition module is used to acquire at least one substream of the coding unit of the image to be encoded. The bit number determination module is used to perform entropy encoding on at least one substream to obtain a first bit number; wherein the first bit number includes the coding bit number and the estimated bit number, the coding bit number is used to indicate the number of bits occupied by the data body content included in at least one substream, and the estimated bit number is used to indicate the substream header bits of each substream in at least one substream. The coding module is used to encode at least one substream according to the first bit number and output the bit stream of the coding unit.

[0034] In an optional implementation, the bit number determination module is specifically used to: entropy encode at least one sub-stream to obtain the number of coded bits; and, for the sub-stream slices corresponding to each sub-stream in the at least one sub-stream, estimate the number of sub-stream header bits of each sub-stream, and determine the estimated number of bits based on at least one sub-stream header bit number corresponding to the at least one sub-stream; and obtain a first number of bits based on the number of coded bits and the estimated number of bits.

[0035] In an optional implementation, the bit number determination module is specifically used to: obtain a first number of sub-stream slices before encoding the first sub-stream according to the number of encoded bits of the first historical sub-stream in the historical coding unit; the first sub-stream is a sub-stream in at least one sub-stream corresponding to the first historical sub-stream; and update the number of sub-stream header bits of the first sub-stream according to the first number and the sub-stream index length of the sub-stream slice corresponding to the first sub-stream.

[0036] In an optional implementation, the bit number determination module is specifically used to: obtain a second number according to the number of coded bits of the first substream, and obtain a difference between the second number and the first number; and update the number of substream header bits of the first substream according to the difference and the substream index length of the substream slice corresponding to the first substream. The second number is used to indicate the second number of coded substream slices corresponding to the first substream.

[0037] In an optional implementation, the encoding device includes at least one encoding sub-stream buffer, and the at least one encoding sub-stream buffer includes a first buffer, and the first buffer is used to temporarily store sub-stream slices corresponding to the first historical sub-stream and sub-stream slices corresponding to the first sub-stream; the encoding device provided by the embodiment of the present application also includes: an update module, which is used to update the number of sub-stream slices stored in the first buffer according to the second number.

[0038] In an optional implementation, the sub-stream slice corresponding to each sub-stream includes: a sub-stream slice data body and a sub-stream index of each sub-stream.

[0039] In an optional implementation, the estimated number of bits is the sum of the number of bits of at least one sub-stream header.

[0040] In an optional implementation, the sub-stream slice corresponding to each sub-stream in the aforementioned at least one sub-stream further includes a preset flag bit, and the estimated number of bits is also used to indicate the flag bit.

[0041] In an optional implementation, the encoding module is specifically configured to determine a QP value of the encoding unit according to the first bit number; and encode at least one substream according to the QP value, and output a bitstream of the encoding unit.

[0042] In an optional implementation, the encoding module is specifically configured to send a bit stream of the encoding unit.

[0043] In a fourth aspect, an embodiment of the present application provides a decoding device, which includes a unit for implementing a decoding method provided by any one of the implementation methods in the second aspect. Exemplarily, the decoding device includes: an acquisition unit, a bit number determination unit, and a decoding unit. The acquisition unit is used to acquire at least one sub-stream corresponding to the coding unit according to the bit stream. The bit number determination unit is used to perform entropy decoding on at least one sub-stream to obtain a first bit number. The first bit number includes the number of coded bits and the estimated number of bits, the coded bit number is used to indicate the number of bits occupied by the data body content included in at least one sub-stream, and the estimated number of bits is used to indicate the sub-stream header bits of each sub-stream in at least one sub-stream. The decoding unit is used to decode at least one sub-stream according to the first bit number and output a reconstructed image of the coding unit.

[0044] In an optional implementation, the bit number determination unit is specifically configured to: entropy decode at least one substream to obtain the number of coded bits; for a substream slice corresponding to each substream in the at least one substream, estimate the number of substream header bits of each substream, and determine the estimated number of bits according to at least one substream header bit number corresponding to the at least one substream. And, the bit number determination unit is further specifically configured to: obtain a first number of bits according to the number of coded bits and the estimated number of bits.

[0045] In an optional implementation, the bit number determination unit is specifically used to: obtain a first number of substream slices before decoding the first substream according to the number of coded bits of the first historical substream in the historical coding unit; and update the number of substream header bits of the first substream according to the first number and the substream index length of the substream slice corresponding to the first substream. The first substream is a substream corresponding to the first historical substream in at least one substream.

[0046] In an optional implementation, the bit number determination unit is specifically used to: obtain a second number according to the number of coded bits of the first substream, and obtain the difference between the second number and the first number. The second number is used to indicate the second number of pre-decoding substream slices corresponding to the first substream. And the bit number determination unit is also specifically used to update the number of substream header bits of the first substream according to the aforementioned difference and the substream index length of the substream slice corresponding to the first substream.

[0047] In an optional implementation, the decoding device includes at least one decoding substream buffer, the at least one decoding substream buffer includes a first buffer, and the first buffer is used to temporarily store the substream slices corresponding to the first historical substream and the substream slices corresponding to the first substream. The decoding device provided in the embodiment of the present application also includes: an updating unit, which is used to update the number of substream slices stored in the first buffer according to the second number.

[0048] In an optional implementation, the sub-stream slice corresponding to each sub-stream includes: a sub-stream slice data body and a sub-stream index of each sub-stream.

[0049] In an optional implementation, the estimated number of bits is the sum of the number of bits of at least one sub-stream header.

[0050] In an optional implementation, the sub-stream slice corresponding to each sub-stream in the aforementioned at least one sub-stream further includes a preset flag bit, and the estimated number of bits is also used to indicate the flag bit.

[0051] In an optional implementation manner, the coding unit is specifically configured to: determine a QP value of the coding unit according to the first number of bits, decode at least one substream according to the QP value, and output a reconstructed image corresponding to the coding unit.

[0052] In an optional implementation manner, the decoding device may include a display unit, where the display unit is used to display the reconstructed image corresponding to the encoding unit.

[0053] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor and an interface circuit. The interface circuit is used to receive a signal from a device other than the electronic device and transmit it to the processor, or to send a signal from the processor to a device other than the electronic device. The processor is used to implement the method described in any one of the implementations of the first aspect, or to implement the method described in any one of the implementations of the second aspect, through a logic circuit or by executing code instructions.

[0054] Exemplarily, the electronic device refers to an encoding device or a decoding device, etc.

[0055] In the sixth aspect, an embodiment of the present application provides a coding and decoding system, including a coding device and a decoding device, the coding device is communicatively connected to the decoding device, the decoding device is used to implement the method described in any one of the implementation methods in the second aspect, and the coding device is used to implement the method described in any one of the implementation methods in the first aspect.

[0056] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by an electronic device, it is used to implement the method described in any one of the implementation methods in the first aspect, or to implement the method described in any one of the implementation methods in the second aspect.

[0057] In an eighth aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the computer program product runs on an encoding device or a decoding device, the encoding device or the decoding device executes the instructions to implement the operating steps of the method described in any one of the above aspects or any possible implementation method of any aspect.

[0058] The beneficial effects of the second to eighth aspects above can refer to the content of any implementation of the first aspect, and will not be repeated here. Based on the implementations provided by the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 A schematic diagram of a video transmission system provided in an embodiment of the present application;

[0060] Figure 2 A schematic diagram of a video encoding and decoding system provided in an embodiment of the present application;

[0061] Figure 3 A schematic diagram of a coding method provided in an embodiment of the present application Figure 1 ;

[0062] Figure 4 A schematic diagram of a coding method provided in an embodiment of the present application Figure 2 ;

[0063] Figure 5 A schematic diagram of a coding method provided in an embodiment of the present application Figure 3 ;

[0064] Figure 6 A schematic diagram of a coding method provided in an embodiment of the present application Figure 4 ;

[0065] Figure 7 Schematic diagram of two counters provided in embodiments of the present application;

[0066] Figure 8 A flowchart of an image decoding method provided in an embodiment of the present application;

[0067] Fig. 9 A schematic diagram of the structure of an encoding device provided in an embodiment of the present application;

[0068] Fig.10 A schematic diagram of the structure of a decoding device provided in an embodiment of the present application;

[0069] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0070] The embodiment of the present application provides a coding method, and the coding device can encode the coding unit according to the number of coding bits corresponding to the coding unit and the estimated number of bits indicating the sub-stream header bits corresponding to multiple sub-streams, thereby avoiding the problem that the rate control module makes an error when performing rate control only according to the number of coding bits corresponding to the coding unit, and the accuracy of the rate control is affected, which is conducive to improving the quality of video coding. Moreover, because the coding device considers the number of bits occupied by the sub-stream header bits, the sub-stream header bits of this part are also considered in the process of video coding, avoiding the problem of the quantizer parameter (QP) value being too small caused by the sub-stream header bits not being considered by the rate control module, which is conducive to improving the bit rate of video coding and improving the image quality corresponding to the video content in the bitstream.

[0071] Correspondingly, an embodiment of the present application also provides a decoding method, and a decoding device can decode the bit stream output by the above encoding device, so as to achieve similar beneficial effects as the encoding side. For example, the decoding device takes into account the number of bits occupied by the sub-stream header bits, so that this part of the sub-stream header bits are also taken into account in the video decoding process, thereby avoiding the problem of too small QP value caused by the part of the sub-stream header bits not being considered by the bit rate control module, which is beneficial to improving the image quality of the video content obtained by the decoding device in parsing the bit stream.

[0072] In order to make the description of the following embodiments clear and concise, an introduction to the related art is first given.

[0073] Interface compression: Media devices use display interfaces when transmitting images and videos. They compress and decompress image and video data passing through the display interfaces, which is referred to as interface compression.

[0074] Bitstream: A binary stream generated by encoding image or video content. In some cases, bitstream is also called bit stream.

[0075] Syntax element: The data obtained after typical coding operations such as prediction and transformation are performed on image blocks. Syntax elements are the main input content of the entropy coding module.

[0076] Entropy encoder: An encoder module that converts input syntax elements into a bitstream.

[0077] Substream: A component of a bitstream. The bitstream parts output by the same entropy encoder are defined as the same substream.

[0078] Substream segment: The basic unit of substream interleaving, a segment of data with a fixed length of N bits. The substream segment includes: the substream segment data body (substream_segment_data) and the substream index (substream_index). Among them, the substream segment data body refers to the data body content carried by the substream segment, and the substream index refers to the substream header bits carried by the substream segment. In some optional examples, the above substream segment is also called the data packet corresponding to the substream, which carries the data body content and the substream header bits.

[0079] For example, the sub-stream slice length is related to the bit depth and the image format, and includes a 2-bit sub-stream index value (used to indicate the sub-stream to which the current sub-stream slice belongs) and a 512-bit sub-stream slice data body.

[0080] Substream interleaving: The operation of combining multiple substreams into a bitstream is also called multiplexing. In some cases, interleaving multiple substreams is also called combining these multiple substreams.

[0081] Substream deinterleaving: The operation of separating different substreams from a bitstream is also called demultiplexing. In some cases, deinterleaving multiple substreams is also called substream reassembly of these multiple substreams.

[0082] Coding substream buffer: a first in first out (FIFO) buffer. Each substream has a corresponding coding substream buffer. The coding substream buffer stores the data of the corresponding substream generated after entropy coding (such as the substream slice data body except the substream index in the substream slice).

[0083] Decoding sub-stream buffer: A FIFO buffer. Each sub-stream has a corresponding decoding sub-stream buffer, which stores the data of each sub-stream after the bit stream is deinterleaved.

[0084] Substream header bit: The substream slice is used to indicate the bit length occupied by the header information of the substream to which it belongs.

[0085] Figure 1A schematic diagram of a video transmission system provided in an embodiment of the present application, wherein the video processing process includes video acquisition, video encoding, video transmission, video decoding and display process, and the video transmission system includes multiple terminal devices (such as Figure 1 The terminal devices 111 to 115 are shown and a network, wherein the network can realize the function of video transmission, and the network may include one or more network devices, which may be routers or switches, etc.

[0086] Figure 1 The terminal device shown may be, but is not limited to, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device may be a mobile phone (such as Figure 1 ), a tablet computer, a computer with wireless transceiver function (such as the terminal device 114 shown in Figure 1 ), a virtual reality (VR) terminal device (such as a terminal device 115 shown in Figure 1 The terminal device 113 shown in the figure), augmented reality (AR) terminal device, wireless terminal in industrial control, wireless terminal in self driving, wireless terminal in smart city, wireless terminal in smart home, etc.

[0087] like Figure 1 As shown, in different video processing processes, the terminal devices are different. For example, in the video acquisition process, the terminal device 111 can be a camera device (such as a video camera, a camera, etc.) for road monitoring, a mobile phone, a tablet computer or a smart wearable device with a video acquisition function, etc. For another example, in the video encoding process, the terminal device 112 can be a server or a data center, and the data center can include one or more physical devices with encoding functions, such as a server, a mobile phone, a tablet computer or other encoding devices. For another example, in the video decoding and display process, the terminal device 113 can be a VR glasses, and the user can control the viewing angle range by turning; the terminal device 114 can be a mobile phone, and the user can control the viewing angle range on the mobile phone 114 by touch operation or air operation, etc.; the terminal device 115 can be a personal computer, and the user can control the viewing angle range displayed on the display screen by input devices such as a mouse or keyboard.

[0088] It is understandable that video is a general term, and video includes a sequence of multiple consecutive frames, and one frame corresponds to one image. For example, panoramic video can refer to 360° video or 180° video; in some possible situations, panoramic video can also refer to a "large" range video that exceeds the viewing angle range of the human eye (110°~120°), such as 270° video.

[0089] Figure 1 This is just a schematic diagram. The video transmission system may also include other devices. Figure 1 The embodiment of the present application does not limit the number and type of terminal devices included in the system.

[0090] exist Figure 1 The video transmission system shown is based on Figure 2 A schematic diagram of a video coding and decoding system provided in an embodiment of the present application is shown. The video coding and decoding system 200 includes an encoding device 210 and a decoding device 220 . The encoding device 210 establishes a communication connection with the decoding device 220 via a communication channel 230 .

[0091] The above-mentioned encoding device 210 can realize the function of video encoding, such as Figure 1 As shown, the encoding device 210 may be the terminal device 112, and the encoding device 210 may also be a data center with video encoding capabilities, for example, the data center includes multiple servers.

[0092] The encoding device 210 may include a data source 211 , a pre-processing module 212 , an encoder 213 , and a communication interface 214 .

[0093] The data source 211 may include or may be any type of electronic device for capturing video, and / or any type of source video generating device, such as a computer graphics processor for generating computer animation scenes or any type of device for acquiring and / or providing source video, or computer-generated source video. The data source 211 may be any type of memory or storage for storing the above-mentioned source video. The above-mentioned source video may include multiple video streams or images captured by multiple video capture devices (such as cameras).

[0094] The preprocessing module 212 is used to receive the source video and preprocess the source video to obtain a panoramic video or a multi-frame image. For example, the preprocessing performed by the preprocessing module 212 may include color format conversion (e.g., from RGB to YCbCr), octree structuring, video splicing, etc.

[0095] The encoder 213 is used to receive a video or an image, and encode the image or the image to obtain encoded data. For example, the encoder 213 encodes the video to obtain a basic layer code stream and an enhanced layer code stream, etc. In some optional situations, the encoded code stream may also be called a bit stream or a bit stream, etc.

[0096] The communication interface 214 in the encoding device 210 can be used to receive encoded data and send the encoded data (or any other processed version of the encoded data) to another device such as the decoding device 220 or any other device through the communication channel 230 for storage, display or direct reconstruction.

[0097] Optionally, the encoding device 210 includes a bitstream buffer, which is used to store bitstreams corresponding to one or more encoding units.

[0098] The above-mentioned decoding device 220 can realize the functions of image decoding or video decoding, such as Figure 1 As shown, the decoding device 220 may be Figure 1 Any one of the terminal devices 113 to 115 is shown.

[0099] The decoding device 220 may include a display device 221 , a post-processing module 222 , a decoder 223 , and a communication interface 224 .

[0100] The communication interface 224 in the decoding device 220 is used to receive the encoded data (or a version of the encoded data after any other processing is performed on the encoded data) from the encoding device 210 or from any other encoding device such as a storage device.

[0101] Communication interface 214 and communication interface 224 can be used to send or receive encoded data through a direct communication link between encoding device 210 and decoding device 220, such as a direct wired or wireless connection, or through any type of network, such as a wired network, a wireless network or any combination thereof, any type of private network and public network or any type of combination thereof.

[0102] The communication interface 224 corresponds to the communication interface 214, for example, and can be used to receive transmission data and process the transmission data using any type of corresponding transmission decoding or processing and / or decapsulation to obtain encoded data.

[0103] The communication interface 224 and the communication interface 214 can be configured as follows: Figure 2 A unidirectional communication interface, or a bidirectional communication interface, indicated by an arrow pointing from the encoding device 210 to the corresponding communication channel 230 of the decoding device 220, and can be used to send and receive messages, etc. to establish a connection, confirm and exchange any other information related to the communication link, or data transmission such as encoded compressed data transmission, etc.

[0104] The decoder 223 is used to receive encoded data and decode the encoded data to obtain decoded data (image or video, etc.).

[0105] The post-processing module 222 is used to post-process the decoded data after decoding to obtain post-processed data (such as an image to be displayed, a reconstructed image, or a decoded image). The post-processing performed by the post-processing module 222 may include, for example, color format conversion (such as conversion from YCbCr to RGB), octree reconstruction, video splitting and fusion, etc., or any other processing for generating data for display by the display device 221, etc.

[0106] The display device 221 is used to receive the post-processing data for display to a user or viewer, etc. The display device 221 can be or include any type of display for displaying the reconstructed image, such as an integrated or external display screen or display. For example, the display screen can include a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a plasma display, a projector, a micro LED display, a liquid crystal on silicon (LCoS), a digital light processor (DLP), or any other type of display screen.

[0107] As an optional implementation, the encoding device 210 and the decoding device 220 may transmit the encoded data via a data forwarding device, such as a router or a switch.

[0108] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0109] Here, the image encoding method according to the embodiment of the present application is as follows: Figure 2 The encoding device 210 shown is used as an example for explanation. Figure 3 A schematic diagram of a coding method provided in an embodiment of the present application Figure 1 The image encoding method includes the following steps S310 to S330.

[0110] S310. The encoding device obtains at least one substream of a coding unit of a to-be-encoded image.

[0111] like Figure 3 As shown, the image to be encoded may include one or more encoding units.

[0112] In a first possible example, the image to be encoded includes a coding unit, and the coding unit includes all image regions of the image to be encoded.

[0113] In a second possible example, the image to be encoded includes multiple encoding units, and one encoding unit corresponds to an image sub-region of the image to be encoded (eg, Figure 3 The black square in the figure).

[0114] It is worth noting that a coding unit can correspond to one or more sub-streams.

[0115] In a possible scenario, one coding unit corresponds to one substream. For example, the coding unit has only a substream corresponding to a luminance component, such as a substream in a YUV400 format.

[0116] In another possible scenario, one coding unit corresponds to multiple substreams, such as three substreams: substream 1, substream 2, and substream 3. In some optional implementations, substream 1 is also called the first substream, substream 2 is also called the second substream, and substream 3 is also called the third substream. In this embodiment, substream 1 is represented by Substream[0], substream 2 is represented by Substream[1], and substream 3 is represented by Substream[2].

[0117] For example, substream 1 is used to indicate the luminance component corresponding to the coding unit, and substream 2 and substream 3 are used to indicate the chrominance component corresponding to the coding unit. It is worth noting that the above examples and possible situations are only examples provided in this embodiment and should not be understood as limitations on the present application. For example, in some optional implementations, substream 2 is used to indicate the luminance component of the coding unit, and substream 1 and substream 3 are used to indicate the chrominance component of the coding unit, which is not limited in the present application.

[0118] In this embodiment, a substream slice corresponding to a substream is sent to a coding substream buffer. For example, the substream slice corresponding to substream 1 is stored in coding substream buffer 1, the substream slice corresponding to substream 2 is stored in coding substream buffer 2, and the substream slice corresponding to substream 3 is stored in coding substream buffer 3.

[0119] S320: The encoding device performs entropy encoding on at least one substream to obtain a first number of bits.

[0120] The first number of bits includes the number of coded bits and the number of estimated bits. In some optional implementations, the first number of bits is also referred to as the total number of bits required for the rate control process of the coding unit.

[0121] The number of coded bits here is used to indicate the number of bits occupied by the data body content included in at least one substream. Exemplarily, since the substream slice corresponding to the substream includes: a substream slice data body and a substream index. The content of the substream slice data body and the substream index can be referred to the introduction of the aforementioned related technology, which will not be repeated here. For example, the number of coded bits of the above at least one substream may include: the number of bits occupied by the substream slice data body included in the substream slices corresponding to all substreams corresponding to the coding unit in S310.

[0122] The aforementioned estimated number of bits is used to indicate the substream header bits of each substream in at least one substream. For example, the above estimated number of bits includes the number of substream header bits occupied by the substream indexes included in the substream slices corresponding to all substreams corresponding to the coding units in S310. In some possible situations, the estimated number of bits is the sum of the aforementioned at least one substream header bit number.

[0123] In the case where the substream slice corresponding to the substream includes the data body content and substream header bits corresponding to the substream, the number of coded bits indicates these data contents, and the estimated number of bits indicates these substream header bits (substream index), thereby avoiding the problem of too small QP value caused by the substream header bits not being considered by the bit rate control module, which is beneficial to improving the bit rate of video encoding and improving the image quality corresponding to the video content in the bitstream. For possible implementation methods of the encoding device obtaining the first bit number, please refer to the following Figure 5 The relevant content will not be elaborated here.

[0124] In an optional implementation, the substream slice corresponding to each substream in the at least one substream further includes a preset flag bit, and the estimated number of bits is also used to indicate the flag bit. The flag bit here can be used to implement a custom function required by a user, or provide developers with encryption required for video encoding and decoding, or implement other optional functions, etc.

[0125] That is to say, the encoding device can also consider other preset flag bits in the estimated number of bits. These flag bits can be used to implement specific functions required by users, and during the video encoding process, these flag bits are also used by the encoding device as input to the bit rate control module, thereby improving the accuracy of QP value decisions and further improving the quality of video encoding.

[0126] S330: The encoding device encodes at least one substream corresponding to the encoding unit according to the first number of bits, and outputs a bit stream of the encoding unit.

[0127] Optionally, the bit stream of the coding unit is also referred to as: a bit stream, a code stream or a data stream corresponding to the coding unit, etc. This application does not limit the name of the bit stream.

[0128] Exemplarily, the encoding device (the substream interleaving module therein) may interleave at least one of the encoded substreams and output a bitstream. The encoding here includes but is not limited to: encoding operations such as entropy encoding, prediction and quantization.

[0129] In an optional implementation, the encoding device encodes at least one substream according to the first bit number and outputs the bitstream of the encoding unit, which may include the following content: the encoding device determines the QP value of the encoding unit according to the first bit number, encodes at least one substream according to the QP value, and outputs the bitstream of the encoding unit. Exemplarily, the QP value here is determined by a rate control module included in the encoding device.

[0130] With respect to the specific implementation of S330 above, this embodiment provides a possible example, such as Figure 4 As shown, Figure 4 A schematic diagram of a coding method provided in an embodiment of the present application Figure 2 , the above S330 may include the following steps S331 to S333.

[0131] S331. The encoding device determines a QP value of a coding unit according to a first number of bits.

[0132] The QP value of the coding unit here is the QP value for all substreams included in the coding unit, but in some possible situations, the QP values ​​for multiple substreams corresponding to the coding unit may be slightly different.

[0133] S332: The encoding device obtains a QP value of each substream according to the QP value of the encoding unit.

[0134] Exemplarily, the encoding device obtains two QP values ​​based on the QP value of the coding unit: QP1 and QP2, where QP1 is the QP value to be adopted by substream 1 for the luminance component of the coding unit, and QP is the QP value to be adopted by substream 2 and substream 3 for the chrominance component of the coding unit.

[0135] In some optional situations, such as when the coding unit corresponds to sub-stream 1 having only a luminance component, the coding device may directly apply the QP value of the coding unit to the sub-stream 1, and use the QP value to quantize and predict sub-stream 1, thereby encoding the coding unit.

[0136] S333: The encoding device encodes all substreams corresponding to the coding unit based on the QP value of each substream, and outputs a bit stream of the coding unit.

[0137] In this embodiment, since the first bit number includes not only the number of coded bits indicating the data content, but also the estimated number of bits indicating the sub-stream header bits, when the encoding device makes a QP decision based on the first bit number, the problem of too small QP value caused by the fact that some sub-stream header bits are not considered by the bit rate control module is avoided, which is beneficial to improving the bit rate of video encoding and improving the image quality corresponding to the video content in the bitstream.

[0138] For example, the encoding device outputting the bit stream of the encoding unit may include: the encoding device sending the bit stream to a storage device included in the video encoding and decoding system, such as the storage device is Figure 1 The storage included in the network during the video transmission process or the database provided with storage function by the data center (DC). Alternatively, the encoding device outputting the bit stream of the encoding unit may include: the encoding device sending the bit stream to the decoding device included in the video encoding and decoding system. If the decoding device refers to Figure 1 Any of the terminal devices 113 to 115 shown, or the decoding device refers to Figure 2 The decoding device 220 shown, etc.

[0139] Since the encoding device generates the bit stream corresponding to the encoding unit taking into account the sub-stream header bits of multiple sub-streams, the QP value required for encoding also takes into account this part of the sub-stream header bits, thereby avoiding the problem of image quality degradation caused by too small QP value, which is beneficial to improving the quality of video encoding.

[0140] In this embodiment, the encoding device can encode the encoding unit according to the number of encoding bits corresponding to the encoding unit and the estimated number of bits indicating the sub-stream header bits corresponding to multiple sub-streams, thereby avoiding the problem that errors occur when the bit rate control module performs bit rate control only according to the number of encoding bits corresponding to the encoding unit, which affects the accuracy of bit rate control, and is beneficial to improving the quality of video encoding.

[0141] With respect to the specific implementation manner in which the encoding device obtains the first number of bits, this embodiment provides a possible example, such as Figure 5 As shown, Figure 5 A schematic diagram of a coding method provided in an embodiment of the present application Figure 3 , the encoding device may obtain the first number of bits required by the encoding unit for encoding, including the following steps S510 to S540.

[0142] S510: The encoding device performs entropy encoding on at least one substream corresponding to the encoding unit to obtain a number of encoding bits.

[0143] For example, the number of coded bits refers to the number of bits that the coding device actually codes for the coding unit. For more information about the number of coded bits, please refer to the above description of S320, which will not be described in detail here.

[0144] S520: The encoding device estimates the number of substream header bits of each substream in the at least one substream for the substream slice corresponding to each substream.

[0145] With respect to the process in which the encoding device estimates the number of substream header bits of each substream, this embodiment provides a possible implementation method, such as Figure 6 As shown, Figure 6 A schematic diagram of a coding method provided in an embodiment of the present application Figure 4 , the above S520 may include the following steps S521 to S524.

[0146] S521. The encoding device obtains a first number of sub-stream slices before encoding the first sub-stream according to the number of encoded bits of the first historical sub-stream in the historical encoding unit.

[0147] The first substream is a substream corresponding to the first historical substream in at least one substream corresponding to the unit to be coded. Here, "corresponding" may mean that the substream slices corresponding to the first substream and the first historical substream are stored in a coded substream buffer (such as Figure 3 As shown, the substream slice corresponding to substream 1 is stored in the coded substream buffer 1), or the first substream and the first historical substream correspond to the same entropy encoder, etc.

[0148] The historical coding unit here refers to the coding unit corresponding to other sub-streams that are encoded by the encoding device using the entropy encoder corresponding to the first sub-stream before S310.

[0149] In a possible example, the historical coding unit and the coding unit in S310 may be different coding units for different image sub-regions of the same frame image.

[0150] In another possible example, the historical coding unit and the coding unit in S310 may also refer to different image sub-regions corresponding to the same partial object in multiple frames of images, and the images to which the different image sub-regions belong are the same or different.

[0151] For example, two counters may be deployed in the encoding device: a substream slice counter and a substream valid data length counter. Figure 7 As shown, Figure 7A schematic diagram of two counters provided for an embodiment of the present application, wherein the substream slice counter records the number of processed substream slices (SubstreamSegmentNum) corresponding to each substream, where SubstreamSegmentNum is an array of length K, K represents the number of substreams, and SubstreamSegmentNum[i] represents the number of substream slices currently processed for the i-th substream.

[0152] like Figure 7 As shown, the substream effective data length counter records the total number of actual bits (SubstreamBits) that have been encoded corresponding to each substream. SubstreamBits is an array of length K, where K represents the number of substreams. SubstreamBits[i] represents the total number of actual bits that have been encoded (or decoded) for the i-th substream.

[0153] Before the encoding device encodes (or decodes) an image or a slice (or a corresponding bitstream), the encoding device initializes the values ​​of each SubstreamSegmentNum[i] and SubstreamBits[i] to 0.

[0154] For the content in S521, the encoding device refreshes the value corresponding to SubstreamBits[0] according to the number of encoded bits of the first historical substream in the historical encoding unit, and records SubstreamBits[0] as the first number, that is: the encoding device confirms that the number of substream slices before encoding the substream 1 corresponding to the encoding unit is SubstreamBits[0], or: the encoding device records bitsRecordSubstream[0] = SubstreamBits[0].

[0155] Correspondingly, the encoding device also initializes the estimated number of bits, such as recording the total number of header bits value headerBits 初始 =0.

[0156] S522: The encoding device obtains a second number according to the number of encoded bits of substream 1.

[0157] The second number is used to indicate the second number of encoded sub-stream slices corresponding to sub-stream 1.

[0158] For example, the second number recorded by the encoding device is the number of temporary substream slices (tmpSubstreamSegmentNum): tmpSubstreamSegmentNum = (SubstreamBits[ssIdx] + MN-1) / (MN), where SubstreamBits[ssIdx] is the number of substream slices corresponding to substream 1, M is the length of a single substream slice, and N is the length of the header bits in a single substream slice. Figure 5 The format of the substream slice 1 shown in , the substream slice 1 includes a data body and N bits of substream header information (referred to as: header information), wherein the total bits of the data body and the substream header information are M. In some optional implementations, N bits are also referred to as the substream index length of the substream slice.

[0159] It is worth noting that the first number above is only used to indicate the number of sub-stream slices corresponding to the historical sub-stream, and the second number includes not only the number of sub-stream slices corresponding to the history, but also the number of sub-stream slices corresponding to the unit to be encoded (or: the current encoding unit).

[0160] S523: The encoding device obtains a difference between the second number and the first number.

[0161] If the encoding record records the difference, it is: AddNum = SubstreamSegmentNum [ssIdx] - tmpSubstreamSegmentNum, where SubstreamSegmentNum [ssIdx] is the number of substream slices before the substream slice corresponding to the encoded substream 1 (the first number), and tmpSubstreamSegmentNum is the number of substream slices after the substream slice corresponding to the encoded substream 1 (the second number).

[0162] The physical meaning represented by the difference is the number of sub-stream slices corresponding to sub-stream 1.

[0163] S524: The encoding device updates the number of substream header bits of substream 1 according to the difference recorded in S523 and the substream index length of the substream slice corresponding to substream 1.

[0164] For example, the encoding device records the number of substream header bits headerBits=headerBits before +AddNum*N, headerBits before is the number of substream header bits before the substream slice corresponding to coded substream 1. If the coding device has not coded other historical substreams before the substream slice corresponding to coded substream 1, headerBits before =headerBits 初始= 0; if the encoding device has encoded other historical substreams before encoding the substream slice corresponding to substream 1, headerBits before It is the sum of the number of sub-stream header bits of the coded sub-stream slices.

[0165] In this embodiment, the encoding device uses the number of encoded bits of the first historical sub-stream in the historical encoding unit to determine the first number of sub-stream slices before encoding the first sub-stream, thereby updating the number of sub-stream header bits contained in the first sub-stream, which is beneficial to avoiding the problem of incorrect estimation of the number of sub-stream header bits, improves the accuracy of the first bit number, and is beneficial to improving the accuracy of QP decision making based on the first bit number, thereby improving the quality of video encoding using the QP value obtained by the decision.

[0166] In a possible example, the encoding device includes at least one encoding sub-stream buffer, and the at least one encoding sub-stream buffer includes a first buffer (such as Figure 3 The first buffer is used to temporarily store the sub-stream slices corresponding to the first historical sub-stream and the sub-stream slices corresponding to the first sub-stream (sub-stream 1).

[0167] In some feasible situations, the number of coding sub-stream buffers included in the coding device is consistent with the number of entropy encoders included in the coding device, and one coding sub-stream buffer is used to temporarily store a sub-stream slice to be processed by an entropy encoder. For example, the data content stored in one coding sub-stream buffer is the sub-stream slice data body contained in the sub-stream slice.

[0168] Exemplarily, the encoding device divides the encoding unit into multiple sub-streams, and sends different sub-streams to different encoding sub-stream buffers according to the sub-stream index value in the sub-stream slice corresponding to the sub-stream. For example, the sub-stream index length of each sub-stream slice is 2 bits (such as 2 binary bits). Among them, the sub-stream index value of '00' represents that the current sub-stream slice belongs to the first sub-stream, the value of '01' represents that the current sub-stream slice belongs to the second sub-stream, and the value of '10' represents that the current sub-stream slice belongs to the third sub-stream. The value of SubstreamIndex is equal to the value of substream_index converted to a 2-bit unsigned integer. The value of SubstreamIndex should not be 3. If image_format is equal to '000', the value of SubstreamIndex should not be 1, 2, 3.

[0169] In an optional implementation, the encoding device further updates the number of substream segments stored in the first buffer according to the aforementioned second number. For example, the number of substream segments encoded in the first buffer is updated to the subsequent second number, such as the encoding device setting: SubstreamSegmentNum[ssIdx] = tmpSubstreamSegmentNum.

[0170] In this embodiment, each time the encoding device updates the number of sub-stream header bits, it updates the number of encoded data packets in the encoding sub-stream buffer. Thus, in the process of the encoding device encoding the unencoded sub-stream slices in the encoding sub-stream buffer, the sub-stream header bits corresponding to the sub-stream are updated, thereby improving the accuracy of the first number of bits required for QP decision, which is beneficial to improving the quality of video encoding.

[0171] S530: The encoding device determines an estimated number of bits according to the number of bits of at least one substream header corresponding to at least one substream.

[0172] Optionally, when the substream slice does not include a flag bit, the estimated number of bits may refer to the sum of all substream header bit numbers corresponding to the at least one substream. In the case where the substream slice corresponding to the substream includes the data body content corresponding to the substream and the substream header bit, the number of coded bits indicates these data contents, and the estimated number of bits indicates these substream header bits (substream index), thereby avoiding the problem of too small QP value caused by the fact that the substream header bits are not considered by the bit rate control module, which is beneficial to improving the bit rate of video encoding and improving the image quality corresponding to the video content in the bitstream.

[0173] S540: The encoding device obtains a first number of bits according to the number of encoded bits and the estimated number of bits.

[0174] In this embodiment, the encoding device obtains the encoding bit number and the estimated bit number in the first bit number respectively, wherein the estimated bit number not only indicates the sub-stream header bit corresponding to a sub-stream, but takes into account the sub-stream header bits of all sub-streams corresponding to the encoding unit, thereby further avoiding the problem of too small QP value caused by the fact that this part of the sub-stream header bits are not considered by the bit rate control module, which is beneficial to improving the bit rate of video encoding and improving the image quality corresponding to the video content in the bitstream.

[0175] Correspondingly, in the image decoding method, the decoding device first obtains at least one sub-stream of the coding unit according to the bit stream, and estimates the first bit number of the at least one sub-stream, and then uses the first bit number to make a QP decision for the coding unit, and then uses the QP value obtained by the decision to perform inverse quantization and prediction, and then outputs a reconstructed image corresponding to the coding unit.

[0176] exist Figure 2 Based on the decoding device 220 shown, the present application also provides an image decoding method, such as Figure 8 As shown, Figure 8A flow chart of an image decoding method provided in an embodiment of the present application, the decoding method can be executed by the decoding device 220, and can also be executed by a decoding end that supports the functions of the decoding device 220. Here, the decoding method implemented by the decoding device 220 is taken as an example for explanation, and the decoding method includes the following steps S810 to S830.

[0177] S810. A decoding device obtains at least one substream corresponding to a coding unit according to a bitstream.

[0178] For example, the bit stream here may be the bit stream output in the embodiment corresponding to the aforementioned encoding method.

[0179] S820: The decoding device performs entropy decoding on at least one substream to obtain a first number of bits.

[0180] The first bit number includes a coded bit number and an estimated bit number, wherein the coded bit number is used to indicate the number of bits occupied by the data body content included in the aforementioned at least one substream, and the estimated bit number is used to indicate the substream header bits of each substream in the aforementioned at least one substream.

[0181] Regarding the specific implementation method in which the decoding device obtains the above-mentioned number of coded bits, estimated number of bits and first number of bits, the corresponding examples and beneficial effects can be referred to the corresponding description of the above encoding method embodiment, which will not be repeated here.

[0182] The difference between the decoding side and the encoding side is: ①, the sub-stream buffer included in the decoding device is a decoding sub-stream buffer; ②, the decoding device can only obtain multiple sub-streams after deinterleaving the bit stream (or reorganizing the sub-stream).

[0183] S830: The decoding device decodes at least one substream according to the first number of bits, and outputs a reconstructed image of the coding unit.

[0184] In this embodiment, the decoding device can decode the coding unit according to the number of coding bits corresponding to the coding unit and the estimated number of bits indicating the sub-stream header bits corresponding to multiple sub-streams, thereby avoiding the problem that errors occur when the bit rate control module performs bit rate control only according to the number of coding bits corresponding to the coding unit, which affects the accuracy of bit rate control, and is beneficial to improving the quality of video decoding.

[0185] Moreover, since the decoding device takes into account the number of bits occupied by the sub-stream header bits, this part of the sub-stream header bits are also taken into account in the video decoding process, avoiding the problem of too small QP value caused by this part of the sub-stream header bits not being taken into account by the bit rate control module, which is beneficial to improving the image quality of the video content obtained by the decoding device in parsing the bit stream.

[0186] In an optional implementation manner, the decoding device outputting the reconstructed image of the encoding unit may include: the decoding device displays the reconstructed image. Figure 2 For example, the decoding device 220 includes a display device 221, and the display device 221 can be used to display the reconstructed image.

[0187] In this embodiment, the decoding device can display one or more frames of images, thereby realizing the viewing of image information carried by the bit stream, which is beneficial to the display of video content, etc.

[0188] It is worth noting that the encoding method and decoding method proposed in the embodiments of the present application estimate the sub-stream header bits through the bits actually consumed by the encoding device and the decoding device, are independent of the sub-stream interleaving module and the sub-stream deinterleaving module, and decouple the bit rate control module and the sub-stream interleaving module on the encoding device side, and decouple the bit rate control module and the sub-stream deinterleaving module on the decoding device side, which is beneficial to reducing the complexity of video encoding and decoding and improving the accuracy of video encoding and decoding.

[0189] It is understandable that, in order to implement the functions in the above embodiments, the encoding device and the decoding device include hardware structures and / or software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.

[0190] Fig. 9 The schematic diagram of the structure of a coding device provided in an embodiment of the present application is as follows. The coding device can be used to implement the function of the coding device in the above method embodiment, and thus can also achieve the beneficial effects of the above coding method embodiment. In the embodiment of the present application, the coding device can be as follows Figure 1 The terminal device 112 shown may also be Figure 2 The encoding device 210 shown may also be a module (such as a chip) applied to an encoding device.

[0191] like Fig. 9As shown, the encoding device 900 includes: an acquisition module 910, a bit number determination module 920 and an encoding module 930. The acquisition module 910 is used to acquire at least one substream of the encoding unit of the image to be encoded. The bit number determination module 920 is used to perform entropy encoding on at least one substream to obtain a first bit number; wherein the first bit number includes the encoding bit number and the estimated bit number, the encoding bit number is used to indicate the number of bits occupied by the data body content included in the at least one substream, and the estimated bit number is used to indicate the substream header bit of each substream in the at least one substream. The encoding module 930 is used to encode the at least one substream according to the first bit number and output the bit stream of the encoding unit.

[0192] In an optional implementation, the bit number determination module 920 is specifically used to: entropy encode at least one sub-stream to obtain the number of coded bits; and, for the sub-stream slices corresponding to each sub-stream in the at least one sub-stream, estimate the number of sub-stream header bits of each sub-stream, and determine the estimated number of bits based on at least one sub-stream header bit number corresponding to the at least one sub-stream; and obtain a first number of bits based on the number of coded bits and the estimated number of bits.

[0193] In an optional implementation, the bit number determination module 920 is specifically used to: obtain a first number of sub-stream slices before encoding the first sub-stream according to the number of encoded bits of the first historical sub-stream in the historical coding unit; the first sub-stream is a sub-stream in at least one sub-stream corresponding to the first historical sub-stream; and, update the number of sub-stream header bits of the first sub-stream according to the first number and the sub-stream index length of the sub-stream slice corresponding to the first sub-stream.

[0194] In an optional implementation, the bit number determination module 920 is specifically configured to: obtain a second number according to the number of coded bits of the first substream, and obtain a difference between the second number and the first number; and update the number of substream header bits of the first substream according to the difference and the substream index length of the substream slice corresponding to the first substream. The second number is used to indicate the second number of coded substream slices corresponding to the first substream.

[0195] In an optional implementation, the encoding device includes at least one encoding sub-stream buffer, and the at least one encoding sub-stream buffer includes a first buffer, and the first buffer is used to temporarily store sub-stream slices corresponding to the first historical sub-stream and sub-stream slices corresponding to the first sub-stream.

[0196] Optionally, the encoding device provided in the embodiment of the present application further includes: an updating module, configured to update the number of sub-stream slices stored in the first buffer according to the second number.

[0197] In an optional implementation, the sub-stream slice corresponding to each sub-stream includes: a sub-stream slice data body and a sub-stream index of each sub-stream.

[0198] In an optional implementation, the estimated number of bits is the sum of the number of bits of at least one sub-stream header.

[0199] In an optional implementation, the sub-stream slice corresponding to each sub-stream in the aforementioned at least one sub-stream further includes a preset flag bit, and the estimated number of bits is also used to indicate the flag bit.

[0200] In an optional implementation, the encoding module 930 is specifically configured to determine a QP value of the encoding unit according to the first bit number; and encode at least one substream according to the QP value, and output a bitstream of the encoding unit.

[0201] In an optional implementation, the encoding module 930 is specifically configured to send a bit stream of the encoding unit.

[0202] The coding device 900 can be used to implement the operation steps corresponding to each method in the above coding method embodiment, and thus can also achieve corresponding beneficial effects, which will not be described in detail here. For more information about the acquisition module 910, the bit number determination module 920 and the coding module 930, please refer to the content of the above coding method embodiment, which will not be described in detail here.

[0203] Accordingly, the embodiment of the present application also provides a decoding device, such as Fig.10 As shown, Fig.10 The schematic diagram of the structure of a decoding device provided in an embodiment of the present application is a schematic diagram of the structure of a decoding device provided in an embodiment of the present application. The decoding device can be used to implement the function of the decoding device in the above method embodiment, and thus can also achieve the beneficial effects of the above decoding method embodiment. In an embodiment of the present application, the decoding device can be as follows: Figure 1 Any of the terminal devices 113 to 115 shown in the figure may also be as follows Figure 2 The decoding device 220 shown may also be a module (such as a chip) applied to a decoding device.

[0204] like Fig.10 As shown, the decoding device 1000 includes: an acquisition unit 1010, a bit number determination unit 1020 and a decoding unit 1030. The acquisition unit 1010 is used to acquire at least one substream corresponding to the coding unit according to the bit stream. The bit number determination unit 1020 is used to perform entropy decoding on at least one substream to obtain a first bit number. The first bit number includes the coded bit number and the estimated bit number, the coded bit number is used to indicate the number of bits occupied by the data body content included in the at least one substream, and the estimated bit number is used to indicate the substream header bit of each substream in the at least one substream. The decoding unit 1030 is used to decode the at least one substream according to the first bit number and output the reconstructed image of the coding unit.

[0205] In an optional implementation, the bit number determination unit 1020 is specifically configured to: entropy decode at least one substream to obtain a coded bit number; for a substream slice corresponding to each substream in the at least one substream, estimate the substream header bit number of each substream, and determine the estimated bit number according to at least one substream header bit number corresponding to the at least one substream. And, the bit number determination unit 1020 is further specifically configured to: obtain a first bit number according to the coded bit number and the estimated bit number.

[0206] In an optional implementation, the bit number determination unit 1020 is specifically configured to: obtain a first number of substream slices before decoding the first substream according to the number of coded bits of the first historical substream in the historical coding unit; and update the number of substream header bits of the first substream according to the first number and the substream index length of the substream slice corresponding to the first substream. The first substream is a substream corresponding to the first historical substream in at least one substream.

[0207] In an optional implementation, the bit number determination unit 1020 is specifically used to: obtain a second number according to the number of coded bits of the first substream, and obtain the difference between the second number and the first number. The second number is used to indicate the second number of pre-decoding substream slices corresponding to the first substream. And the bit number determination unit 1020 is also specifically used to update the number of substream header bits of the first substream according to the aforementioned difference and the substream index length of the substream slice corresponding to the first substream.

[0208] In an optional implementation, the decoding device includes at least one decoding sub-stream buffer, and the at least one decoding sub-stream buffer includes a first buffer, and the first buffer is used to temporarily store sub-stream slices corresponding to the first historical sub-stream and sub-stream slices corresponding to the first sub-stream.

[0209] Optionally, the decoding device provided in the embodiment of the present application further includes: an updating unit, configured to update the number of sub-stream slices stored in the first buffer according to the second number.

[0210] In an optional implementation, the sub-stream slice corresponding to each sub-stream includes: a sub-stream slice data body and a sub-stream index of each sub-stream.

[0211] In an optional implementation, the estimated number of bits is the sum of the number of bits of at least one sub-stream header.

[0212] In an optional implementation, the sub-stream slice corresponding to each sub-stream in the aforementioned at least one sub-stream further includes a preset flag bit, and the estimated number of bits is also used to indicate the flag bit.

[0213] In an optional implementation manner, the coding unit is specifically configured to: determine a QP value of the coding unit according to the first number of bits, decode at least one substream according to the QP value, and output a reconstructed image corresponding to the coding unit.

[0214] In an optional implementation manner, the decoding device may include a display unit, where the display unit is used to display the reconstructed image corresponding to the encoding unit.

[0215] The decoding device 1000 can be used to implement the operation steps corresponding to each method in the above decoding method embodiment, and thus can also achieve corresponding beneficial effects, which will not be described in detail here. For more information about the acquisition unit 1010, the bit number determination unit 1020 and the decoding unit 1030, please refer to the content of the above encoding method embodiment, which will not be described in detail here.

[0216] When the encoding device or decoding device implements any of the methods shown in the above figures by software, the encoding device or decoding device and its various units may also be software modules. The above method is implemented by calling the software module by a processor. The processor may be a central processing unit (CPU) or other application specific integrated circuit (ASIC), or a programmable logic device (PLD), and the above PLD may be a complex programmable logical device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0217] For a more detailed description of the above-mentioned encoding device or decoding device, reference can be made to the relevant description in the embodiments shown in the aforementioned figures, which will not be repeated here. It can be understood that the encoding device or decoding device shown in the aforementioned figures is only an example provided by this embodiment, and the encoding device or decoding device may include more or fewer units, which is not limited in this application.

[0218] When the encoding device or the decoding device is implemented by hardware, the hardware can be implemented by a processor or a chip. The chip includes an interface circuit and a control circuit. The interface circuit is used to receive data from other devices other than the processor and transmit it to the control circuit, or to send data from the control circuit to other devices other than the processor.

[0219] The control circuit and the interface circuit are used to implement any possible implementation method in the above embodiments through logic circuits or execution code instructions. The beneficial effects can be found in the description of any aspect of the above embodiments, which will not be repeated here.

[0220] In addition, the encoding device or the decoding device may also be implemented by an electronic device, where the electronic device may refer to the encoding device or the decoding device in the aforementioned embodiment, or, when the electronic device is a chip or a chip system applied to a server, the encoding device or the decoding device may also be implemented by a chip or a chip system.

[0221] like Fig.11 As shown, Fig.11 The electronic device 1100 is a schematic diagram of a structure of an electronic device provided in an embodiment of the present application, and includes: a processor 1110, a bus 1120, a memory 1130, a memory unit 1150 (also referred to as a main memory unit), and a communication interface 1140. The processor 1110, the memory 1130, the memory unit 1150, and the communication interface 1140 are connected via the bus 1120.

[0222] It should be understood that in this embodiment, the processor 1110 may be a CPU, and the processor 1110 may also be other general-purpose processors, DSPs, ASICs, FPGAs or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0223] The communication interface 1140 is used to implement communication between the electronic device 1100 and an external device or component. In this embodiment, the communication interface 1140 is used to perform data exchange with other electronic devices.

[0224] The bus 1120 may include a path for transmitting information between the above components (such as the processor 1110, the memory unit 1150, and the memory 1130). In addition to the data bus, the bus 1120 may also include a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus 1120 in the figure. The bus 1120 may be a Peripheral Component Interconnect Express (PCIe) bus, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc.

[0225] As an example, the electronic device 1100 may include multiple processors. The processor may be a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, and / or computing units for processing data (e.g., computer program instructions). The processor 1110 may call the encoding unit stored in the memory unit 1150 and encode based on the encoding unit; or the processor 1110 may call the bit stream stored in the memory unit 1150 and decode based on the bit stream, etc.

[0226] It is worth mentioning that Fig.11 In the example, an electronic device 1100 including one processor 1110 and one memory 1130 is taken as an example. Here, the processor 1110 and the memory 1130 are respectively used to indicate a type of device or equipment. In a specific embodiment, the number of each type of device or equipment can be determined according to business requirements.

[0227] The memory unit 1150 may correspond to a storage medium for storing information such as coding units and bit streams in the above method embodiments. The memory unit 1150 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0228] The memory 1130 is used to store bit streams or coding units to be encoded, etc., and can be a solid state drive or a mechanical hard disk.

[0229] It should be understood that the electronic device 1100 may be a DPU. The electronic device 1100 according to this embodiment may correspond to the encoding device or the decoding device in this embodiment, and may correspond to the device for executing the Figure 2 The above and other operations and / or functions of each module in the encoding device or decoding device are respectively for implementing the corresponding processes in the aforementioned method embodiment, and for the sake of brevity, they will not be repeated here.

[0230] The method steps in this embodiment can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium 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 be located in an ASIC. In addition, the ASIC can be located in a computing device. Of course, the processor and the storage medium can also exist as discrete components in a network device or a terminal device.

[0231] The present application also provides a chip system, which includes a processor for implementing the functions of the data processing unit in the above method. In one possible design, the chip system also includes a memory for storing program instructions and / or data. The chip system can be composed of a chip, or can include a chip and other discrete devices.

[0232] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD).

[0233] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A decoding method, characterized in that: The method is performed by a decoding device, and the method includes: Obtain one or more substreams corresponding to the coding unit according to the bit stream; Obtaining the number of coded bits of the one or more substreams and the number of bits occupied by the substream index, wherein the number of coded bits is used to indicate: the number of bits occupied by the substream slice data in the one or more substreams; The one or more substreams are decoded according to the number of encoding bits and the number of bits occupied by the substream index.

2. The method according to claim 1, characterized in that The obtaining the number of coded bits of the one or more substreams comprises: The one or more sub-streams are entropy decoded to obtain the number of coded bits of the coding unit.

3. The method according to claim 1 or 2, characterized in that: The obtaining the number of bits occupied by the substream indexes of the one or more substreams includes: Obtain a first number of substream slices before decoding a first substream; the first number is SubstreamSegmentNum[ssIdx], and the value of SubstreamSegmentNum[ssIdx] is the number of substream slices before decoding a substream slice corresponding to the first substream; The number of bits of a substream index in the first substream is updated according to the first number.

4. The method according to claim 3, characterized in that Updating the number of bits of a substream index in the first substream according to the first number includes: Acquire a second number according to the number of coded bits of the first substream, where the second number is tmpSubstreamSegmentNum, and the value of tmpSubstreamSegmentNum is the number of substream slices after decoding the substream slice corresponding to the first substream; The number of bits of the substream index in the first substream is updated according to the difference between the second number and the first number.

5. The method according to claim 4, characterized in that The decoding device comprises at least one decoding sub-stream buffer, wherein the at least one decoding sub-stream buffer comprises a first decoding sub-stream buffer, and the first decoding sub-stream buffer is used to temporarily store sub-stream slices corresponding to the first sub-stream; The method further comprises: The number of sub-stream slices stored in the first decoding sub-stream buffer is updated according to the second number.

6. The method according to any one of claims 1 to 5, characterized in that The number of bits occupied by the substream index in the one or more substreams is used to indicate a preset flag bit.

7. The method according to any one of claims 1 to 6, characterized in that Decoding the one or more substreams according to the number of coded bits and the number of header bits includes: Obtaining a quantization parameter QP value of the coding unit according to the number of coded bits of the one or more substreams and the number of bits occupied by the substream index; The one or more sub-streams are decoded according to the QP value, and a decoded image of the coding unit is output.

8. A coding method, characterized in that: The method is performed by an encoding device, and the method includes: Obtain one or more substreams corresponding to a coding unit of an image; Obtaining the number of coded bits of the one or more substreams and the number of bits occupied by the substream index, wherein the number of coded bits is used to indicate: the number of bits occupied by the substream slice data in the one or more substreams; The one or more substreams are encoded according to the number of encoding bits and the number of bits occupied by the substream index.

9. The method according to claim 8, characterized in that The obtaining the number of coded bits of the one or more substreams comprises: The one or more sub-streams are entropy encoded to obtain the number of coded bits of the coding unit.

10. The method according to claim 8 or 9, characterized in that: The obtaining the number of bits occupied by the substream indexes of the one or more substreams includes: Obtain a first number of substream slices before encoding a first substream; the first number is SubstreamSegmentNum[ssIdx], and the value of SubstreamSegmentNum[ssIdx] is the number of substream slices before encoding a substream slice corresponding to the first substream; The number of bits of a substream index in the first substream is updated according to the first number.

11. The method according to claim 10, characterized in that Updating the number of bits of a substream index in the first substream according to the first number includes: Acquire a second number according to the number of coded bits of the first substream, where the second number is tmpSubstreamSegmentNum, and the value of tmpSubstreamSegmentNum is the number of substream slices after encoding the substream slice corresponding to the first substream; The number of bits of the substream index in the first substream is updated according to the difference between the second number and the first number.

12. The method according to claim 11, characterized in that The encoding device comprises at least one encoding sub-stream buffer, wherein the at least one encoding sub-stream buffer comprises a first encoding sub-stream buffer, and the first encoding sub-stream buffer is used to temporarily store sub-stream slices corresponding to the first sub-stream; The method further comprises: The number of sub-stream slices stored in the first encoding sub-stream buffer is updated according to the second number.

13. The method according to any one of claims 8 to 12, characterized in that: Encoding the one or more substreams according to the number of coded bits and the number of header bits includes: Obtaining a quantization parameter QP value of the coding unit according to the number of coded bits of the one or more substreams and the number of bits occupied by the substream index; The one or more sub-streams are encoded according to the QP value, and a bit stream of the coding unit is output.

14. A decoding device, characterized in that: include: An acquisition unit, configured to acquire one or more sub-streams corresponding to the coding unit according to the bit stream; A bit number determination unit, used to obtain the number of coded bits of the one or more substreams and the number of bits occupied by the substream index, wherein the number of coded bits is used to indicate: the number of bits occupied by the substream slice data in the one or more substreams; A decoding unit is used to decode the one or more sub-streams according to the number of encoding bits and the number of bits occupied by the sub-stream index.

15. A coding device, characterized in that: include: An acquisition module, used to acquire one or more sub-streams corresponding to a coding unit of an image; A bit number determination module, used to obtain the number of coded bits of the one or more substreams and the number of bits occupied by the substream index, wherein the number of coded bits is used to indicate: the number of bits occupied by the substream slice data in the one or more substreams; The encoding module is used to encode the one or more sub-streams according to the number of encoding bits and the number of bits occupied by the sub-stream index.

16. An electronic device, characterized in that: include: processor and interface circuits; The interface circuit is used to receive a signal from another device other than the electronic device and transmit it to the processor, or to send a signal from the processor to another device other than the electronic device; The processor is used to implement the method of any one of claims 1 to 7 through a logic circuit or by executing a code instruction, or the processor is used to implement the method of any one of claims 8 to 13 through a logic circuit or by executing a code instruction.

17. A coding and decoding system, characterized in that: The invention comprises an encoding device and a decoding device, wherein the encoding device is communicatively connected with the decoding device, the decoding device is used to implement the method according to any one of claims 1 to 7, and the encoding device is used to implement the method according to any one of claims 8 to 13.

18. A computer-readable storage medium, characterized in that: The storage medium stores a computer program or instruction, and when the computer program or instruction is executed by the electronic device, the method according to any one of claims 1 to 7 is implemented; And / or, when the computer program or instruction is executed by an electronic device, the method according to any one of claims 8 to 13 is implemented.

19. A computer program product, characterized in that The computer program product comprises instructions, and when the computer program product is run on an encoding device, the encoding device executes the instructions to implement the method according to any one of claims 8 to 13; And / or, when the computer program product runs on a decoding device, the decoding device executes the instructions to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Encoding bit rate control method, device, program, and recording medium containing the program

    CN101632308A

  • Substream multiplexing for display stream compression

    CN110603812A

  • Voice encoding method and voice decoding method

    JP2008217025A

  • Substream multiplexing for display stream compression

    US20170359583A1

  • Adaptive video coding method

    US5790196A