An image coding method, apparatus, device and storage medium

By inserting redundant image headers and configuring start codes in image encoding, the problem of decoding failure caused by image header loss is solved, achieving efficient decoding in low-latency and packet-loss-prone scenarios and improving user experience.

CN122496641APending Publication Date: 2026-07-31MALANSHAN AUDIO & VIDEO LABORATORY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
MALANSHAN AUDIO & VIDEO LABORATORY
Filing Date
2026-05-07
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In low-latency and packet-loss scenarios, existing image encoding and decoding schemes suffer from image header loss, which prevents the receiver from decoding correctly. Furthermore, existing recovery logic has poor interoperability and makes it difficult to form a stable standard protection point.

Method used

During image encoding, redundant image headers are inserted, different types of start codes are configured, and the main image header, redundant image headers, image block headers, and data are combined into the target encoded bitstream. During decoding, redundant image headers are identified and processed to ensure correct decoding.

Benefits of technology

It improves the efficiency of image encoding and decoding, enhances the user experience, and ensures correct decoding capabilities in scenarios involving packet loss and partial resynchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122496641A_ABST
    Figure CN122496641A_ABST
Patent Text Reader

Abstract

This application discloses an image encoding / decoding method, apparatus, device, and storage medium, relating to the field of image processing technology. The method includes: dividing an image into several image blocks to generate a main image header; constructing a redundant image header based on the main image header, and configuring a first start code of image header type and a second start code of non-image header type for the redundant image header and image block headers respectively; synthesizing an encoded bitstream including the main image header, redundant image header, block header, block data, and block end syntax; parsing the encoded bitstream based on image-level control information; scanning the start code of the next image block when encountering block end syntax; if it is an image header type, setting the subsequent syntax unit as the current redundant image header, continuing scanning until a non-image header type start code is encountered, and setting the corresponding syntax unit as the image block header; and starting decoding from the block header to improve the efficiency of image encoding / decoding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an image encoding / decoding method, apparatus, device, and storage medium. Background Technology

[0002] Currently, in scenarios such as low-latency video coding, ultra-low-latency interactive video, cloud gaming, remote control, XR, industrial vision, and automotive video, in order to reduce system latency, improve parallel processing capabilities, adapt to network transmission, and meet local recovery requirements, a common approach is to divide a frame of image into multiple patches for encoding and transmission.

[0003] Under the existing patch encoding framework, a frame of image typically contains the following hierarchical information: 1. Sequence-level information, such as SQH (Sequence Header); 2. Image-level information, such as PH (Picture Header); 3. Patch-level information, such as patch headers; 4. The encoding payload corresponding to the patch; 5. Patch is the closing syntax.

[0004] In existing schemes, image-level syntax is typically sent only once at the beginning of a frame. Subsequently, each patch only carries the patch header and the encoded data of the corresponding patch. This structure works normally in an ideal lossless channel, but it has the following problems in low-latency, packetized transmission, and loss-prone scenarios: 1. The image header typically carries important control information required for decoding the frame, such as quantization parameter information, loop filtering information, reference management information, tool switch information, etc. 2. When the packet containing the image header is lost, but some subsequent patch data still arrives, the receiving end may not be able to complete the correct decoding or recovery based solely on the patch-level syntax. 3. Even if the image header is not lost, in scenarios such as patch-level transmission, local forwarding, intermediate node unpacking, and local resynchronization, a structure with only one image header is not conducive to entering decoding by patch. 4. Existing engineering implementations often use channel simulation modules, application layer caching, non-standard packet splicing, or external bypass redundancy to achieve recovery logic. However, this approach is not part of the standard bitstream syntax, has poor interoperability, and makes it difficult to form a stable standard protection point.

[0005] As can be seen from the above, how to improve the efficiency of image encoding and decoding is an urgent problem to be solved. Summary of the Invention

[0006] In view of this, the purpose of this invention is to provide an image encoding / decoding method, apparatus, device, and storage medium, which can improve the efficiency of image encoding / decoding during the image encoding / decoding process. The specific solution is as follows: In a first aspect, this application provides an image encoding / decoding method, including: The image to be encoded is acquired and divided into several image blocks to generate the main image header of the image to be encoded; the main image header carries several image-level control information. A redundant image header is constructed based on the main image header, and a first start code and a second start code are respectively configured for the redundant image header and the image block header of each image block. The main image header, each redundant image header, each image block header, the image block data corresponding to each image block, and the end syntax of each image block are combined into a target encoded bitstream. The first start code is a start code that represents the image header type; the second start code is a start code that represents a non-image header type. The target encoded bitstream is decoded based on the parsed image-level control information. When the parsing result indicates that the end syntax of the current image block has been parsed, the third start code of the next image block is scanned. When the third start code is a start code that represents the image header type, the standard syntax unit connected to the third start code is set as the current redundant image header, and the scanning continues until the scanned start code is a start code that represents a non-image header type. The standard syntax unit connected to the scanned start code is set as the image block header of the image block, so that the target encoded bitstream is decoded starting from the image block header.

[0007] Optionally, the step of acquiring the image to be encoded, dividing the image to be encoded into several image blocks, and generating the main image header of the image to be encoded includes: Obtain each image to be encoded corresponding to the video to be encoded, and divide the images to be encoded into several image blocks; A main image header corresponding to the image to be encoded is generated based on a preset syntax field arrangement order and a preset encoding function; the main image header carries several image-level control information for encoding the image to be encoded.

[0008] Optionally, constructing a redundant image header based on the main image header includes: The arrangement order of the syntax fields corresponding to the main image header is determined, and a redundant image header corresponding to the main image header is constructed based on the arrangement order of the syntax fields and the preset encoding function; the redundant image header is a standard syntax unit including a preset proportion of the image-level control information; the arrangement order of the syntax fields corresponding to the redundant image header is consistent with the arrangement order of the syntax fields corresponding to the main image header.

[0009] Optionally, configuring a first start code and a second start code for the redundant image header and the image block header of each image block respectively includes: A first start code is assigned to the redundant image header to obtain the allocated redundant image header, and a second start code is assigned to the image block header of each image block to obtain the allocated image block header; The first start code and the second start code have different start code values; the start code value of the first start code is used to characterize the image header type; the start code value of the second start code is used to characterize the non-image header type.

[0010] Optionally, the step of combining the main image header, each of the redundant image headers, each of the image block headers, the image block data corresponding to each of the image blocks, and the end syntax of each of the image blocks into a target encoded bitstream includes: The position of each redundant image header in the bitstream is determined sequentially based on the priority and predicted importance of each image block. The target encoded bitstream is constructed based on the main image header, the image block header and image block data corresponding to each image block, the end syntax of each image block, and the position of each image header.

[0011] Optionally, when the third start code is a start code representing an image header type, setting the standard syntax unit connected to the third start code as the current redundant image header, and continuing to scan backwards until the scanned start code is a start code representing a non-image header type, includes: The main image header is cached, and the start code type corresponding to the third start code is determined. If the start code type is an image header type, the standard syntax unit connected to the third start code is set as the current redundant image header. The current redundant image header is checked for consistency with the main image header. After the check passes, the scanning continues until the start code type corresponding to the scanned start code is a non-image header type.

[0012] Optionally, setting the standard syntax unit concatenated with the scanned start code as the image block header of the image block, so as to decode the target encoded bitstream starting from the image block header, includes: Determine the standard syntax unit that connects with the scanned start code, set the standard syntax unit as the image block header of the image block, and set the image block header as the decoding start position; The target encoded bitstream is decoded based on the decoding start position to obtain the corresponding image block header and image block data.

[0013] Secondly, this application provides an image encoding / decoding apparatus, comprising: The main image header creation module is used to acquire the image to be encoded, divide the image to be encoded into several image blocks, and generate the main image header of the image to be encoded; the main image header carries several image-level control information. The target encoded bitstream synthesis module is used to construct redundant image headers based on the main image header, and to configure a first start code and a second start code for the redundant image headers and the image block headers of each image block respectively, and to synthesize the main image header, each of the redundant image headers, each of the image block headers, the image block data corresponding to each of the image blocks and the end syntax of each of the image blocks into a target encoded bitstream; the first start code is a start code that represents the image header type; the second start code is a start code that represents a non-image header type; The encoding stream parsing module is used to decode the target encoding stream, and to decode the target encoding stream based on the parsed image-level control information. When the parsing result indicates that the end syntax of the current image block has been parsed, the third start code of the next image block is scanned. The current redundant image header determination module is used to set the standard syntax unit connected to the third start code as the current redundant image header when the third start code is a start code that represents the image header type, and continue scanning backward until the scanned start code is a start code that represents a non-image header type. The encoding stream decoding module is used to set the standard syntax unit connected with the scanned start code as the image block header of the image block, so as to decode the target encoding stream starting from the image block header.

[0014] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the aforementioned image encoding and decoding method.

[0015] Fourthly, this application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned image encoding / decoding method.

[0016] As can be seen from the above, before performing image encoding and decoding, this application needs to acquire the image to be encoded, divide the image to be encoded into several image blocks, and generate the main image header of the image to be encoded; the main image header carries several image-level control information; based on the main image header, a redundant image header is constructed, and a first start code and a second start code are respectively configured for the redundant image header and the image block header of each image block; the image block data corresponding to each redundant image header, each image block header, and each image block is combined with the end syntax of each image block to form the target encoded bitstream; the first start code is the start code that represents the image header type; the second start code represents the non-image header type. The start code of the type; decode the target encoded bitstream, and decode the target encoded bitstream based on the parsed image-level control information. When the parsing result indicates that the end syntax of the current image block has been parsed, scan the third start code of the next image block; when the third start code is the start code indicating the image header type, set the standard syntax unit connected with the third start code as the current redundant image header, and continue scanning until the scanned start code is the start code indicating a non-image header type; set the standard syntax unit connected with the scanned start code as the image block header of the image block, so as to start decoding the target encoded bitstream from the image block header.

[0017] Therefore, this application first needs to acquire the image to be encoded and divide it into several image blocks to generate the main image header of the image to be encoded. Second, it configures a first start code and a second start code for the redundant image header and the image block headers of each image block, respectively. It then synthesizes the image block data corresponding to each redundant image header, each image block header, and each image block, along with the ending syntax of each image block, into a target encoded bitstream. Next, it decodes the target encoded bitstream based on the parsed image-level control information. When the parsing result indicates the end syntax of the current image block, it scans the third start code of the next image block. Then, when the third start code is a start code indicating the image header type, it sets the standard syntax unit connected to the third start code as the current redundant image header and continues scanning until the scanned start code is a start code indicating a non-image header type. Finally, it sets the standard syntax unit connected to the scanned start code as the image block header of the image block, thus starting the decoding of the target encoded bitstream from the image block header. This improves the efficiency of image encoding and decoding during the image encoding and decoding process, thereby enhancing the user experience. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0019] Figure 1 This is a flowchart of an image encoding and decoding method disclosed in this application; Figure 2 This is a schematic diagram of the structure of an image encoding and decoding device disclosed in this application; Figure 3 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

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

[0021] In existing schemes, image-level syntax is typically sent only once at the beginning of a frame. Subsequently, each patch only carries a patch header and the encoded data of the corresponding patch. This structure has the following problems in low-latency, packetized transmission, and packet-loss-prone scenarios: the image header usually carries important control information required for decoding the frame; when the packet containing the image header is lost, but some subsequent patch data still arrives, the receiving end may not be able to complete the correct decoding or recovery based solely on the patch-level syntax; even if the image header is not lost, in scenarios such as patch-granular transmission, partial forwarding, intermediate node unpacking, and partial resynchronization, the structure of only one image header is not conducive to entering decoding by patch. To address these issues, this application provides an image encoding and decoding method that improves the efficiency of image encoding and decoding during the image encoding and decoding process.

[0022] See Figure 1 As shown, an embodiment of the present invention discloses an image encoding and decoding method, including: Step S11: Obtain the image to be encoded, divide the image to be encoded into several image blocks, and generate the main image header of the image to be encoded; the main image header carries several image-level control information.

[0023] In this embodiment, when an image is divided into multiple patches and encoded sequentially, this application embodiment selects to insert a redundant image header syntax unit before at least one patch header, preferably before each subsequent patch header. This redundant image header syntax unit carries all or part of the image-level control information required for the current image and is connected to the patch-level syntax using standardized start codes, boundary rules, and syntax arrangement order.

[0024] Subsequently, after parsing the Patch end syntax at the decoding end, the embodiments of this application are able to identify and process the redundant image header syntax unit, and then continue to parse the next Patch header and Patch data.

[0025] It is worth mentioning that the key to the embodiments of this application is not "simply copying a piece of data", but rather: elevating the redundant packet to a standard syntax element; clarifying its relative position in the bitstream; clarifying its boundary identification method; clarifying its syntax order with the patch header, patch payload, and patch end; clarifying the encoder writing rules and decoder processing rules; and allowing the redundant image header to be used for skipping, verification, restoration, or reconstruction of the patch-level decoding context.

[0026] Specifically, acquiring the image to be encoded, dividing the image to be encoded into several image blocks, and generating the main image header of the image to be encoded may include: acquiring each image to be encoded corresponding to the video to be encoded, and dividing the image to be encoded into several image blocks; generating the main image header corresponding to the image to be encoded based on the preset syntax field arrangement order and preset encoding function; the main image header carries several image-level control information for encoding the image to be encoded.

[0027] Step S12: Construct a redundant image header based on the main image header, and configure a first start code and a second start code for the redundant image header and the image block header of each image block respectively. Combine the main image header, each redundant image header, each image block header, the image block data corresponding to each image block and the end syntax of each image block into a target encoded bitstream; the first start code is a start code that represents the image header type; the second start code is a start code that represents a non-image header type.

[0028] In one specific implementation, the patch bitstream of an image frame can be organized as follows: sequence_header() picture_header() patch_group() patch_group() { for each Patchi { [redundant_picture_header_unit()] patch_header(i) patch_payload(i) patch_end() } } In this context, square brackets indicate optionality; in one specific implementation, redundant image header syntax units may be inserted for each non-first patch or for each patch.

[0029] Furthermore, the semantics of the redundant image header may include, but are not limited to: providing a copy of image-level control information for subsequent patches; assisting in recovering the decoding context of the current image when the image header is lost; quickly entering the decoding preparation state of a patch when a patch is received locally; maintaining the self-descriptive nature of the front of the patch when intermediate nodes perform patch-level forwarding; and performing consistency checks at the receiving end to determine whether the image header of the current patch is consistent with the cached main image header.

[0030] Specifically, constructing a redundant image head based on the main image head may include: determining the arrangement order of the syntax fields corresponding to the main image head, and constructing a redundant image head corresponding to the main image head based on the arrangement order of the syntax fields and a preset encoding function; the redundant image head is a standard syntax unit that includes image-level control information of a preset ratio; the arrangement order of the syntax fields corresponding to the redundant image head is consistent with the arrangement order of the syntax fields corresponding to the main image head.

[0031] It is worth mentioning that the preferred arrangement of redundant image headers and patches is as follows: picture_header() redundant_picture_header_unit() patch_header(0) patch_payload(0) patch_end() redundant_picture_header_unit() patch_header(1) patch_payload(1) patch_end() ... redundant_picture_header_unit() patch_header(N-1) patch_payload(N-1) patch_end() Furthermore, the embodiments of this application may also adopt the following variations: 1. Only insert redundant image headers before the second and subsequent patches; 2. Only insert redundant image headers before high-priority patches; 3. Insert redundant image headers into the patch at fixed intervals; 4. Insert redundant image headers before critical patches, edge patches, reference patches, or patches with high prediction importance.

[0032] Specifically, configuring a first start code and a second start code for the redundant image header and the image block headers of each image block respectively can include: assigning a first start code to the redundant image header to obtain the allocated redundant image header, and assigning a second start code to the image block headers of each image block to obtain the allocated image block headers; wherein the first start code and the second start code have different start code values; the start code value of the first start code is used to characterize the image header type; the start code value of the second start code is used to characterize non-image header types.

[0033] In this embodiment, the encoding end method corresponding to the present application embodiment may include the following steps: acquiring the image to be encoded; dividing the image into multiple patches; generating the main image header of the current image; sequentially encoding the patch header and patch data of each patch; inserting redundant image header syntax units before at least one patch header; and outputting a standard bitstream containing redundant image header syntax units.

[0034] In one specific implementation, the main image header is output once in the conventional manner; when entering the Patch group encoding, a redundant image header is output before the first Patch header; after a Patch encoding is completed and the Patch end syntax is output, if there are still subsequent Patches, the redundant image header is output again before the next Patch header; the redundant image header is preferably generated by reusing the existing picture header encoding function, thereby ensuring that its semantics are consistent with the main image header.

[0035] Specifically, the process of synthesizing the redundant image headers, image block headers, image block data corresponding to each image block, and the ending syntax of each image block into a target encoded bitstream can include: determining the position of each redundant image header in the bitstream based on the priority and predicted importance of each image block; and constructing the corresponding target encoded bitstream based on the main image header, the image block headers and image block data corresponding to each image block, the ending syntax of each image block, and the position of each image header.

[0036] Step S13: Decode the target encoded bitstream. Decode the target encoded bitstream based on the parsed image-level control information. When the parsing result indicates that the end syntax of the current image block has been parsed, scan the third start code of the next image block.

[0037] In this embodiment, the decoding method may include the following steps: receiving a standard bitstream; parsing the sequence header and the main image header; entering a patch decoding loop; after completing the current patch, identifying the patch end syntax; after the patch end syntax, detecting whether there is a redundant image header syntax unit; if so, skipping, parsing, caching, comparing, or reusing the redundant image header syntax unit; and continuing to parse the next patch header and the next patch data.

[0038] Step S14: When the third start code is a start code representing the image header type, the standard syntax unit connected to the third start code is set as the current redundant image header, and the scanning continues until the scanned start code is a start code representing a non-image header type.

[0039] In this embodiment, the present application also includes a scheme for using the receiving end to cache redundant image headers. That is, the receiving end can cache the most recently successfully received image header syntax unit. When the image header start code appears again before a subsequent patch, the present application needs to read the syntax unit; compare it byte by byte or field by field with the cached image header; if the comparison is consistent, it is identified as a redundant image header of the current image; it is then incorporated into the receiving buffer related to the current patch, or used as pre-patch control information for the next patch.

[0040] Specifically, when the third start code is a start code representing the image header type, the standard syntax unit connected to the third start code is set as the current redundant image header, and the scanning continues until the scanned start code is a start code representing a non-image header type. This may include: caching the main image header and determining the start code type corresponding to the third start code. If the start code type is an image header type, the standard syntax unit connected to the third start code is set as the current redundant image header. The current redundant image header and the main image header are checked for consistency, and after the check passes, the scanning continues until the start code type corresponding to the scanned start code is a non-image header type.

[0041] Step S15: Set the standard syntax unit connected to the scanned start code as the image block header of the image block, so as to decode the target encoded bitstream starting from the image block header.

[0042] In this embodiment, after the decoding end completes the entropy decoding of a patch: first, it identifies the patch end syntax, and then scans the start code from the current byte position backward; if the start code type is detected to be an image header type syntax, it is determined to enter the redundant image header syntax unit; it continues to scan backward until it encounters the next non-image header type start code; it takes this position as the start position of the next patch header; and it continues to decode the next patch according to the above patch header.

[0043] Specifically, setting the standard syntax unit connected to the scanned start code as the image block header of the image block, so as to decode the target encoded bitstream starting from the image block header, may include: determining the standard syntax unit connected to the scanned start code, setting the standard syntax unit as the image block header of the image block, and setting the image block header as the decoding start position; decoding the target encoded bitstream based on the decoding start position to obtain the corresponding image block header and image block data.

[0044] In some system architectures, the receive preprocessing module, intermediate forwarding node, or channel simulation module can be used to cache image header syntax; identify redundant image headers inserted in the bitstream; verify, merge, pre-paste, or splice redundant image headers; and provide the processed patch-related data to the standard decoder.

[0045] It is worth mentioning that the core of this invention is still that the redundant image header itself belongs to the standard bitstream syntax, rather than the non-standard bypass data generated by the above modules.

[0046] The corresponding bitstream structure in the existing technology is as follows: SQH PH patch_header(0) patch_data(0) patch_end patch_header(1) patch_data(1) patch_end ... The bitstream structure after adopting this invention is as follows: SQH PH redundant_PH patch_header(0) patch_data(0) patch_end redundant_PH patch_header(1) patch_data(1) patch_end redundant_PH patch_header(2) patch_data(2) patch_end ... As can be seen from the above, the embodiments of this application first need to acquire the image to be encoded and divide it into several image blocks to generate the main image header of the image to be encoded; secondly, configure the first start code and the second start code respectively for the redundant image header and the image block header of each image block, and synthesize the image block data corresponding to each redundant image header, each image block header, and each image block and the end syntax of each image block into the target encoded bitstream; then, decode the target encoded bitstream, and decode the target encoded bitstream based on the parsed image-level control information. When the parsing result indicates that the end syntax of the current image block has been parsed, scan the third start code of the next image block; then, when the third start code is the start code indicating the image header type, set the standard syntax unit connected with the third start code as the current redundant image header, and continue scanning backward until the scanned start code is the start code indicating a non-image header type; finally, set the standard syntax unit connected with the scanned start code as the image block header of the image block, so as to decode the target encoded bitstream starting from the image block header. This improves the efficiency of image encoding and decoding, thereby enhancing the user experience.

[0047] Accordingly, see Figure 2 As shown, this application also provides an image encoding / decoding apparatus, comprising: The main image header creation module 11 is used to acquire the image to be encoded, divide the image to be encoded into several image blocks, and generate the main image header of the image to be encoded; the main image header carries several image-level control information. The target encoded bitstream synthesis module 12 is used to construct redundant image headers based on the main image header, and to configure a first start code and a second start code for the redundant image headers and the image block headers of each image block respectively, and to synthesize the main image header, each of the redundant image headers, each of the image block headers, the image block data corresponding to each of the image blocks and the end syntax of each of the image blocks into a target encoded bitstream; the first start code is a start code that represents the type of image header; the second start code is a start code that represents a non-image header type; The encoding stream parsing module 13 is used to decode the target encoding stream, and to decode the target encoding stream based on the parsed image-level control information. When the parsing result indicates that the end syntax of the current image block has been parsed, the third start code of the next image block is scanned. The current redundant image header determination module 14 is used to set the standard syntax unit connected to the third start code as the current redundant image header when the third start code is a start code that represents the image header type, and continue scanning backward until the scanned start code is a start code that represents a non-image header type. The encoding stream decoding module 15 is used to set the standard syntax unit connected with the scanned start code as the image block header of the image block, so as to decode the target encoding stream starting from the image block header.

[0048] In some specific embodiments, the main image header creation module 11 may specifically include: An image segmentation unit is used to acquire each image to be encoded corresponding to the video to be encoded, and to divide the image to be encoded into several image blocks; The main image header creation unit is used to generate a main image header corresponding to the image to be encoded based on a preset syntax field arrangement order and a preset encoding function; the main image header carries several image-level control information for encoding the image to be encoded.

[0049] In some specific embodiments, the target encoded bitstream synthesis module 12 may specifically include: The syntax field arrangement order determination unit is used to determine the syntax field arrangement order corresponding to the main image head, so as to construct a redundant image head corresponding to the main image head based on the syntax field arrangement order and the preset encoding function; the redundant image head is a standard syntax unit including the image-level control information of a preset ratio; the syntax field arrangement order corresponding to the redundant image head is consistent with the syntax field arrangement order corresponding to the main image head.

[0050] In some specific embodiments, the target encoded bitstream synthesis module 12 may specifically include: A start code allocation unit is used to allocate a first start code to the redundant image header to obtain an allocated redundant image header, and to allocate a second start code to the image block header of each image block to obtain an allocated image block header; wherein, the first start code and the second start code have different start code values; the start code value of the first start code is used to characterize the image header type; the start code value of the second start code is used to characterize the non-image header type.

[0051] In some specific embodiments, the target encoded bitstream synthesis module 12 may specifically include: The image header position determination unit is used to determine the position of each redundant image header in the bitstream in sequence based on the priority of each image block and the predicted importance of each image block; The target encoded bitstream synthesis subunit is used to construct the corresponding target encoded bitstream based on the main image header, the image block header and image block data corresponding to each image block, the end syntax of each image block, and the position of each image header.

[0052] In some specific embodiments, the current redundant image head determination module 14 may specifically include: The start code type determination unit is used to cache the main image header and determine the start code type corresponding to the third start code. If the start code type is an image header type, the standard syntax unit connected to the third start code is set as the current redundant image header. The image header verification unit is used to verify the consistency between the current redundant image header and the main image header, and after the verification is passed, continue scanning until the start code type corresponding to the scanned start code is a non-image header type.

[0053] In some specific embodiments, the encoded bitstream decoding module 15 may specifically include: The decoding start position determination unit is used to determine the standard syntax unit that connects with the scanned start code, set the standard syntax unit as the image block header of the image block, and set the image block header as the decoding start position; The encoding stream decoding unit is used to decode the target encoding stream based on the decoding start position to obtain the corresponding image block header and image block data.

[0054] Furthermore, embodiments of this application also disclose an electronic device, Figure 3 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the image encoding / decoding method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0055] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0056] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0057] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the image encoding / decoding method disclosed in any of the foregoing embodiments executed by the electronic device 20, the computer program 222 may further include a computer program capable of performing other specific tasks.

[0058] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned image encoding and decoding method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0059] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0060] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0061] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0062] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0063] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method of image coding, characterized by, include: Acquire the image to be encoded, divide the image to be encoded into several image blocks, and generate the main image header of the image to be encoded; The main image header carries several image-level control information; A redundant image header is constructed based on the main image header, and a first start code and a second start code are respectively configured for the redundant image header and the image block header of each image block. The main image header, each of the redundant image headers, each of the image block headers, the image block data corresponding to each of the image blocks, and the end syntax of each of the image blocks are combined into a target encoded bitstream; the first start code is a start code that represents the image header type. The second start code is a start code that represents a non-image header type; The target encoded bitstream is decoded based on the parsed image-level control information. When the parsing result indicates that the end syntax of the current image block has been parsed, the third start code of the next image block is scanned. When the third start code is a start code that represents the image header type, the standard syntax unit connected to the third start code is set as the current redundant image header, and the scanning continues until the scanned start code is a start code that represents a non-image header type. The standard syntax unit connected to the scanned start code is set as the image block header of the image block, so that the target encoded bitstream is decoded starting from the image block header.

2. The method of claim 1, wherein, The step of acquiring the image to be encoded, dividing the image to be encoded into several image blocks, and generating the main image header of the image to be encoded includes: Obtain each image to be encoded corresponding to the video to be encoded, and divide the images to be encoded into several image blocks; A main image header corresponding to the image to be encoded is generated based on a preset syntax field arrangement order and a preset encoding function; the main image header carries several image-level control information for encoding the image to be encoded.

3. The method of claim 2, wherein, The construction of a redundant image header based on the main image header includes: The arrangement order of the syntax fields corresponding to the main image header is determined, and a redundant image header corresponding to the main image header is constructed based on the arrangement order of the syntax fields and the preset encoding function; the redundant image header is a standard syntax unit including a preset proportion of the image-level control information; the arrangement order of the syntax fields corresponding to the redundant image header is consistent with the arrangement order of the syntax fields corresponding to the main image header.

4. The method of Claim 1, wherein, The step of configuring a first start code and a second start code for the redundant image header and the image block headers of each image block respectively includes: A first start code is assigned to the redundant image header to obtain the allocated redundant image header, and a second start code is assigned to the image block header of each image block to obtain the allocated image block header; The first start code and the second start code have different start code values; the start code value of the first start code is used to characterize the image header type; the start code value of the second start code is used to characterize the non-image header type.

5. The method of claim 1, wherein, The step of combining the main image header, each of the redundant image headers, each of the image block headers, the image block data corresponding to each of the image blocks, and the end syntax of each of the image blocks into a target encoded bitstream includes: The position of each redundant image header in the bitstream is determined sequentially based on the priority and predicted importance of each image block. The target encoded bitstream is constructed based on the main image header, the image block header and image block data corresponding to each image block, the end syntax of each image block, and the position of each image header.

6. The method of claim 1, wherein, When the third start code is a start code representing an image header type, the standard syntax unit connected to the third start code is set as the current redundant image header, and scanning continues until the scanned start code is a start code representing a non-image header type, including: The main image header is cached, and the start code type corresponding to the third start code is determined. If the start code type is an image header type, the standard syntax unit connected to the third start code is set as the current redundant image header. The current redundant image header is checked for consistency with the main image header. After the check passes, the scanning continues until the start code type corresponding to the scanned start code is a non-image header type.

7. The method of Claim 1-6, wherein, The step of setting the standard syntax unit concatenated with the scanned start code as the image block header of the image block, so as to decode the target encoded bitstream starting from the image block header, includes: Determine the standard syntax unit that connects with the scanned start code, set the standard syntax unit as the image block header of the image block, and set the image block header as the decoding start position; The target encoded bitstream is decoded based on the decoding start position to obtain the corresponding image block header and image block data.

8. An image coding apparatus characterized by comprising: include: The main image header creation module is used to acquire the image to be encoded, divide the image to be encoded into several image blocks, and generate the main image header of the image to be encoded; the main image header carries several image-level control information. The target encoded bitstream synthesis module is used to construct redundant image headers based on the main image header, and to configure a first start code and a second start code for the redundant image headers and the image block headers of each image block respectively, and to synthesize the main image header, each of the redundant image headers, each of the image block headers, the image block data corresponding to each of the image blocks and the end syntax of each of the image blocks into a target encoded bitstream; the first start code is a start code that represents the type of image header; The second start code is a start code that represents a non-image header type; The encoding stream parsing module is used to decode the target encoding stream, and to decode the target encoding stream based on the parsed image-level control information. When the parsing result indicates that the end syntax of the current image block has been parsed, the third start code of the next image block is scanned. The current redundant image header determination module is used to set the standard syntax unit connected to the third start code as the current redundant image header when the third start code is a start code that represents the image header type, and continue scanning backward until the scanned start code is a start code that represents a non-image header type. The encoding stream decoding module is used to set the standard syntax unit connected with the scanned start code as the image block header of the image block, so as to decode the target encoding stream starting from the image block header.

9. An electronic device, comprising: include: Memory, used to store computer programs; A processor for executing the computer program to implement the image encoding / decoding method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the image encoding / decoding method as described in any one of claims 1 to 7.