CN111699687A - Encoding method, encoder and encoding system - Google Patents
Encoding method, encoder and encoding system Download PDFInfo
- Publication number
- CN111699687A CN111699687A CN201980009151.4A CN201980009151A CN111699687A CN 111699687 A CN111699687 A CN 111699687A CN 201980009151 A CN201980009151 A CN 201980009151A CN 111699687 A CN111699687 A CN 111699687A
- Authority
- CN
- China
- Prior art keywords
- coded
- block
- information
- zbp
- node
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/136—Incoming video signal characteristics or properties
- H04N19/14—Coding unit complexity, e.g. amount of activity or edge presence estimation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/146—Data rate or code amount at the encoder output
- H04N19/147—Data rate or code amount at the encoder output according to rate distortion criteria
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/63—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using sub-band based transform, e.g. wavelets
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/91—Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/96—Tree coding, e.g. quad-tree coding
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
An encoding method, an encoder and an encoding system are provided. The encoder includes: acquiring zero bit plane ZBP information or contained information of each to-be-coded block in a to-be-coded block set; and constructing an identification tree according to the ZBP information or contained information of each block to be coded, and coding the label tree in parallel.
Description
Copyright declaration
The disclosure of this patent document contains material which is subject to copyright protection. The copyright is owned by the copyright owner. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the patent and trademark office official records and records.
Technical Field
The present application relates to the field of image decoding, and more particularly, to an encoding method, an encoder, and an encoding system.
Background
Joint Photographic Experts Group (JPEG), JPEG 2000, are commonly used image coding standards.
JPEG 2000 employs wavelet transform, and entropy encoding is performed based on an optimally truncated embedded code block (EBCOT), has a higher compression ratio than JPEG, and supports progressive download and display.
the tagtree coding is used for realizing a code stream organization link in the JPEG 2000 standard, but the traditional tagtree coding process is to determine the coding value of each code block firstly and then combine the coding values together to form a final coding value, and the realization mode has the advantages of low operation speed and high time complexity and is generally O (n)2) And n is the total number of code blocks, which becomes a bottleneck of system performance.
Disclosure of Invention
The application provides an encoding method, an encoder and an encoding system, which can reduce the time complexity of tagtree encoding, thereby improving the system performance.
In a first aspect, an encoding method is provided, including: acquiring zero bit plane ZBP information or contained information of each to-be-coded block in a to-be-coded block set; and constructing an identification tree according to the ZBP information or contained information of each block to be coded, and coding the label tree in parallel.
In a second aspect, there is provided an encoder comprising:
the reading circuit is used for acquiring zero bit plane ZBP information or contained information of each to-be-coded block in the to-be-coded block set;
the tree building circuit is used for building an identification tree according to the ZBP information or contained information of each block to be coded;
and the coding circuit is used for coding the label tree in parallel when the tree building circuit constructs the mark tree.
In a third aspect, an encoding system is provided, including: the encoder of the second aspect.
In a fourth aspect, there is provided a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the method of the first aspect.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the first aspect.
According to the technical scheme of the embodiment of the application, the mark tree is constructed according to the ZBP information or the contained information of each to-be-coded block in the to-be-coded block set, and the to-be-coded blocks in the mark tree are coded in parallel, so that the coding efficiency is favorably improved, and the system performance is improved.
Drawings
Fig. 1 is a coding framework diagram of JPEG 2000.
Fig. 2 is a schematic diagram of a packet structure obtained by encoding.
Fig. 3 is a schematic structural diagram of an encoder according to an embodiment of the present application.
Fig. 4 is a schematic diagram of the wavelet transform of an image block.
Fig. 5 is a schematic diagram of an exemplary structure of a tag tree according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a tree building circuit according to an embodiment of the present application.
FIG. 7 is a schematic diagram of a tag tree.
Fig. 8 is a schematic diagram of a structure of a first encoding circuit according to an embodiment of the present application.
Fig. 9 is a schematic diagram of a third encoding circuit according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of a decoder according to an embodiment of the present application.
Fig. 11 is a schematic diagram of the reconstruction process of tagtree.
Fig. 12 is a schematic flow chart of an encoding method provided in an embodiment of the present application.
Detailed Description
The method and the device can be applied to the fields of image coding and decoding, video coding and decoding, hardware video coding and decoding, special circuit video coding and decoding and real-time video coding and decoding.
The encoder provided by the application can be used for lossy compression (lossy compression) and can also be used for lossless compression (lossless compression) of the image. The lossless compression may be visual lossless compression (visual lossless compression) or mathematical lossless compression (mathematical lossless compression).
For ease of understanding, the coding framework of JPEG 2000 is briefly introduced.
As shown in fig. 1, the coding framework of JPEG 2000 may include a pre-processing module 12, a transform module 14, a quantization module 16, an EBCOT module 18.
The preprocessing module 12 may include a slice processing module 120, a component transformation (component transformation) module 122, and a direct current level shift (direct current level shift) module 124.
The segmentation processing module 120 is configured to segment an original image to obtain a certain number of image blocks (tiles) or image segments, where each image block may be encoded as an independent source image. Alternatively, the image blocks may be rectangular blocks with equal size and without overlapping, for example, 512 × 512 (unit is pixel), and the size of the image block is not particularly limited in the embodiments of the present application.
The component transform module 122 may perform some transformation on the components of the image to reduce the correlation between the components. For example, the component transformation module 122 may convert the individual components of the image from a current color domain to another color domain.
The component transform module 122 may support multiple color transform modes, and thus, the component transform module 122 may also be sometimes referred to as a multi-Mode Color Transform (MCT) module. For example, the component transform module 122 may support an Irreversible Color Transform (ICT) or a Reversible Color Transform (RCT). It should be noted that the component transformation module 122 is optional, and in the actual encoding process, the subsequent processing may be directly performed without performing component transformation on the image.
The dc level shift module 124 may be used to center shift the component values such that the component values are symmetrically distributed about 0 for subsequent transform operations.
The transform module 14 transforms each image block of the image by wavelet transform to obtain wavelet coefficients of sub-bands.
The quantization module 16 may be configured to quantize the wavelet coefficients of the sub-band to obtain the quantized wavelet coefficients of the sub-band.
The EBCOT module 18 is an entropy coding module of JEPG 2000, and belongs to a core module of JEPG 2000.
EBCOT module 18 may include a tier-1 encoding module 182 and a tier-2 encoding module 184. the tier-1 encoding module 182 may be used to perform tier-1 encoding on code blocks (subbands may be further partitioned into separate code blocks). the tier-1 coding may include bit-plane coding and arithmetic coding. the tier-2 encoding module 184 is mainly responsible for organizing the code stream, for example, the code stream of the code block may be truncated according to a specific code rate. the tier-2 encoding module 184 mainly uses a post-compression rate-distortion optimization (PCRD) algorithm to perform rate control.
For example, the tier-2 encoding module 184 may calculate a rate-distortion slope (slope) according to a rate (rate) and a distortion (distortion) of each codestream (i.e., codestream (pass) of each codeblock) output by the tier-1 encoding module 184. The rate-distortion slope can be used to evaluate the contribution of the code stream of the current code block in the whole image block. The rate-distortion slope can be used for subsequent code stream organization, such as layering and truncation of code streams.
Further, the code stream of the code block may be processed according to the target code rate and the rate-distortion slope. For example, the code stream of the code block may be truncated according to the target code rate and the rate-distortion slope. Further, the code stream of the plurality of code blocks may be reorganized, layered, and the like.
The code stream of the code blocks in the image blocks may form a group of data packets, each data packet may include a packet header (packet header) and an optimally truncated bitstream, information including code block information (code block information), Zero Bit Plane (ZBP) information, the number of encoding channels, truncated length information of the included code blocks, and the like may be encoded in the packet header of the data packet according to the order of the code blocks to form the packet header information, and the packet header is followed by the packet body including the bitstream intercepted by the code blocks.
The packet structure obtained by encoding is shown in FIG. 2, where Hb,nHeader information, H, representing the nth code block of subband bb,nWherein I is the code value of code block containing information corresponding to LYR code described below, N is the code value of ZBP information corresponding to ZBP code described below, P is the code value of code channel number, L is the code value of truncated length L of code block contained, zero indicates whether the data packet is a null data packet, B isb,nBit stream representing the nth code block of subband b.
With the PCRD algorithm for rate control, the bit stream of the code block may be truncated to different quality layers, that is, the bit stream of each code block may contribute to one or more layers of the output code stream, and the quality layer where the code block is truncated for the first time may be used as the inclusion information of the code block, for example, if cb0, cb1, cb2, cb3, cb5 appear for the first time at quality layer 0 and cb4 appear for the first time at quality layer1, the inclusion information of cb0 to cb5 are 000010, respectively, and if the number of quality layers is L and the inclusion information is L, it indicates that the code block is not included in the compressed code stream. Usually, information important to a picture (e.g., code blocks with higher resolution levels) is placed at lower layers in a quality layer, and each subsequent layer can improve the picture quality on the basis of the previous layer, and thus, in the case of lossless compression, all layers should be decoded, and if only the previous layers are decoded, lossy compression at a certain compression ratio can be achieved.
For the uncompressed codeblock coefficients after wavelet transform, bit-planes are formed, the maximum number of bit-planes is M, not all the bit-planes are coded in actual coding, and if ZBP information is N, the bit-planes of actual coding are M-N, where the ZBP information can be used to indicate the position of a zero bit-plane, the specific position of the zero bit-plane usually corresponds to a codeblock, that is, each codeblock corresponds to one ZBP information, and the ZBP information of the codeblock is coded when the codeblock is first included in the quality hierarchy.
the tagree encoder is a typical encoder of a tier-2 encoding module, and encodes the contained information and the ZBP information of a code block by adopting a tagree algorithm, and the specific process is as follows:
firstly, grouping the blocks to be coded according to a certain number, wherein each group points to a node at a higher level, and then continuously grouping the nodes at the higher level until only one node is left, wherein the node is called a root node, so that nodes at different levels form a tree which can be called a mark tree, namely tagtree.
Then, each node on the tree is coded, specifically, the root node is coded first, and then the coding is performed downwards step by step until the leaf node at the lowest layer. That is, when encoding, it is necessary to calculate the code value of each code block, and then combine the code values of each code block to obtain the final code value, and the encoding time complexity is high, and is usually O (n)2) Where n is the number of blocks to be encoded, for example, 3000 to 4000 clock cycles (cycles) are required to encode one component including 64 code blocks, power consumption is large, and consumption of logic resources is also large.
In view of this, the embodiment of the present application provides an encoder, which can implement efficient tagtree encoding, and specifically can reduce the time complexity of tagtree encoding to o (n), for example, only 60 to 70 cycles are required for encoding a component including 64 code blocks, so that power consumption and consumption of logic resources can be reduced.
The technical solution of the present application will be described below with reference to fig. 3 to 9.
Fig. 3 is a schematic structural diagram of an encoder 20 according to an embodiment of the present application. As shown in fig. 3, the encoder 20 may include: a tree building circuit 22, a first encoding circuit 24, and a second encoding circuit 26.
The tree construction circuit 22 is configured to construct a corresponding flag tree (tagtree) according to ZBP information or inclusion information of a block to be encoded. It can be understood that the blocks to be coded form leaf nodes of the flag tree, and the tree building process is a process of generating parent nodes and ancestor nodes of the leaf nodes.
It should be understood that, in the embodiment of the present application, a block to be coded may be referred to as a leaf node, or a level 0 node, a first-level node, etc.; the higher level node of the block to be coded can be called as a father node, a level 1 node, or a second level node and a first level node; the root node of the tree may be referred to as an ancestor node or a level 2 node, or a third level node, a second level high level node.
In some embodiments, the tree building circuit 22 may obtain the ZBP information or the containing information of the block to be encoded from an external memory, in other embodiments, the tree building circuit 22 may also obtain the ZBP information or the containing information of the block to be encoded from a register output by a previous processing circuit, for example, the tree building circuit 22 may obtain the ZBP information or the containing information of the block to be encoded from an external memory or a register output by a previous processing circuit through a reading circuit, and the obtaining manner of the information of the block to be encoded is not limited in the embodiments of the present application.
It should be noted that the block to be encoded may be a code block in a subband of the image block, that is, the encoder according to the embodiment of the present application may perform encoding in units of subbands, and after one subband is encoded, another subband may be encoded until the whole image to be encoded is encoded.
Hereinafter, referring to fig. 3 to 5, a specific tree building process will be described by taking the example of building a tree for ZBP information of 64 code blocks (including cb 0-cb 63).
It should be understood that the arrangement format of the code blocks in fig. 4 and the structure of the tagtree in fig. 5 are only examples, and should not constitute any limitation in the embodiment of the present application, and as the coding specification is adjusted and developed, the number of layers of the tagtree may also be changed, for example, the layers may be 4, in this case, the root node is a level 3 node, the structure of the tagtree may also be adjusted, and the tagtree may also include more cbs, or fewer cbs, and the like, but the coding principle is similar, and is not described herein again.
First, acquiring information of all leaf nodes of tagree, that is, ZBP information of the 64 code blocks, where the 64 code blocks constitute leaf nodes of tagree, and according to resolution levels of the 64 code blocks, as shown in fig. 4, 10 trees can be constructed, where cbs of the same resolution level are used to construct the same tree, for example, cbs 16-31 correspond to the same tree, and cbs 48-63 correspond to the same tree.
Specifically, cb 0-cb 3 have the highest resolution level, and do not need to generate corresponding father nodes, each cb independently constructs a tree, which is marked as a first type of flag tree, and the flag tree only has layer 0 nodes and does not have layer1 nodes and layer2 nodes.
Constructing a corresponding tree based on cb 4-cb 7, cb 8-cb 11 and cb 12-cb 15, wherein the tree has layer1 nodes and no layer2 nodes, and is marked as a second type of label tree. In the second type of flag tree, the value of the layer1 node may be the minimum value of a group of layer 0 nodes, for example, the value of the parent node of cb 4-cb 7 may be the minimum value of LBP information of cb 4-cb 7.
Constructing a corresponding label tree based on cb 16-cb 31, cb 32-cb 47 and cb 48-cb 63, wherein the group of label trees comprises layer1 nodes and layer2 nodes and are marked as a third type of label trees. In the third type of flag tree, layer1 nodes can be generated by taking the minimum value from a group of layer 0 nodes, and layer2 nodes are generated by taking the minimum value from a group of layer1 nodes. In the third type flag tree, a group of layer 0 nodes and layer1 nodes thereof form a sub-tree in the tree, that is, the third type tree may include four sub-trees, which are respectively denoted as a first sub-tree, a second sub-tree, a third sub-tree, and a fourth sub-tree.
For the third type of flag trees corresponding to cb 16-cb 31, the minimum values of cb16, cb17, cb20 and cb21 can be taken to generate the values of layer1 nodes corresponding to the four layer 0 nodes, the values of layer1 nodes corresponding to other three groups of layer 0 nodes can be determined in the same manner, and then the minimum value is taken according to the group of layer1 nodes to obtain the value of layer2 node of the tree.
Optionally, in an embodiment of the present application, the tree building circuit 22 may include a plurality of registers for caching ZBP information of leaf nodes, parent nodes and ancestor nodes of the plurality of blocks to be encoded.
Optionally, in an embodiment of the present application, the tree building circuit 22 may include a plurality of first-stage comparators, which are configured to determine values of corresponding parent nodes according to values of a plurality of leaf nodes, and a plurality of second-stage comparators, which are configured to determine values of root nodes according to values of a plurality of parent nodes.
Taking building a tree for 63 code blocks as an example, the tree building circuit 22 may include 15 first-stage comparators (denoted as Comp1_0 to Comp1_14) for comparing values of each group of leaf nodes of the 60 leaf nodes of the cb4 to cb63 to determine a value of a corresponding parent node, and 3 second-stage comparators (denoted as Comp2_0 to Comp2_2) for determining a value of a corresponding root node according to values of the group of parent nodes.
For example, as shown in fig. 6, Comp1_0 may compare cb4 to cb7 to take the minimum value to obtain fa0, and store fa0 in a register corresponding to fa0, Comp1_14 may compare cb58, cb59, cb62 and cb63 to take the minimum value to obtain ZBP information of fa14, and store ZBP information of fa14 in a register corresponding to fa14, Comp2_0 may compare ZBP information of fa3 to fa6 to take the minimum value to obtain ZBP information of fafa0, and store ZBP information of fafa0 in a register corresponding to fafa0, where faX denotes a parent node X, and fafa X denotes an ancestor node X.
Therefore, two steps are needed for building a tree, wherein the first step generates a layer1 node of a leaf node, and the second step generates a layer2 node of the leaf node, wherein the first step can be realized by 15 first-stage comparators, and the second step can be realized by 3 second-stage comparators.
After the tree building is completed, the first encoding circuit 24 may determine the encoding reference information of each to-be-encoded block according to the ZBP information of each to-be-encoded block in the flag tree, where the encoding reference information of each to-be-encoded block may be used to indicate a relationship between the ZBP information of the to-be-encoded block, the ZBP information of a parent node of the to-be-encoded block (if the to-be-encoded block has a parent node), and the ZBP information of an ancestor node of the to-be-encoded block (if the to-be-encoded block has a root node).
Optionally, in an embodiment of the present application, the first encoding circuit 24 is specifically configured to:
and determining the coding reference information of each block to be coded according to the ZBP information of each block to be coded in the mark tree and by combining the ZBP information of the father node of the block to be coded and the ZBP information of the ancestor node of the block to be coded.
It should be understood that in some cases, the ZBP information of its parent node may be considered to be zero if the block to be encoded has no parent node, or the ZBP information of its ancestor node may be considered to be zero if the block to be encoded has no ancestor node.
Optionally, in an embodiment of the present application, the first encoding circuit 24 is further configured to:
and determining the coding reference information of each block to be coded according to the ZBP information of each block to be coded, the ZBP information of the father node of the block to be coded and the ZBP information of the ancestor node of the block to be coded in the mark tree and by combining the coding identification information of the father node of the block to be coded and the coding identification information of the ancestor node of the block to be coded.
Wherein the encoding identification information of the parent node can be used to indicate whether the parent node is encoded, and the encoding identification information of the ancestor node is used to indicate whether the ancestor node is encoded.
It should be understood that in some cases, a block to be encoded may have its parent node considered encoded if it does not have it, or may have its ancestor node considered encoded if it does not have it.
It should be understood that, in the embodiment of the present application, a parent node (if any) and an ancestor node (if any) of each block to be encoded may correspond to a register, and are used to indicate whether the parent node or the ancestor node is encoded, that is, the encoding identification information of the parent node and the ancestor node of the block to be encoded may be stored by the register, assuming that the initial value of the encoding identification information is 0, indicating that the corresponding node is not encoded, and when the node is encoded, the encoding identification information corresponding to the node is updated to 1.
Optionally, in some embodiments, the encoding conditions of the parent node of the block to be encoded and the ancestor node of the block to be encoded may include the following conditions:
in case 1, the block to be encoded has no parent node, or the parent node of the block to be encoded has been encoded, and in this case, the encoding identification information of the parent node and the ancestor node of the block to be encoded can both be considered to be 1;
in case 3, the block to be encoded has a parent node, and the parent node of the block to be encoded has not been encoded, and in this case, it can be considered that the encoding identification information of both the parent node and the ancestor node of the block to be encoded is 0.
For case 1, the block to be encoded may be encoded only without encoding its parent node and root node, and the ZBP encoding of the block to be encoded may include the encoded value of the block to be encoded.
For case 2, only the block to be encoded and its parent node may be encoded without encoding its root node, and the ZBP encoding of the block to be encoded may include the encoded values of the block to be encoded and its parent node.
For case 3, the block to be encoded and its parent node and root node need to be encoded, and the ZBP encoding of the block to be encoded may include the encoded values of the block to be encoded and its parent node and root node.
Optionally, in some embodiments of the present application, whether the parent node and the root node of the block to be encoded are encoded may be determined according to an appearance order of the block to be encoded in the tree.
For example, for a first block to be encoded in a second flag tree, if the first block to be encoded appears first in the second flag tree, a parent node of the first block to be encoded is not encoded, the first block to be encoded encodes the parent node of the first block to be encoded at the same time, after the encoding is completed, the parent node of the first block to be encoded is identified as encoded, and when other blocks to be encoded which belong to the same flag tree as the first block to be encoded are encoded, it is determined that the corresponding parent node is encoded, and then the parent node may not be encoded.
For another example, for a second block to be encoded in a third tree, if the second block to be encoded appears first in the third tree, neither a parent node nor an ancestor node of the second block to be encoded is encoded, the second block to be encoded encodes both the parent node and the ancestor node of the first block to be encoded, after the encoding is completed, both the parent node and the ancestor node of the second block to be encoded are identified as encoded, and then, when a third block to be encoded that belongs to the same sub-tree as the second block to be encoded is encoded, only the third block to be encoded may be encoded without encoding the parent node and the root node because the third block to be encoded and the second block to be encoded correspond to the same parent node and ancestor node; or when a fourth to-be-coded block which belongs to the same tree as the second to-be-coded block and belongs to a different sub-tree is coded, because the fourth to-be-coded block and the second to-be-coded block correspond to the same ancestor node but correspond to different father nodes, the ancestor node may not be coded, whether a father node of the fourth to-be-coded block is coded or not may be determined according to coding identification information of the father node of the fourth to-be-coded block, if the fourth to-be-coded block appears in the first sub-tree corresponding to the fourth to-be-coded block, the father node corresponding to the fourth to-be-coded block may be coded, otherwise, the father.
That is to say, in the embodiment of the present application, the parent node and the ancestor node that have been encoded may be marked in the encoding process, so that repeated encoding of the same parent node and ancestor node may be avoided, and the time complexity of tagtree encoding may be reduced.
Optionally, in some embodiments of the present application, the encoding reference information of the block to be encoded may include first reference information (denoted as cnt0), second reference information (denoted as cnt1) and third reference information (denoted as cnt2), where the first reference information is used to indicate a relationship between the block to be encoded and ZBP information of a parent node thereof, the second reference information is used to indicate a relationship between a parent node of the block to be encoded and ZBP information of a parent node of the parent node, and the third reference information is used to indicate ZBP information of a root node of the block to be encoded.
Optionally, in some specific embodiments, the first reference information may be a difference between the ZBP information of the to-be-coded block and the ZBP information of the parent node of the to-be-coded block plus one, that is, cnt0 ═ ZBPcb-ZBPfa+1;
The second reference information is the difference value of the ZBP information of the father node of the block to be coded and the ZBP information of the ancestor node of the block to be coded plus one, namely cnt1 ═ ZBPfa-ZBPfafa+1;
The third reference information is the difference value between the ZBP information of the ancestor node of the block to be coded and 0 plus one, namely cnt2 equals to ZBPfafa-0+1, wherein 0 may be understood as LBP information of the parent node of the ancestor node of the coding node.
Wherein, ZBPfafaZBP information of ancestor nodes of the block to be coded, the ZBPfaZBP information of a parent node of the block to be coded, the ZBPcbAnd obtaining the ZBP information of the block to be coded.
In particular, if the block to be coded has no parent node, the ZBP information ZBP of the parent node of the block to be coded can be taken when calculating the first reference informationfaIs zero; or, if the parent node of the block to be encoded does not have the parent node, when calculating the second reference information, the ZBP information ZBP of the ancestor node of the block to be encoded can be takenfafaIs zero.
Taking a simple tagtree structure shown in fig. 7 as an example, the determination manner of the first reference information, the second reference information and the third reference information in the foregoing three cases will be described.
For the foregoing case 1: ready to be wovenCode blocks have no parent or the parent of the block to be coded is coded, e.g., cb0, cb17, and cb21, then cnt0 ═ ZBPcb-ZBPfa+1,cnt1=0,cnt2=0。
For example, for cb0, its corresponding cnt0 ═ 2-0+1 ═ 3, cnt1 ═ 0, and cnt2 ═ 0.
For example, cb17 has cnt0 ═ 3-3+1 ═ 3, cnt1 ═ 0, and cnt2 ═ 0.
For the foregoing case 2: if the block to be encoded has a parent node and the parent node of the block to be encoded has no parent node, or if the parent node of the block to be encoded is encoded, for example, cb4 and cb20, cnt0 is ZBPcb-ZBPfa+1,cnt1=ZBPfa-ZBPfafa+1,cnt2=0。
For example, for cb4, its corresponding cnt0 ═ 2-2+1 ═ 1, cnt1 ═ 2-0+1 ═ 3, and cnt2 ═ 0.
For example, cb20 has a cnt0 ═ 2-1+1 ═ 2, a cnt1 ═ 1-1+1 ═ 1, and a cnt2 ═ 0.
For the foregoing case 3: if the block to be coded has a parent node and the parent node of the block to be coded has not been coded, e.g., cb16, cnt0 ═ ZBPcb-ZBPfa+1,cnt1=ZBPfa-ZBPfafa+1,cnt2=ZBPfafa-0+1。
For example, for cb16, its corresponding cnt0 ═ 4-3+1 ═ 2, cnt1 ═ 3-1+1 ═ 3, and cnt2 ═ 1-0+1 ═ 2.
Alternatively, in an embodiment of the present application, as shown in fig. 8, the first encoding circuit 24 may include a data selector (MUX) and a calculating unit, wherein the calculating unit is configured to calculate the first reference information, the second reference information and the third reference information of each block to be encoded, and the MUX is configured to gate the parent node and the root node corresponding to the block to be encoded to obtain the ZBP information of the corresponding parent node and the root node when calculating the first reference information, the second reference information and the third reference information of the block to be encoded.
Optionally, in an embodiment of the present application, the first encoding circuit 24 may further include a plurality of registers, configured to store the first reference information, the second reference information, and the third reference information of each block to be encoded in corresponding registers after determining the first reference information, the second reference information, and the third reference information of each block to be encoded, so that the second encoding circuit 26 obtains the first reference information, the second reference information, and the third reference information of the block to be encoded from the registers, and determines the ZBP encoding of the block to be encoded according to the first reference information, the second reference information, and the third reference information.
Alternatively, in some embodiments, the second encoding circuit 26 may splice the three encoded values of the block to be encoded to obtain the ZBP code of the block to be encoded, for example, splice according to the order of the third reference information, the second reference information and the first reference information to obtain the ZBP code of the block to be encoded, or splice according to the order of the first reference information, the second reference information and the third reference information to obtain the ZBP code of the block to be encoded, which only needs to adjust the corresponding decoding algorithm.
Optionally, if the second reference information or the third reference information is zero, that is, it is not necessary to encode the parent node or the ancestor node, in this case, the second reference information or the third reference information is empty (NULL) in the ZBP coding, that is, it does not occupy bits, that is, the ZBP coding of the block to be encoded does not include the encoded value of the parent node or the ancestor node of the block to be encoded, so that the occupation of the storage space can be reduced.
Alternatively, in some embodiments of the present application, the second encoding circuit 26 may convert the first reference information, the second reference information and the third reference information into a specific binary code, and then perform concatenation of binary codes to obtain the ZBP code of the block to be encoded.
In one implementation, the first reference information and the converted binary code have the following relationship:
the length of the binary code is the value of the first reference information, the lowest bit of the binary code is 1, and the other bits are zero. That is, the number of zeros in the binary code is the difference between the ZBP information of the block to be encoded and the parent node.
For example, if the first reference information is 3, the converted binary code is 001, or if the first reference information is 2, the converted binary code is 01, or if the first reference information is 1, the converted binary code is 1.
The specific implementation of converting the second reference information and the third reference information into the binary code is similar, and is not described herein again.
The number of zeros in the binary code corresponding to the first reference information may represent a difference between the leaf node of the to-be-coded block and the ZBP information of the parent node of the to-be-coded block, the number of zeros in the binary code corresponding to the second reference information may represent a difference between the ZBP information of the parent node of the to-be-coded block and the ZBP information of the parent node, and the number of zeros in the binary code corresponding to the third reference information represents the ZBP information of the ancestor node of the to-be-coded block.
As can be seen from the determination of the first reference information, the second reference information, and the third reference information, the ZBP information of the parent node and the ancestor node follows the code block appearing for the first time in the marker tree, that is, the ZBP code of the code block appearing for the first time in the marker tree includes the ZBP information of the parent node and the ancestor node.
Following the above example, according to cnt0 ═ 3, cnt1 ═ 0, and cnt2 ═ 0 of cb0, corresponding binary codes 001, NULL, and NULL, respectively, can be obtained, and then the ZBP code of cb0 can be obtained as 001 by concatenation.
From cnt0 ═ 2, cnt1 ═ 1, and cnt2 ═ 0 of cb20, corresponding binary codes 01, 1, and NULL, respectively, can be obtained, and then the ZBP code of cb20 can be obtained by concatenation as 011.
From cnt0 ═ 2, cnt1 ═ 3, and cnt2 ═ 2 of cb16, corresponding binary codes 01, 001, and 01, respectively, can be obtained, and then the ZBP code of cb16 can be obtained by concatenation as 0100101.
In summary, according to the encoder of the embodiment of the present application, when each block to be encoded is encoded, only the parent node and the ancestor node that are not encoded need to be encoded, and the parent node and the ancestor node of each block to be encoded do not need to be encoded, so that the time complexity of encoding can be reduced, and the consumption of logic resources can be reduced.
Optionally, in this embodiment of the present application, the second encoding circuit 26 may include:
the code value combination unit is used for respectively converting the first reference information, the second reference information and the third reference information of the block to be coded into a third binary code, and splicing the code words of the second binary code and the first binary code to obtain a ZBP code of the block to be coded;
a plurality of registers, configured to buffer the ZBP code of each block to be coded for subsequent processing, for example, the third coding circuit 28 separates the ZBP code of the block to be coded to obtain a Layer (LYR) code of the block to be coded in each quality hierarchy.
As can be seen from the above description, a codeblock may occur in one or more layers of quality layers, and the ZBP coding of the to-be-coded block may include the coding values of the to-be-coded block in the respective quality layers, so that, by separating the ZBP coding of the to-be-coded block, the LYR coding of the to-be-coded block in the respective quality layers may be determined.
Optionally, in some embodiments of the present application, the encoder 20 may further include:
and a third encoding circuit 28, configured to determine, according to the ZBP encoding of the block to be encoded, the LYR encoding of the block to be encoded in each quality hierarchy.
If the number of the quality layers is K, the to-be-coded block corresponds to one layer information at each quality layer, where the layer information is used to indicate whether the to-be-coded block appears in the quality layer, for example, if K equals 8, the to-be-coded block corresponds to 8 layer information, each layer information corresponds to one LYR code, and the LYR code may be used to determine the first appearing quality layer of the to-be-coded block, that is, first layer information.
Optionally, in some embodiments of the present application, the third encoding circuit 28 is specifically configured to:
if the current quality hierarchy is i, the current ZBP code is X, starting from the highest bit of the current ZBP code, searching the position of the first zero in the current ZBP code, using the first zero and the bit before the first zero as LYR code of the current quality hierarchy i, then removing the first zero and the bit before the first zero in the current ZBP code, using the ZBP code after shifting as ZBP code of the next quality hierarchy, then adding 1 to the quality hierarchy, and circularly executing the processes.
Alternatively, in some embodiments, if the current ZBP coding is all 1's at a certain quality level, the ZBP coding may be treated as the LYR coding of the current quality level.
Alternatively, in some embodiments, as shown in fig. 9, the third encoding circuit 28 may include:
the K processing units comprise a processing unit 0-a processing unit K-1 and are used for determining LYR codes of the blocks to be coded in each quality layer of the K quality layers;
and the K registers comprise registers 0-K-1 and are used for caching the processing results output by the K processing units, and the processing results can comprise LYR codes of the blocks to be coded in the quality hierarchy and the shifted ZBP codes.
With reference to fig. 9, the ZBP coding of cb16 is 0100101, and there are 5 quality layers, which illustrates the process of determining the LYR coding of cb16 in each quality layer:
first, processing element 0 first retrieves the ZBP encoding of cb16 from the register of second encoding circuit 26;
secondly, the position of the first zero in the ZBP code 0100101 is found, and the first zero and the previous bits are used as the LYR code of quality level 0, that is, cb16 codes 0 in the LYR of quality level 0;
then, the first zero and the bit before the first zero are shifted, and the shifted ZBP code is 100101.
Further, the LYR code 0 and the shifted ZBP code 100101 are cached in the register 0, and optionally, the register 0 may include two registers for caching the LYR code 0 and the shifted ZBP code 100101;
firstly, the processing unit 1 acquires the current ZBP code from the register 0 as 100101;
secondly, find 100101 the position of the first zero, and encode the first zero and the previous bit as the quality level 1 LYR, i.e., cb16 encodes 10 at the quality level 1 LYR;
the first zero, and the previous bit, is then shifted out, resulting in 0101 for the shifted ZBP code.
Further, the LYR code 10 and the updated ZBP code 0101 are stored in the register 1 and cached in the register 1, and similarly, the register 1 may also include two registers for caching the LYR code of the quality hierarchy and the shifted ZBP code, respectively;
firstly, the processing unit 2 acquires the current ZBP code from the register 1 as 0101;
secondly, the position of the first zero in 0101 is found, and the first zero and the previous bit are both coded as the LYR of quality level 2, that is, cb16 is coded as 0 in the LYR of quality level 2;
the first zero, and the previous bit, is then shifted away, resulting in an updated ZBP encoding of 101.
Further, the LYR code 0 and the updated ZBP code 101 are stored in the register 2, and similarly, the register 2 may also include two registers for caching the LYR code and the shifted ZBP code of the quality hierarchy;
firstly, the processing unit 3 acquires the current ZBP code from the register 2 as 101;
secondly, the position of the first zero in 101 is found, and the first zero and the previous bit are used as the LYR code of quality level 3, that is, cb16 is coded as 10 in the LYR code of quality level 3;
the first zero, and the previous bit, is then shifted away, resulting in an updated ZBP code of 1.
Further, the LYR code 10 and the updated ZBP code 1 are stored in the register 3, and similarly, the register 3 may also include two registers for caching the LYR code and the shifted ZBP code of the quality hierarchy, respectively;
firstly, the processing unit 4 acquires the current ZBP code from the register 3 as 1;
second, the processing unit 4 determines that cb16 has the current ZBP encoding of all 1's, takes the current ZBP encoding as the encoding value of the current quality level 4, i.e., cb16 has the LYR encoding of 1 at quality level 4, and further buffers the LYR encoding of 1 in the register 4.
It should be noted that, for the LYR encoding of the first layer (first layer) of the code block, if the bit 0 of the LYR encoding is 1, the LYR encoding of the code block in the subsequent other quality layers may not be determined.
As can be seen from the above example, the first layer of cb16 is quality level 1, i.e., cb16 occurs at the first layer of quality level 1 and its LYR code at that layer is 10, where bit 0 indicates that cb16 contains information in the next quality level, the bit takes 1 to indicate that cb16 is contained in the next quality level, the bit takes 0 to indicate that cb16 is not contained in the next quality level, and when the bit takes 1, it may not be determined to continue to determine the LYR codes of cb in other levels.
Therefore, the third encoding circuit can perform parallel processing of ZBP encoding for a plurality of code blocks by a plurality of processing units and a plurality of registers, and can reduce the time complexity of tagtree encoding.
It should be understood that, in this embodiment of the present application, the number of the processing units included in the third encoding circuit may be determined according to the total number K of quality layers, for example, if K is 8, the third encoding circuit may include 8 processing units, or the third encoding circuit may also include another number of processing units, for example, 2 to 7, in which case, a certain degree of parallel processing can also be achieved, which is not limited in this embodiment of the present application.
To sum up, the encoding process of the embodiment of the present application mainly includes a tree building process, a first encoding process, a second encoding process, and a third encoding process, where the tree building process may build a corresponding flag tree according to a plurality of code blocks to be encoded, that is, information of a parent node and an ancestor node of a block to be encoded is determined, the first encoding process is used to determine first reference information, second reference information, and third reference information of the block to be encoded, the second encoding process is used to determine ZBP encoding of the block to be encoded according to the first reference information, the second reference information, and the third reference information of the block to be encoded, and the third encoding process is used to determine LYR encoding of the block to be encoded in each quality hierarchy according to the ZBP encoding of the block to be encoded.
In the embodiment of the present application, the encoding process may adopt a pipeline to perform operations, so as to improve the utilization rate of logic resources, and reduce the time consumption of encoding, for example, a tree building circuit, a first encoding circuit, a second encoding circuit, and a third encoding circuit are used to perform encoding processing on blocks to be encoded in parallel, for example, values of parent nodes of cb0 to cb3 do not need to be calculated, so that ZBP encodings of cb0 to cb3 may be generated in parallel while layer1 nodes and layer2 nodes of cb4 to cb63 are built, and the encoding efficiency may be improved. For example, the code blocks of a plurality of subbands are processed in parallel by the above circuit.
Optionally, in some embodiments of the present application, the encoder 20 may further include at least one of:
the transformation circuit is used for performing wavelet transformation on an image block to be coded;
the quantization circuit is used for quantizing the wavelet coefficients of the image block;
and the tier-1 coding circuit is used for carrying out tier-1 coding on the code blocks of the image blocks to obtain code streams of the code blocks.
In the above, the code procedure of the code block ZBP information and the inclusion information is explained with reference to fig. 3 to 9. Optionally, in this embodiment of the application, the encoder 20 may further encode information such as the number of encoding channels of the code block and the truncation length of the code block included in the code block, and a specific encoding manner may adopt an existing encoding manner, which is not described herein again.
After the encoding is completed, the ZBP encoding of the code block is stored in the header of the data packet corresponding to the quality layer where the code block appears for the first time, and the LYR encoding of each layer of the code block is stored in the data packet corresponding to the quality layer, where the specific storage sequence is shown in fig. 2.
That is, the ZBP information of the codeblock is encoded when the codeblock is included for the first time, and the ZBP encoding of the codeblock is not included in the other quality hierarchies where the codeblock appears, so that the ZBP encoding of the codeblock needs to first determine the quality hierarchy where the codeblock appears for the first time, i.e., the first layer information.
The operation of the decoder according to an embodiment of the present application is described below with reference to fig. 10 to 12.
Fig. 10 is a schematic structural diagram of a decoder according to an embodiment of the present application, and as shown in fig. 10, the decoder 80 may include:
a first layer parsing circuit 82, configured to determine first layer information of the code block to be decoded, i.e. in which quality layer the code block to be decoded first appears, according to the LYR encoding of the code block, i.e. to parse I in the packet header shown in fig. 2.
A ZBP parsing circuit 83, configured to parse the ZBP code of the code block to be decoded in the first layer of the code block to be decoded, and determine ZBP information of the code block to be decoded, that is, parse N in the packet header shown in fig. 2.
Optionally, in this embodiment of the present application, the encoder 80 may further include:
the code stream reading circuit is configured to read code stream data to be decoded, and for example, may read the code stream to be decoded from an external memory (e.g., a memory) by using an advanced eXtensible interface (AXI).
It should be understood that after reading the bitstream data to be decoded, in the embodiment of the present application, the decoder 80 may also perform an alignment process on the bitstream data to facilitate the subsequent processing of the parsing circuit.
Optionally, in some embodiments, the decoder 80 may further include at least one circuit of:
a channel number parsing circuit 84, configured to decode the number of coding channels of the code block to be decoded, that is, parse P in the packet header shown in fig. 2;
a truncation length parsing circuit 85 configured to parse the truncation length of the code block to be decoded, that is, parse L in the packet header shown in fig. 2;
a packet parsing circuit 86 for parsing the bit stream of the code block to be decoded, i.e. parsing B in the packet shown in FIG. 2b,n;
And the bag body extracting circuit 87 is used for reorganizing the decoded data analyzed by the bag body analyzing circuit 86 and storing the organized data in a memory so as to facilitate a later-stage circuit to further process the data.
Optionally, in some embodiments of the present application, the decoder 80 may further include at least one of:
an inverse quantization circuit for inverse-quantizing the data output from the packet extraction circuit 87;
and an inverse transformation circuit for performing inverse transformation on the data output by the inverse quantization circuit. The inverse transform may be an inverse discrete wavelet transform.
And an output circuit for writing the data output from the inverse transform circuit into an external memory. For example, data output from the inverse transform circuit may be written to an external memory through the AXI.
Optionally, in some embodiments of the present application, the decoder 80 may further include:
the control circuit 81 is configured to control an operating state of at least one of the first layer analyzing circuit 82, the LBP analyzing circuit 83, and the channel number analyzing circuit 84, the cut length analyzing circuit 85, the bag body analyzing circuit 86, and the bag body extracting circuit 87.
The control circuit 81 may be configured to control and activate a corresponding circuit to operate according to the analyzed information of the code stream.
Specifically, the control circuit 81 first determines whether the data packet is an empty packet according to zero in the packet header of the data packet, and waits for a new code stream if the data packet is an empty packet, or activates the first layer analysis circuit 82 to perform first layer analysis, that is, determines whether the code block is in the current quality hierarchy. If the code block is in the current quality hierarchy, activating a ZBP parsing circuit 83 to perform ZBP decoding on the code block, after the ZBP decoding is completed, further activating a channel number parsing circuit 84 and a cut-out length parsing circuit 85 to decode the number of coding channels of the code block and the cut-out length of the code block included in the code block, and performing the above processes in a circulating manner, if the packet header of the code block in the current data packet is completely parsed, activating a packet parsing circuit 86 to parse the packet in the data packet to obtain the bit stream information included in the code block, and then activating a packet extraction circuit 87 to recombine the parsed bit stream and buffer the reconstructed bit stream into a memory.
The operation principle of the first layer analyzing circuit 82 and the ZBP analyzing circuit 83 will be described in detail below with reference to fig. 5.
As can be seen from the foregoing description, the third encoding circuit of the encoder may separate the ZBP codes of the codeblocks, and obtain the LYR codes of the codeblocks at each quality layer, where the LYR codes of the codeblocks are finally included in the headers of the packets corresponding to the quality layers, so that by parsing the header of a packet of a quality layer, it is possible to know the inclusion information of the codeblock in the quality layer, i.e., whether the codeblock is included in the quality layer.
The first layer parsing circuit 82 may parse the LYR encoding of the code block in the current quality tier to determine whether the current quality tier is the first layer of the code block.
Optionally, in some embodiments of the present application, the first layer resolving circuit 82 may include:
and the plurality of first layer registers are used for caching the first layer information of each block to be decoded.
For example, cb0 to cb63 correspond to one register for storing first layer information of cb, fa0 to fa14 correspond to one register for storing first layer information of a parent node of cb, and fa0 to fa2 correspond to one register for storing first layer information of an ancestor node of cb, respectively.
Optionally, in this embodiment of the present application, each block to be decoded may further correspond to encoding identification information, which is used to indicate whether the node to be encoded is encoded.
Optionally, in this embodiment of the present application, a parent node or an ancestor node of each block to be decoded may also correspond to encoding identification information, which is used to indicate whether the parent node or the ancestor node of the block to be encoded is encoded.
Optionally, in some embodiments, the encoding identification information of the block to be decoded, the parent node or the ancestor node of the block to be encoded, may be stored in a corresponding register.
For example, a register 0 indicates that the block to be decoded is not encoded, and a register 1 indicates that the block to be decoded is encoded.
In some embodiments, the encoding identification information of a block to be decoded is initially 0, and in the process of decoding according to the sequence of quality hierarchies from low to high, whether a block to be coded is encoded in each quality hierarchy is determined according to the LYR encoding in the data packet of each quality hierarchy in sequence, if the block to be coded appears in a certain quality hierarchy for the first time, the encoding identification information of the block to be coded is updated from 0 to 1, and the quality hierarchy is used as the first layer of the block to be coded and stored in the corresponding first layer register.
Hereinafter, a specific operation principle of the first layer analyzing circuit 82 will be described with reference to fig. 5.
In one case, if the LYR of the code block to be decoded is parsed to 0 when parsing the header of the data packet of a certain quality hierarchy, which indicates that the code block to be decoded does not appear in the quality hierarchy, a certain number of code blocks need to be skipped in this case, that is, it is not necessary to perform first layer parsing on this part of code blocks, and the number of code blocks that need to be skipped may be determined according to the storage sequence of the code blocks in the data packet to be parsed, the arrangement sequence of the code blocks in the flag tree, and the coding identification information of the parent node and the root node of the code block.
For example, if the parent node of the code block is not encoded, it can be considered that other leaf nodes of the parent node in tagtree also do not appear in the quality hierarchy, because if there are other leaf nodes appearing in the quality hierarchy, the parent node must be encoded, in which case the leaf nodes can be skipped.
For another example, if an ancestor node of a code block is not encoded, it may be considered that a leaf node of the ancestor node in tagtree also does not appear in the quality hierarchy, because if other leaf nodes appear in the quality hierarchy, the ancestor node must be encoded, in which case the leaf nodes may be skipped.
As shown in fig. 4 and 5, the code blocks are stored in the code stream in the order of the code block numbers, for example, for cb16 to cb31, the code block order is cb16, cb17, cb18, cb19, cb20, cb21 … cb30, and cb 31; in the flag tree, however, they are not stored in this order, and specifically, in the flag tree, cb16, cb17, cb20 and cb21 are grouped, cb18, cb19, cb22 and cb23 are grouped, cb24, cb25, cb28 and cb29 are grouped, and cb26, cb27, cb30 and cb31 are grouped, that is, the numbers of cbs in each group are not consecutive.
That is, if the parent node of cb16 is not encoded in the packet header, cb17, cb20 and cb21 are not necessarily encoded, and in this case, parsing to cb17, cb20 and cb21 is skipped, and cb16 and cb24 are similar, and cb18 and cb26 are similar.
In the following, the LYR encoding corresponding to any code block of cb 16-cb 31 is analyzed to 0 (denoted as case 1), which illustrates the number of code blocks that need to be skipped, cur _ cb represents the number of the code block to be currently decoded, and add _ cb represents the number of code blocks that need to be skipped, and the following specific cases may be included:
case 1-1: cur _ cb is 16, and its ancestor node is not coded, add _ cb is 16, otherwise, judge whether its father node is coded, if its father node is not coded, add _ cb is 2, otherwise add _ cb is 1;
that is, if cb16 does not appear in the current quality layer and its ancestor node is not coded in the quality layer, it indicates that none of the code blocks in the tree in which cb16 exists appear in the quality layer, in this case, all the code blocks in the tree can be skipped to parse the code blocks in the next tree (i.e., the tree corresponding to cb32 to cb 47), and therefore, the next cb to be decoded is cb 32;
alternatively, if cb16 has not occurred in the current quality layer and ancestor nodes of cb16 have been encoded, indicating that a code block in the tree in which cb16 is located has occurred, which may be a code block in the first sub-tree in the tree or may be code blocks in other sub-trees in the tree, further, it may be determined whether the parent node of cb16 has been encoded, and if the parent node of cb16 has not been encoded, it may be determined that a code block in the first sub-tree has not occurred in the quality hierarchy, and thus the first sub-tree may be skipped, a code block in the second sub-tree may be parsed, i.e., the cb to be decoded is cb18, or if the parent node of cb16 has been encoded, it may be determined that a code block in the first sub-tree has occurred in the quality hierarchy, and further, a next code block in the first sub-tree may be decoded, i.e., the cb to be decoded 17.
Cases 1-2: if cur _ cb is 24 and its parent node is not encoded, add _ cb is 2, otherwise add _ cb is 1;
if the cb24 does not appear in the quality hierarchy and the parent node of the cb24 is not encoded, it may be determined that the code block in the third sub-tree where the cb24 is located does not appear in the quality hierarchy, so that the third sub-tree may be skipped and the code block in the fourth sub-tree may be parsed, i.e., the cb to be decoded next is cb26, or, if the parent node of the cb24 is encoded, it may be determined that the code block in the third sub-tree appears in the quality hierarchy, and further, the next code block in the third sub-tree may be decoded, i.e., the cb to be decoded next is cb 25.
Since the information of the code block is stored in the code stream in the order, for example, in the order of cb 16-cb 21, cb16, cb17, cb18, cb19, cb20, cb21, and cb22, but in tagree, it is not grouped in the order, that is, cb16, cb17, cb19, and cb20 are in one group, if the parent node of cb16 is not included in the layer, none of cb16, cb17, cb19, and cb20 is included in the current quality layer, two pieces of identification information, sk 1, are introduced to indicate whether to skip the first subtree and the third subtree, and skip2 is introduced to indicate whether to skip the second subtree and the fourth subtree.
if the cb18 does not appear in the quality hierarchy and the parent node of the cb18 is encoded, it may be determined that the code block in the second sub-tree in which the cb18 is located appears in the quality hierarchy, and further, the next code block in the second sub-tree may be decoded, that is, the next code block to be parsed is cb 19;
or, if cb18 does not appear in the quality hierarchy and the parent node of cb18 is not coded, it may be determined to skip the second sub-tree where cb18 is located, and further it may be determined whether skip1 is 1, that is, whether skip the first sub-tree and the third sub-tree are skipped, if 1, it indicates skip, and then parse the first code block in the third sub-tree, that is, the next code block to be parsed is cb26, otherwise, it indicates not skip, and parse the code block to be parsed after cb18, and since cb19 needs to skip, the next code block to be parsed is cb 20.
The case of Cb26 is similar to Cb18 and will not be described here in detail.
if the current code block to be decoded is cb19, it may be determined whether skip1 is 1, that is, whether to skip the first sub-tree and the third sub-tree, if so, it indicates skipping, the next code block in the second sub-tree is parsed, that is, the next code block to be parsed is cb22, otherwise, it indicates not skipping, and the code block to be parsed after cb19 is parsed, that is, the next code block to be parsed is cb 20.
The case of Cb27 is similar to Cb19 and will not be described here in detail.
Case 5: if cur _ cb is 21 or 29, determining whether skip2 is 1, if it is 1, add _ cb is 3, otherwise add _ cb is 1;
if the currently to-be-decoded cb is cb21, it may be determined whether skip2 is 1, that is, whether to skip the second sub-tree and the fourth sub-tree, if so, it means skipping, then the code block in the third sub-tree is parsed, that is, the next to-be-parsed code block is cb24, otherwise, it means not skipping, and the to-be-parsed code block after cb21 is parsed, that is, the next to-be-parsed code block is cb 22.
The case of Cb29 is similar to Cb21 and will not be described here in detail.
Case 6: for the other cbs in the tag tree, add _ cb is 1.
For example, for cb1, the next code block to be decoded is cb 2.
For another example, for cb5, the next code block to be decoded is cb 6.
As another example, for cb17, the next code block to be decoded is cb 18.
It should be understood that the add _ cb of the cb in the third kind of tree corresponding to cb 32-cb 47 and cb 48-cb 63 and having the same position as that of cb 16-cb 31 is determined in the same manner, and will not be described herein again.
In another case, if the LYR code of the current code block to be decoded is resolved to 1 for the first time (denoted as case 2), in this case, it may be considered that the code block to be decoded is coded in the current quality hierarchy, and meanwhile, it may be considered that the parent node and the ancestor node of the code block to be decoded are also coded in the quality hierarchy, and accordingly, the coding identification information of the parent node and the ancestor node of the code block to be decoded may be updated, that is, the coding identification information of the parent node and the ancestor node of the code block to be decoded is updated to 1. According to the storage sequence of cb in tagtree, the following situations can be specifically included:
case 2-1: if cur _ cb is 16,32,48, it is determined whether the encoded identification information of the ancestor node fafa is 0, and if the encoded identification information of the ancestor node fafa is 0, it means that the ancestor node is not encoded, in this case, updating the coding identification information of the ancestor node fafa to 1, if the coding identification information of the ancestor node fafa is 1, it is determined whether the coding identification information of the parent node fa is 0, if the coding identification information of the parent node fa is 0, which means that the parent node is not coded, the coding identification information of the parent node fa is updated to 1, or, if the coding identification information of the father node fa is 1, which indicates that the father node is coded, determining whether the coding identification information of the leaf node corresponding to cur _ cb is 0, and if the coding identification information of the leaf node is 0, which indicates that the leaf node is not coded, updating the coding identification information of the leaf node to 1.
Specifically, if the ZBP coding of cb16 resolves to 1, it means that cb16 appears in the quality hierarchy, and the leaf node, parent node and ancestor node of cb16 are necessarily coded, so that the coding identification information of the leaf node, parent node and ancestor node of cb16 can be updated to be coded.
Case 2-2: if cur _ cb is 18,24,26,34,40,42,50,56,58, determining whether the encoding identification information of the parent node fa is 0, and if the encoding identification information of the parent node fa is 0, updating the encoding identification information of the parent node fa to 1; if the coding identification information of the father node fa is 1, judging whether the coding identification information of the leaf node corresponding to cur _ cb is 0, and if the coding identification information of the leaf node is 0, updating the coding identification information of the leaf node to 1.
If the coding identification information of the code block is updated from 0 to 1 in the current quality hierarchy, it indicates that the code block appears for the first time in the quality hierarchy, that is, the quality hierarchy is a first layer of the code block, that is, the quality hierarchy includes the ZBP coding of the code block, and further, the ZBP parsing circuit 83 may parse the ZBP coding of the code block to determine the ZBP information of the leaf node corresponding to the code block.
As is known from the ZBP coding principle of codeblocks, the ZBP information of parent and ancestor nodes is included in the ZBP coding of the codeblock that occurs first in the tree, i.e., the ZBP coding of the codeblock that occurs first in the tree includes the ZBP information of the parent (if there is a parent) and ancestor (if there is an ancestor) nodes of the codeblock, and the ZBP coding of the codeblock that occurs first in the subtree includes the ZBP information of the parent node of the codeblock.
Taking ZBP encoding for decoding codeblocks in the third tree type to obtain ZBP information of the codeblocks in the third tree type as an example, a specific ZBP decoding process will be described.
Step 1: determining node information of leaf nodes, parent nodes and ancestor nodes of a first codeblock according to the ZBP encoding of the first codeblock appearing first in the tree, wherein the decoding process of the ZBP information of the codeblock is actually a process of finding 1 in the ZBP encoding of the codeblock according to the ZBP encoding principle:
step 1-1: determining node information of an ancestor node of the first code block;
starting from the highest bit of the current ZBP code (denoted as ZBP code 0), searching the first 1 in the ZBP code 0, taking the number of zeros before the first 1 as the node information of the ancestor node of the first code block, which may correspond to cn2-1 described above, and then shifting the first 1 and the bits before the first 1, and taking the bit as the ZBP code of the next step, denoted as ZBP code 1;
step 1-2: determining node information of a parent node of the first code block;
starting from the highest bit of the ZBP code 1, searching the first 1 in the ZBP code 1, using the number of zeros before the first 1 as the node information of the parent node of the first code block, where the node information of the parent node may correspond to cn1-1 as described above, and then shifting the first 1 and the bits before the first 1 to be used as the ZBP code of the next step, which is denoted as ZBP code 2;
step 1-3: determining node information of leaf nodes of the first code block;
starting from the highest bit of the ZBP code 2, the first 1 in the ZBP code 2 is searched, and the number of zeros before the first 1 is used as the node information of the first code block, and the node information of the leaf node of the code block may correspond to cn0-1 as described above.
So far, the node information of the leaf node, parent node and ancestor node of the code block appearing first in the tree has been obtained.
Further, in step 2, the ZBP information of the second codeblock occurring second in the tree is determined according to the ZBP coding of the second codeblock, optionally, the second codeblock may be a codeblock (denoted) occurring first in other subtrees not belonging to the same subtree as the first codeblock, in which case the ZBP coding of the second codeblock includes the ZBP information of leaf nodes and parent nodes of the second codeblock, or may also be a codeblock belonging to the same subtree as the first codeblock, in which case the second codeblock includes only the ZBP information of leaf nodes of the second codeblock. The decoding of the second code block in the first case is exemplified. The specific process is as follows:
in step 2-1: starting from the highest bit of the ZBP code of the second code block, searching the first 1 in the ZBP code, using the number of zeros before the first 1 as the node information of the parent node of the second code block, then shifting the first 1 and the bits before the first 1, and using the bit as the ZBP code of the next step, which is marked as ZBP code 3;
in step 2-2: starting from the highest bit of the ZBP code 3, the first 1 in the ZBP code 3 is searched, and the number of zeros before the first 1 is used as the node information of the second code block.
To this end, node information of leaf nodes and parent nodes of the code block appearing second in the tree is obtained.
The decoding process of ZBP information by cb will be described with reference to fig. 11, taking the reconstruction process of the tree from cb16 to cb31 as an example. As shown in FIG. 11, the tree starts as an empty tree.
If the cb appearing first in the tree is cb25, the ZBP coding of cb25 includes node information of a parent node and an ancestor node of cb25, the three are separated by 1, the position of the first 1 appearing is continuously searched, the front of the position is judged to have several 0 s, and then the number of 0 s is written into a corresponding register, so that the node information of the ancestor node, the parent node and the leaf node can be obtained.
Assuming that the ZBP of cb25 is encoded as 001011, the first 1 is preceded by 20 s, then 2 can be written into the register of the ancestor node of cb25, the second 1 is preceded by 10, then 1 can be written into the register of the parent node of cb25, and the third 1 is preceded by 0 s, then 0 can be written into the register of the leaf node of cb 25. That is, cn 2-1-2, cnt1-1, and cnt 0-1-0 correspond to cb 25.
If the cb appearing second is cb22 and the ancestor node of cb22 has already been decoded, then only the parent node of cb22 and cb22 itself need to be decoded, if ZBP of cb22 is coded 0001001, 3 0's before the first 1, then 3's are written into the register of the parent node of cb22, and 2's before the second 1, then 2's are written into the register of the corresponding leaf node of cb 22. That is, cnt 1-1-3 and cnt 0-1-2 correspond to cb 22.
If the cb of the third occurrence is cb18, and both the ancestor node and the parent node of cb18 are decoded, then only the cb18 needs to be decoded, the ZBP encoding of cb18 is 01, and 1 is preceded by 10, then a1 is written into the register of the leaf node of cb 18. That is, cnt0-1 for cb18 is 1.
From the ZBP encoding of successive cbs in the tree, node information for each node in the tree can be obtained in turn, according to the definition of cnt0, cn1 and cnt2, i.e. cnt0 ═ ZBP, as described abovecb-ZBPfa+1,cnt1=ZBPfa-ZBPfafa+1,cnt2=ZBPfafa-0+1, known as cnt0-1 ═ ZBPcb-ZBPfa,cnt1-1=ZBPfa-ZBPfafa,cnt2-1=ZBPfafa-0, wherein cnt0-1, cnt1-1 and cnt2-1 are respectively the node information of the leaf node, parent node and ancestor node of the code block, so that the summation of the three can obtain the ZBP information ZBP of the leaf node of cbcbI.e. ZBPcb=(cnt0-1)+(cnt1-1)+(cnt2-1)。
That is, after the node information of each node in the whole tree is obtained, the node information on the path from the leaf node to the ancestor node of the code block may be accumulated, so as to obtain the ZBP information of the leaf node of the code block.
Optionally, in an embodiment of the present application, for a three-layer tagtree, the ZBP parsing circuit may include three decoding units, a first decoding unit, a second decoding unit, and a third decoding unit, which are respectively configured to determine node information of an ancestor node, node information of a parent node, and node information of a leaf node of a code block.
Optionally, the ZBP parsing circuit may further include a plurality of registers, configured to cache the parsed node information of the ancestor node, the node information of the father node, the node information of the leaf node, and the ZBP code of the shifted code block.
After the ZBP encoding of the code block in the data packet is analyzed, further, the channel number analyzing circuit 84 may be activated, the channel number analyzing circuit 84 analyzes the encoded channel number information of the code block, the interception length analyzing circuit 85 may be activated, the information of the code block, which includes the interception length, may be analyzed, and meanwhile, other analyzing circuits may be activated to analyze other information in the packet header, which is not described in detail in this embodiment of the present application.
After the packet header of each code block in the data packet is analyzed, further, the packet body analyzing circuit and the packet header extracting circuit can also analyze the packet body part in the data packet, reorganize decoded data obtained through analysis, and store the organized data in the memory, so that a later-stage circuit can further process the data.
The encoder and decoder according to the embodiment of the present application are described above with reference to fig. 3 to 11, and the encoding method according to the embodiment of the present application is described below with reference to fig. 12.
It should be understood that the encoding method in the embodiment of the present application may be a method when the encoder in the embodiment of the present application or a device including the encoder in the embodiment of the present application implements the technical solution in the embodiment of the present application, and for the following brevity, the related description may refer to the foregoing embodiment, and is not repeated herein. The decoding method in the embodiment of the present application is a method when the decoder in the embodiment of the present application or a device including the decoder in the embodiment of the present application implements the technical solution in the embodiment of the present application, and for related descriptions, reference may be made to the foregoing embodiment, and details are not described herein again for the sake of brevity.
Fig. 12 shows a schematic flow diagram of an encoding method 400 according to an embodiment of the present application.
As shown in fig. 12, the method 400 includes:
s401, acquiring zero bit plane ZBP information or contained information of each to-be-coded block in a to-be-coded block set;
s402, constructing an identification tree according to the ZBP information or the contained information of each block to be coded, and coding the label tree in parallel.
Optionally, in an embodiment of the present application, the method 400 further includes:
and storing the ZBP information or contained information of each block to be coded in a register corresponding to each block to be coded.
Optionally, in an embodiment of the present application, the constructing the identification tree according to the ZBP information or the contained information of each block to be coded may specifically include:
grouping the blocks to be coded in the code block set to be coded according to a fixed number, and determining a first-level advanced node pointed by each group;
and continuously grouping the first-level advanced nodes pointed by each group, and determining the second-level advanced nodes pointed by the first-level advanced nodes until only one highest-level node exists in the mark tree.
In some embodiments, the set of blocks to be encoded includes 64 code blocks, the number of the code blocks is 0 to 63, and the constructing an identification tree according to the ZBP information of each block to be encoded includes:
code blocks numbered 0 to 3 are separately constructed into four first-class flag trees;
grouping the blocks to be coded with numbers from 4 to 7, the blocks to be coded with numbers from 8 to 11 and the blocks to be coded with numbers from 12 to 15, determining a high-level node pointed by each group, and obtaining three second-class mark trees;
grouping the blocks to be coded with numbers of 16 to 31, the blocks to be coded with numbers of 32 to 47 and the blocks to be coded with numbers of 48 to 63 according to a fixed number, determining high-level nodes of each group until only one high-level node is left, and obtaining three third-class flag trees.
In a specific embodiment, the to-be-coded blocks numbered 16,17,20,21 in the to-be-coded blocks numbered 16 to 31 may be grouped into one group, the to-be-coded blocks numbered 18,19,22,23 may be grouped into one group, the to-be-coded blocks numbered 26,27,30,31 may be grouped into one group, and a first-level high-level node of each group may be determined;
and determining a second-level high-level node pointed by each group according to the first-level high-level node of each group to obtain a third-type flag tree.
In an embodiment of the present application, the determining a first level higher node to which each packet is directed includes:
and determining the minimum value in the ZBP information of the blocks to be coded in each group as the ZBP information of the higher-level node pointed by the group.
Optionally, in an embodiment of the present application, when the code blocks numbered 0 to 3 are encoded, the flag trees of other code blocks to be encoded in the set of code blocks to be encoded are constructed in parallel.
Optionally, in an embodiment of the present application, the encoding the tag tree includes:
determining coding reference information of the to-be-coded block according to the mark tree, wherein the coding reference information is used for indicating the relation between a node on a path from the to-be-coded block to a highest node of the to-be-coded block and ZBP information of a father node of the node;
and determining the ZBP code of the block to be coded according to the code reference information of the block to be coded.
Optionally, in an embodiment of the present application, the determining, according to the flag tree, the coding reference information of the block to be coded includes:
and determining first reference information, second reference information and third reference information of the to-be-coded block according to the flag tree, wherein the first reference information is used for indicating the relationship between the ZBP information of the to-be-coded block and the ZBP information of a first-level high-level node of the to-be-coded block, the second reference information is used for indicating the relationship between the ZBP information of the first-level high-level node of the to-be-coded block and the ZBP information of a second-level high-level node of the to-be-coded block, and the third reference information is used for indicating the relationship between the ZBP information of the second-level high-level node of the to-be-coded block and the ZBP information of a third-level high-level node of the to-coded block.
Optionally, in an embodiment of the present application, the first reference information to be coded is a difference between the ZBP information of the to-be-coded block and the ZBP information of the first-level advanced node of the to-be-coded block plus one, the second reference information to be coded is a difference between the ZBP information of the first-level advanced node of the to-be-coded block and the ZBP information of the second-level advanced node of the to-be-coded block plus one, and the third reference information to be coded is a difference between the ZBP information of the second-level advanced node of the to-be-coded block and the ZBP information of the third-level advanced node of the to-be-coded block plus one.
Optionally, in an embodiment of the present application, the determining, according to the flag tree, the first reference information, the second reference information, and the third reference information of the block to be coded includes:
and determining first reference information, second reference information and third reference information of the block to be coded according to the mark tree and by combining whether the block to be coded has a high-level node or not.
Example 1: if the to-be-coded block does not have a high-level node, determining first reference information of the to-be-coded block according to the ZBP information of the to-be-coded block, and determining second reference information and third reference information of the to-be-coded block to be zero. For example, it may be determined that the first reference information of the node to be coded is ZBP information of the node to be coded plus one.
Example 2: and if the block to be coded has a high-level node, determining first reference information, second reference information and third reference information of the block to be coded according to the coding identification information of the high-level node of the block to be coded.
In embodiment 2, further, according to whether the block to be encoded has a second-level high-level node, the first reference information, the second reference information, and the third reference information of the block to be encoded may be determined in combination with the encoding identification information of the high-level node of the block to be encoded.
Example 2.1: if the block to be coded does not have a second-level high-level node, determining first reference information, second reference information and third reference information of the block to be coded according to coding identification information of a first high-level node of the block to be coded.
Case 1: if the first high-level node of the block to be coded is coded, determining first reference information of the block to be coded according to the ZBP information of the block to be coded, and determining second reference information and third reference information of the block to be coded to be zero. For example, the first reference information of the node to be encoded may be determined as a difference value between the ZBP information of the node to be encoded and the ZBP information of the first-level high-level node of the node to be encoded plus one.
Case 2: if the first high-level node of the block to be coded is not coded, determining the first reference information and the second reference information of the block to be coded according to the ZBP information of the block to be coded and the ZBP information of the first high-level node of the block to be coded, and determining that the third reference information of the block to be coded is zero. For example, the first reference information of the node to be coded may be determined as the difference value between the ZBP information of the node to be coded and the ZBP information of the first-level high-level node to be coded plus one, and the second reference information of the node to be coded may be determined as the ZBP information of the first-level high-level node to be coded plus one.
Example 2.2: if the block to be coded has two-level advanced nodes, determining first reference information, second reference information and third reference information of the block to be coded according to coding identification information of a first advanced node of the block to be coded and coding identification information of a second advanced node of the block to be coded.
Case 1: if the first high-level node of the block to be coded is coded, determining first reference information of the block to be coded according to the ZBP information of the block to be coded, and determining second reference information and third reference information of the block to be coded to be zero. For example, the first reference information of the node to be encoded may be determined as a difference value between the ZBP information of the node to be encoded and the ZBP information of the first-level high-level node of the node to be encoded plus one.
Case 2: if the first high-level node of the block to be coded is not coded, determining first reference information, second reference information and third reference information of the block to be coded according to coding identification information of a second-level high-level node of the block to be coded.
Case 2.1: if the second-level advanced node of the block to be coded is coded, determining first reference information and second reference information of the block to be coded according to the ZBP information of the block to be coded and the ZBP information of the first-level advanced node of the block to be coded, and determining that third reference information of the block to be coded is zero. For example, the first reference information of the node to be coded may be determined as the difference value between the ZBP information of the first-level high-level node to be coded and the ZBP information of the first-level high-level node to be coded plus one, and the second reference information of the node to be coded may be determined as the difference value between the ZBP information of the first-level high-level node to be coded and the ZBP information of the second-level high-level node to be coded plus one.
Case 2.2: and if the second-level high-level node of the block to be coded is not coded, determining first reference information, second reference information and third reference information of the block to be coded according to the ZBP information of the block to be coded, the ZBP information of the first-level high-level node of the block to be coded and the ZBP information of the second-level high-level node of the block to be coded. For example, it may be determined that the first reference information of the to-be-coded block is the difference between the ZBP information of the to-be-coded block and the ZBP information of the first-level high-level node of the to-be-coded block plus one, the second reference information of the to-be-coded block is the difference between the ZBP information of the first-level high-level node of the to-be-coded block and the ZBP information of the second-level high-level node of the to-be-coded block plus one, and the third reference information of the to-be-coded block is the ZBP information of the second-level high-level node of the.
Further, in an embodiment of the present application, the determining the ZBP coding of the block to be coded according to the coding reference information of the block to be coded includes:
and determining the ZBP code of the block to be coded according to the first reference information, the second reference information and the third reference information of the block to be coded.
In an embodiment of the present application, the determining the ZBP coding of the block to be coded according to the first reference information, the second reference information, and the third reference information of the block to be coded includes:
converting the first reference information, the second reference information and the third reference information into a first binary code, a second binary code and a third binary code, respectively;
and splicing the third binary code, the second binary code and the first binary code to obtain the ZBP code of the block to be coded.
Optionally, in an embodiment of the present application, the first reference information and the converted first binary code have the following relationship:
the length of the first binary code is the first reference information, the lowest bit of the first binary code is 1, and the other bits are zeros.
Optionally, in an embodiment of the present application, the second reference information and the converted second binary code have the following relationship:
if the second reference information is zero, the second binary code is null; or
If the second reference information is not zero, the length of the second binary code is the second reference information, the lowest bit of the second binary code is 1, and the other bits are zero.
Optionally, in an embodiment of the present application, the third reference information and the converted third binary code have the following relationship:
if the third reference information is zero, the third binary code is null; or
If the third reference information is not zero, the length of the third binary code is the third reference information, the lowest bit of the third binary code is 1, and the other bits are zero.
Optionally, in an embodiment of the present application, the encoding the tag tree includes:
and determining the layer LYR code of the block to be coded, wherein the LYR code of the block to be coded is used for indicating the contained information of the block to be coded in the quality hierarchy.
Optionally, in an embodiment of the present application, the determining the LYR encoding of the block to be encoded includes: and determining the LYR code of the block to be coded according to the ZBP code of the block to be coded.
Optionally, in an embodiment of the present application, the determining the LYR code of the to-be-coded block according to the ZBP code of the to-be-coded block includes:
and determining LYR codes of the blocks to be coded in the quality hierarchy according to the ZBP codes of the blocks to be coded and the quality hierarchy of the current codes.
For example, starting from the highest bit of the ZBP code of the block to be coded, searching the position of the first zero in the ZBP code, and taking the first zero and the bit before the first zero as the LYR code of the first quality hierarchy; or if the ZBP codes of the blocks to be coded are all 1, determining the ZBP codes as LYR codes of the first quality hierarchy.
Further, removing the first zero and the bit before the first zero in the ZBP code, and using the shifted ZBP code as an updated ZBP code of the to-be-coded block;
determining LYR codes of the blocks to be coded in the next quality hierarchy according to the updated ZBP codes of the blocks to be coded; or if the updated ZBP codes of the blocks to be coded are all 1, determining the updated ZBP codes as LYR codes of the next quality layer, and circularly executing the process.
Optionally, in an embodiment of the present application, the determining, according to the ZBP coding of the block to be coded and the quality hierarchy of the current coding, the LYR coding of the block to be coded in the quality hierarchy further includes:
if the block to be coded is included for the first time in the quality hierarchy and the least significant bit of the LYR code of the block to be coded in the quality hierarchy is 1, the LYR code of the block to be coded in other subsequent quality hierarchies is not determined.
Optionally, in an embodiment of the present application, the determining the LYR encoding of the block to be encoded includes:
and if the first-level high-level node of the block to be coded is coded and the quality hierarchy of the current code is smaller than the ZBP information of the father node of the block to be coded, determining that the LYR code of the block to be coded in the quality hierarchy is zero.
Optionally, in an embodiment of the present application, the method further includes:
and outputting the LYR code and the ZBP code of the block to be coded in the quality hierarchy to a packet header of a data packet corresponding to the quality hierarchy.
Optionally, in an embodiment of the present application, the method further includes:
and after the advanced node of the block to be coded in the mark tree is coded, updating the coding identification information of the advanced node of the block to be coded in the mark tree.
Optionally, in an embodiment of the present application, the updating the coding identification information of the high-level node of the block to be coded in the flag tree includes:
after the first-level advanced node of the block to be coded is coded, updating the coding identification information of the first-level advanced node and the second-level advanced node of the block to be coded into coded information; or
And after the second-level advanced node of the block to be coded is coded, updating the coding identification information of the second-level advanced node of the block to be coded into coded information.
Optionally, in an embodiment of the present application, the method 400 further includes:
and storing the coding identification information of the high-level node of the block to be coded into a register corresponding to the high-level node of the block to be coded.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware or any other combination. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a Digital Video Disk (DVD)), or a semiconductor medium (e.g., a Solid State Disk (SSD)), among others.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (97)
1. A method of encoding, comprising:
acquiring zero bit plane ZBP information or contained information of each to-be-coded block in a to-be-coded block set;
and constructing an identification tree according to the ZBP information or contained information of each block to be coded, and coding the label tree in parallel.
2. The encoding method of claim 1, wherein the method further comprises:
and storing the ZBP information or contained information of each block to be coded in a register corresponding to each block to be coded.
3. The encoding method according to claim 1 or 2, wherein the constructing an identification tree according to the ZBP information or the contained information of each block to be encoded comprises:
grouping the blocks to be coded in the code block set to be coded according to a fixed number, and determining a first-level advanced node pointed by each group;
and continuously grouping the first-level advanced nodes pointed by each group, and determining the second-level advanced nodes pointed by the first-level advanced nodes until only one highest-level node exists in the mark tree.
4. The encoding method according to claim 3, wherein the set of blocks to be encoded comprises 64 code blocks with numbers ranging from 0 to 63, and the constructing an identification tree according to the ZBP information of each block to be encoded comprises:
code blocks numbered 0 to 3 are individually constructed as four first-type flag trees.
5. The encoding method according to claim 4, wherein the constructing an identification tree according to the ZBP information or the contained information of each block to be encoded, and the encoding the label tree in parallel comprises:
and when the code blocks with the numbers of 0 to 3 are coded, constructing the mark trees of other code blocks to be coded in the set of the code blocks to be coded in parallel.
6. The encoding method according to claim 4 or 5, wherein the constructing an identification tree according to the ZBP information or the contained information of each block to be encoded comprises:
grouping the blocks to be coded with numbers from 4 to 7, the blocks to be coded with numbers from 8 to 11 and the blocks to be coded with numbers from 12 to 15, determining a high-level node pointed by each group, and obtaining three second-class mark trees.
7. The encoding method according to any one of claims 4 to 6, wherein the constructing an identification tree according to the ZBP information of each block to be encoded comprises:
grouping the blocks to be coded with numbers of 16 to 31, the blocks to be coded with numbers of 32 to 47 and the blocks to be coded with numbers of 48 to 63 according to a fixed number, determining high-level nodes of each group until only one high-level node is left, and obtaining three third-class flag trees.
8. The encoding method according to claim 7, wherein the constructing an identification tree according to the ZBP information or the contained information of each block to be encoded comprises:
grouping the to-be-coded blocks with the numbers of 16,17,20 and 21 in the to-be-coded blocks with the numbers of 16 to 31 into a group, grouping the to-be-coded blocks with the numbers of 18,19,22 and 23 into a group, grouping the to-be-coded blocks with the numbers of 26,27,30 and 31 into a group, and determining a first-level high-level node of each group;
and determining a second-level high-level node pointed by each group according to the first-level high-level node of each group to obtain a third-type flag tree.
9. The encoding method according to any one of claims 3 to 8, wherein the determining a first level higher level node to which each packet is directed comprises:
and determining the minimum value in the ZBP information of the blocks to be coded in each group as the ZBP information of the higher-level node pointed by the group.
10. The encoding method according to any one of claims 1 to 9, wherein said encoding the tag tree comprises:
determining coding reference information of the to-be-coded block according to the mark tree, wherein the coding reference information is used for indicating the relation between a node on a path from the to-be-coded block to a highest node of the to-be-coded block and ZBP information of a father node of the node;
and determining the ZBP code of the block to be coded according to the code reference information of the block to be coded.
11. The encoding method according to claim 10, wherein the determining the encoding reference information of the block to be encoded according to the flag tree comprises:
and determining first reference information, second reference information and third reference information of the to-be-coded block according to the flag tree, wherein the first reference information is used for indicating the relationship between the ZBP information of the to-be-coded block and the ZBP information of a first-level high-level node of the to-be-coded block, the second reference information is used for indicating the relationship between the ZBP information of the first-level high-level node of the to-be-coded block and the ZBP information of a second-level high-level node of the to-be-coded block, and the third reference information is used for indicating the relationship between the ZBP information of the second-level high-level node of the to-be-coded block and the ZBP information of a third-level high-level node of the to-coded block.
12. The encoding method of claim 11, wherein the first reference information to be encoded is the difference between the ZBP information of the to-be-encoded block and the ZBP information of the first-level high-level node of the to-be-encoded block plus one, wherein the second reference information to be encoded is the difference between the ZBP information of the first-level high-level node of the to-be-encoded block and the ZBP information of the second-level high-level node of the to-be-encoded block plus one, and wherein the third reference information to be encoded is the difference between the ZBP information of the second-level high-level node of the to-be-encoded block and the ZBP information of the third-level high-level node of the to-be-encoded block plus one.
13. The encoding method according to claim 11 or 12, wherein the determining the first reference information, the second reference information and the third reference information of the block to be encoded according to the flag tree comprises:
and determining first reference information, second reference information and third reference information of the block to be coded according to the mark tree and by combining whether the block to be coded has a high-level node or not.
14. The encoding method as claimed in claim 13, wherein the determining the first reference information, the second reference information and the third reference information of the block to be encoded according to the flag tree in combination with whether the block to be encoded has a higher level node comprises:
if the to-be-coded block does not have a high-level node, determining first reference information of the to-be-coded block according to the ZBP information of the to-be-coded block, and determining second reference information and third reference information of the to-be-coded block to be zero.
15. The encoding method of claim 14, wherein the determining the first reference information of the block to be encoded according to the ZBP information of the block to be encoded comprises:
and determining the first reference information of the node to be coded as the ZBP information of the node to be coded plus one.
16. The encoding method as claimed in claim 13, wherein the determining the first reference information, the second reference information and the third reference information of the block to be encoded according to the flag tree in combination with whether the block to be encoded has a higher level node comprises:
and if the block to be coded has a high-level node, determining first reference information, second reference information and third reference information of the block to be coded according to the coding identification information of the high-level node of the block to be coded.
17. The encoding method according to claim 16, wherein the determining the first reference information, the second reference information and the third reference information of the block to be encoded according to the encoding identification information of the higher-level node of the block to be encoded comprises:
and determining first reference information, second reference information and third reference information of the block to be coded according to whether the block to be coded has a second-level advanced node or not and by combining coding identification information of the advanced node of the block to be coded.
18. The encoding method of claim 17, wherein the determining the first reference information, the second reference information and the third reference information of the block to be encoded according to whether the block to be encoded has a second-level advanced node or not, in combination with the encoding identification information of the advanced node of the block to be encoded, comprises:
if the block to be coded does not have a second-level high-level node, determining first reference information, second reference information and third reference information of the block to be coded according to coding identification information of a first high-level node of the block to be coded.
19. The encoding method of claim 18, wherein the determining the first reference information, the second reference information and the third reference information of the block to be encoded according to the encoding identification information of the first higher-level node of the block to be encoded comprises:
if the first high-level node of the block to be coded is coded, determining first reference information of the block to be coded according to the ZBP information of the block to be coded, and determining second reference information and third reference information of the block to be coded to be zero.
20. The encoding method of claim 19, wherein the determining the first reference information of the block to be encoded according to the ZBP information of the block to be encoded comprises:
and determining the first reference information of the node to be coded as the difference value of the ZBP information of the node to be coded and the ZBP information of the first-level advanced node of the node to be coded plus one.
21. The encoding method of claim 18, wherein the determining the first reference information, the second reference information and the third reference information of the block to be encoded according to the encoding identification information of the first higher-level node of the block to be encoded comprises:
if the first high-level node of the block to be coded is not coded, determining the first reference information and the second reference information of the block to be coded according to the ZBP information of the block to be coded and the ZBP information of the first high-level node of the block to be coded, and determining that the third reference information of the block to be coded is zero.
22. The encoding method of claim 18, wherein the determining the first reference information and the second reference information of the block to be encoded according to the ZBP information of the block to be encoded and the ZBP information of the first-level high-level node of the block to be encoded comprises:
and determining the first reference information of the node to be coded as the difference value of the ZBP information of the node to be coded and the ZBP information of the first-level advanced node of the node to be coded plus one, and determining the second reference information of the node to be coded as the ZBP information of the first-level advanced node of the node to be coded plus one.
23. The encoding method of claim 17, wherein the determining the first reference information, the second reference information and the third reference information of the block to be encoded according to whether the block to be encoded has a second-level advanced node or not, in combination with the encoding identification information of the advanced node of the block to be encoded, comprises:
if the block to be coded has two-level advanced nodes, determining first reference information, second reference information and third reference information of the block to be coded according to coding identification information of a first advanced node of the block to be coded and coding identification information of a second advanced node of the block to be coded.
24. The encoding method of claim 23, wherein determining the first reference information, the second reference information and the third reference information of the block to be encoded according to the encoding identification information of the first higher-level node of the block to be encoded and the encoding identification information of the second higher-level node of the block to be encoded comprises:
if the first high-level node of the block to be coded is coded, determining first reference information of the block to be coded according to the ZBP information of the block to be coded, and determining second reference information and third reference information of the block to be coded to be zero.
25. The encoding method of claim 24, wherein the determining the first reference information of the block to be encoded according to the ZBP information of the block to be encoded comprises:
and determining the first reference information of the node to be coded as the difference value of the ZBP information of the node to be coded and the ZBP information of the first-level advanced node of the node to be coded plus one.
26. The encoding method of claim 24, wherein determining the first reference information, the second reference information and the third reference information of the block to be encoded according to the encoding identification information of the first higher-level node of the block to be encoded and the encoding identification information of the second higher-level node of the block to be encoded comprises:
if the first high-level node of the block to be coded is not coded, determining first reference information, second reference information and third reference information of the block to be coded according to coding identification information of a second-level high-level node of the block to be coded.
27. The encoding method of claim 26, wherein the determining the first reference information, the second reference information and the third reference information of the block to be encoded according to the encoding identification information of the second-level advanced node of the block to be encoded comprises:
if the second-level advanced node of the block to be coded is coded, determining first reference information and second reference information of the block to be coded according to the ZBP information of the block to be coded and the ZBP information of the first-level advanced node of the block to be coded, and determining that third reference information of the block to be coded is zero.
28. The encoding method of claim 27, wherein the determining the first reference information and the second reference information of the to-be-encoded block according to the ZBP information of the to-be-encoded block and the ZBP information of the first-level high-level node of the to-be-encoded block comprises:
and determining the first reference information of the node to be coded as the difference value of the ZBP information of the node to be coded and the ZBP information of the first-level advanced node of the node to be coded plus one, and determining the second reference information of the node to be coded as the difference value of the ZBP information of the first-level advanced node of the node to be coded and the ZBP information of the second-level advanced node of the node to be coded plus one.
29. The encoding method of claim 26, wherein the determining the first reference information, the second reference information and the third reference information of the block to be encoded according to the encoding identification information of the second-level advanced node of the block to be encoded comprises:
and if the second-level high-level node of the block to be coded is not coded, determining first reference information, second reference information and third reference information of the block to be coded according to the ZBP information of the block to be coded, the ZBP information of the first-level high-level node of the block to be coded and the ZBP information of the second-level high-level node of the block to be coded.
30. The encoding method of claim 29, wherein the determining the first reference information, the second reference information and the third reference information of the block to be encoded according to the ZBP information of the block to be encoded, the ZBP information of the first-level high-level node of the block to be encoded and the ZBP information of the second-level high-level node of the block to be encoded comprises:
determining that the first reference information of the to-be-coded block is the difference value of the ZBP information of the to-be-coded block and the ZBP information of the first-level advanced node of the to-be-coded block plus one, the second reference information of the to-be-coded block is the difference value of the ZBP information of the first-level advanced node of the to-be-coded block and the ZBP information of the second-level advanced node of the to-be-coded block plus one, and the third reference information of the to-be-coded block is the ZBP information of the second-level advanced node of the to-be-coded block plus one.
31. The coding method according to any one of claims 11 to 30, wherein the determining the ZBP coding of the block to be coded according to the coding reference information of the block to be coded comprises:
and determining the ZBP code of the block to be coded according to the first reference information, the second reference information and the third reference information of the block to be coded.
32. The encoding method of claim 31, wherein the determining the ZBP coding of the block to be encoded according to the first reference information, the second reference information and the third reference information of the block to be encoded comprises:
converting the first reference information, the second reference information and the third reference information into a first binary code, a second binary code and a third binary code, respectively;
and splicing the third binary code, the second binary code and the first binary code to obtain the ZBP code of the block to be coded.
33. The encoding method according to claim 32, wherein the first reference information and the converted first binary code have the following relationship:
the length of the first binary code is the first reference information, the lowest bit of the first binary code is 1, and the other bits are zeros.
34. The encoding method according to claim 32 or 33, wherein the second reference information and the converted second binary code have the following relationship:
if the second reference information is zero, the second binary code is null; or
If the second reference information is not zero, the length of the second binary code is the second reference information, the lowest bit of the second binary code is 1, and the other bits are zero.
35. The encoding method according to any one of claims 32 to 34, wherein the third reference information and the converted third binary code have the following relationship:
if the third reference information is zero, the third binary code is null; or
If the third reference information is not zero, the length of the third binary code is the third reference information, the lowest bit of the third binary code is 1, and the other bits are zero.
36. The encoding method according to any one of claims 1 to 35, wherein said encoding the tag tree comprises:
and determining the layer LYR code of the block to be coded, wherein the LYR code of the block to be coded is used for indicating the contained information of the block to be coded in the quality hierarchy.
37. The encoding method of claim 36, wherein the determining the LYR encoding of the block to be encoded comprises:
and determining the LYR code of the block to be coded according to the ZBP code of the block to be coded.
38. The encoding method of claim 37, wherein the determining the LYR encoding of the block to be encoded from the ZBP encoding of the block to be encoded comprises:
and determining LYR codes of the blocks to be coded in the quality hierarchy according to the ZBP codes of the blocks to be coded and the quality hierarchy of the current codes.
39. The encoding method of claim 38, wherein the determining the LYR encoding of the to-be-encoded block in the quality hierarchy according to the ZBP encoding of the to-be-encoded block and the quality hierarchy of the current encoding comprises:
starting from the highest bit of the ZBP code of the block to be coded, searching the position of the first zero in the ZBP code, and taking the first zero and the bit before the first zero as the LYR code of the first quality hierarchy; or if the ZBP codes of the blocks to be coded are all 1, determining the ZBP codes as LYR codes of the first quality hierarchy.
40. The encoding method as claimed in claim 39, wherein the determining the layer coding of the block to be encoded in the quality hierarchy according to the ZBP coding of the block to be encoded and the quality hierarchy of the current coding further comprises:
removing the first zero and the bit before the first zero in the ZBP code, and using the ZBP code after shifting as an updated ZBP code of the block to be coded;
determining LYR codes of the blocks to be coded in the next quality hierarchy according to the updated ZBP codes of the blocks to be coded; or if the updated ZBP codes of the blocks to be coded are all 1, determining the updated ZBP codes as LYR codes of the next quality layer.
41. The encoding method of any one of claims 38 to 40, wherein the determining the LYR encoding of the block to be encoded in the quality hierarchy according to the ZBP encoding of the block to be encoded and the quality hierarchy of the current encoding, further comprises:
if the block to be coded is included for the first time in the quality hierarchy and the least significant bit of the LYR code of the block to be coded in the quality hierarchy is 1, the LYR code of the block to be coded in other subsequent quality hierarchies is not determined.
42. The encoding method of any one of claims 38 to 41, wherein said determining the LYR encoding of the block to be encoded comprises:
and if the first-level high-level node of the block to be coded is coded and the quality hierarchy of the current code is smaller than the ZBP information of the father node of the block to be coded, determining that the LYR code of the block to be coded in the quality hierarchy is zero.
43. The encoding method according to any one of claims 36 to 42, characterized in that the method further comprises:
and outputting the LYR code and the ZBP code of the block to be coded in the quality hierarchy to a packet header of a data packet corresponding to the quality hierarchy.
44. The encoding method according to any one of claims 1 to 42, characterized in that the method further comprises:
and after the advanced node of the block to be coded in the mark tree is coded, updating the coding identification information of the advanced node of the block to be coded in the mark tree.
45. The encoding method as claimed in claim 44, wherein said updating the encoding identification information of the high-level node of the block to be encoded in the flag tree comprises:
after the first-level advanced node of the block to be coded is coded, updating the coding identification information of the first-level advanced node and the second-level advanced node of the block to be coded into coded information; or
And after the second-level advanced node of the block to be coded is coded, updating the coding identification information of the second-level advanced node of the block to be coded into coded information.
46. The encoding method of claim 44 or 45, wherein the method further comprises:
and storing the coding identification information of the high-level node of the block to be coded into a register corresponding to the high-level node of the block to be coded.
47. An encoder, comprising:
the reading circuit is used for acquiring zero bit plane ZBP information or contained information of each to-be-coded block in the to-be-coded block set;
the tree building circuit is used for building an identification tree according to the ZBP information or contained information of each block to be coded;
and the coding circuit is used for coding the label tree in parallel when the tree building circuit constructs the mark tree.
48. The encoder of claim 47, further comprising:
and the first registers are used for storing the ZBP information or the contained information of each block to be coded.
49. The encoder of claim 47 or 48, wherein the tree building circuit is further configured to:
grouping the blocks to be coded in the code block set to be coded according to a fixed number, and determining a first-level advanced node pointed by each group;
and continuously grouping the first-level advanced nodes pointed by each group, and determining the second-level advanced nodes pointed by the first-level advanced nodes until only one highest-level node exists in the mark tree.
50. The encoder of claim 49, wherein the tree building circuit comprises:
the first-stage comparators are used for determining the ZBP information of the first-stage high-level node pointed by each group according to the ZBP information of the block to be coded in each group; and
a plurality of second-level comparators for determining the ZBP information of the second-level high-level node to which each packet is directed, based on the ZBP information of the first-level high-level node within each packet.
51. The encoder of claim 49, wherein the tree building circuit is specifically configured to:
code blocks numbered 0 to 3 are individually constructed as four first-type flag trees.
52. The encoder of claim 51, wherein the tree building circuit is further configured to:
and when the coding circuit codes the code blocks with the numbers of 0 to 3, constructing the mark trees of other code blocks to be coded in the set of the code blocks to be coded in parallel.
53. The encoder of any of claims 49-52, wherein the tree building circuit is further configured to:
grouping the blocks to be coded with numbers from 4 to 7, the blocks to be coded with numbers from 8 to 11 and the blocks to be coded with numbers from 12 to 15, determining a high-level node pointed by each group, and obtaining three second-class mark trees.
54. The encoder of any of claims 49-53, wherein the tree building circuit is further configured to:
grouping the blocks to be coded with numbers of 16 to 31, the blocks to be coded with numbers of 32 to 47 and the blocks to be coded with numbers of 48 to 63 according to a fixed number, determining high-level nodes of each group until only one high-level node is left, and obtaining three third-class flag trees.
55. The encoder of claim 54, wherein the tree building circuit is specifically configured to:
grouping the to-be-coded blocks with the numbers of 16,17,20 and 21 in the to-be-coded blocks with the numbers of 16 to 31 into a group, grouping the to-be-coded blocks with the numbers of 18,19,22 and 23 into a group, grouping the to-be-coded blocks with the numbers of 26,27,30 and 31 into a group, and determining a first-level high-level node of each group;
and determining a second-level high-level node pointed by each group according to the first-level high-level node of each group to obtain a third-type flag tree.
56. The encoder according to any of claims 47 to 55, wherein the encoding circuit comprises:
the first coding circuit is used for determining coding reference information of the to-be-coded block according to the mark tree, wherein the coding reference information is used for indicating the relation between a node on a path from the to-be-coded block to a highest node of the to-be-coded block and ZBP information of a father node of the node;
and the second coding circuit is used for determining the ZBP code of the block to be coded according to the code reference information of the block to be coded.
57. The encoder of claim 56, wherein the encoding reference information comprises first reference information, second reference information and third reference information, wherein the first reference information is used for indicating a relationship between the ZBP information of the first-level high-level node to be encoded and the ZBP information of the first-level high-level node to be encoded, the second reference information is used for indicating a relationship between the ZBP information of the first-level high-level node to be encoded and the ZBP information of the second-level high-level node to be encoded, and the third reference information is used for indicating a relationship between the ZBP information of the second-level high-level node to be encoded and the ZBP information of the third-level high-level node to be encoded.
58. The encoder of claim 57, wherein the first reference information to be encoded is the difference between the ZBP information of the ZBP information to be encoded and the ZBP information of the first-level high-level node to be encoded plus one, wherein the second reference information to be encoded is the difference between the ZBP information of the first-level high-level node to be encoded and the ZBP information of the second-level high-level node to be encoded plus one, and wherein the third reference information to be encoded is the difference between the ZBP information of the second-level high-level node to be encoded and the ZBP information of the third-level high-level node to be encoded plus one.
59. The encoder of claim 57 or 58, wherein the first encoding circuit is further configured to:
and determining first reference information, second reference information and third reference information of the block to be coded according to the mark tree and by combining whether the block to be coded has a high-level node or not.
60. The encoder according to claim 59, wherein the first encoding circuit is specifically configured to:
if the to-be-coded block does not have a high-level node, determining first reference information of the to-be-coded block according to the ZBP information of the to-be-coded block, and determining second reference information and third reference information of the to-be-coded block to be zero.
61. The encoder of claim 60, wherein the first encoding circuit is further configured to:
and determining the first reference information of the node to be coded as the ZBP information of the node to be coded plus one.
62. The encoder of claim 59, wherein the first encoding circuit is further configured to:
and if the block to be coded has a high-level node, determining first reference information, second reference information and third reference information of the block to be coded according to the coding identification information of the high-level node of the block to be coded.
63. The encoder of claim 62, wherein the first encoding circuit is further configured to:
and determining first reference information, second reference information and third reference information of the block to be coded according to whether the block to be coded has a second-level advanced node or not and by combining coding identification information of the advanced node of the block to be coded.
64. The encoder of claim 63, wherein the first encoding circuit is specifically configured to:
if the block to be coded does not have a second-level high-level node, determining first reference information, second reference information and third reference information of the block to be coded according to coding identification information of a first high-level node of the block to be coded.
65. The encoder according to claim 64, wherein the first encoding circuit is specifically configured to:
if the first high-level node of the block to be coded is coded, determining first reference information of the block to be coded according to the ZBP information of the block to be coded, and determining second reference information and third reference information of the block to be coded to be zero.
66. The encoder according to claim 65, wherein the first encoding circuit is specifically configured to:
and determining the first reference information of the node to be coded as the difference value of the ZBP information of the node to be coded and the ZBP information of the first-level advanced node of the node to be coded plus one.
67. The encoder of claim 64, wherein the first encoding circuit is further configured to:
if the first high-level node of the block to be coded is not coded, determining the first reference information and the second reference information of the block to be coded according to the ZBP information of the block to be coded and the ZBP information of the first high-level node of the block to be coded, and determining that the third reference information of the block to be coded is zero.
68. The encoder according to claim 64, wherein the first encoding circuit is specifically configured to:
and determining the first reference information of the node to be coded as the difference value of the ZBP information of the node to be coded and the ZBP information of the first-level advanced node of the node to be coded plus one, and determining the second reference information of the node to be coded as the ZBP information of the first-level advanced node of the node to be coded plus one.
69. The encoder of claim 63, wherein the first encoding circuit is further configured to:
if the block to be coded has two-level advanced nodes, determining first reference information, second reference information and third reference information of the block to be coded according to coding identification information of a first advanced node of the block to be coded and coding identification information of a second advanced node of the block to be coded.
70. The encoder of claim 69, wherein the first encoding circuit is further configured to:
if the first high-level node of the block to be coded is coded, determining first reference information of the block to be coded according to the ZBP information of the block to be coded, and determining second reference information and third reference information of the block to be coded to be zero.
71. The encoder according to claim 70, wherein the first encoding circuit is specifically configured to:
and determining the first reference information of the node to be coded as the difference value of the ZBP information of the node to be coded and the ZBP information of the first-level advanced node of the node to be coded plus one.
72. The encoder of claim 70, wherein the first encoding circuit is further configured to:
if the first high-level node of the block to be coded is not coded, determining first reference information, second reference information and third reference information of the block to be coded according to coding identification information of a second-level high-level node of the block to be coded.
73. The encoder of claim 72, wherein the first encoding circuit is further configured to:
if the second-level advanced node of the block to be coded is coded, determining first reference information and second reference information of the block to be coded according to the ZBP information of the block to be coded and the ZBP information of the first-level advanced node of the block to be coded, and determining that third reference information of the block to be coded is zero.
74. The encoder according to claim 73, wherein the first encoding circuit is specifically configured to:
and determining the first reference information of the node to be coded as the difference value of the ZBP information of the node to be coded and the ZBP information of the first-level advanced node of the node to be coded plus one, and determining the second reference information of the node to be coded as the difference value of the ZBP information of the first-level advanced node of the node to be coded and the ZBP information of the second-level advanced node of the node to be coded plus one.
75. The encoder of claim 72, wherein the first encoding circuit is further configured to:
and if the second-level high-level node of the block to be coded is not coded, determining first reference information, second reference information and third reference information of the block to be coded according to the ZBP information of the block to be coded, the ZBP information of the first-level high-level node of the block to be coded and the ZBP information of the second-level high-level node of the block to be coded.
76. The encoder of claim 75, wherein the first encoding circuit is specifically configured to:
determining that the first reference information of the to-be-coded block is the difference value of the ZBP information of the to-be-coded block and the ZBP information of the first-level advanced node of the to-be-coded block plus one, the second reference information of the to-be-coded block is the difference value of the ZBP information of the first-level advanced node of the to-be-coded block and the ZBP information of the second-level advanced node of the to-be-coded block plus one, and the third reference information of the to-be-coded block is the ZBP information of the second-level advanced node of the to-be-coded block plus one.
77. The encoder according to any of the claims 57 to 76, wherein the first encoding circuit comprises:
the data selector MUX is used for gating a first-level high-level node and a second-level high-level node corresponding to the block to be coded when the first reference information, the second reference information and the third reference information of the block to be coded are calculated so as to obtain ZBP information of the corresponding first-level high-level node and the second-level high-level node;
and the calculating unit is used for calculating the first reference information, the second reference information and the third reference information of the block to be coded.
78. The encoder of claim 77 wherein the first encoding circuit further comprises a plurality of second registers for storing the first reference information, the second reference information and the third reference information for each block to be encoded.
79. The encoder according to any of the claims 57 to 78, wherein the second encoding circuit is specifically configured to:
and determining the ZBP code of the block to be coded according to the first reference information, the second reference information and the third reference information of the block to be coded.
80. The encoder of claim 79, wherein the second encoding circuit is specifically configured to:
converting the first reference information, the second reference information and the third reference information into a first binary code, a second binary code and a third binary code, respectively;
and splicing the third binary code, the second binary code and the first binary code to obtain the ZBP code of the block to be coded.
81. The encoder of claim 80, wherein the first reference information and the converted first binary code have the following relationship:
the length of the first binary code is the first reference information, the lowest bit of the first binary code is 1, and the other bits are zeros.
82. The encoder according to claim 80 or 81, wherein the second reference information and the transformed second binary code have the following relationship:
if the second reference information is zero, the second binary code is null; or
If the second reference information is not zero, the length of the second binary code is the second reference information, the lowest bit of the second binary code is 1, and the other bits are zero.
83. The encoder according to any of claims 80 or 82, wherein the third reference information and the transformed third binary code have the following relationship:
if the third reference information is zero, the third binary code is null; or
If the third reference information is not zero, the length of the third binary code is the third reference information, the lowest bit of the third binary code is 1, and the other bits are zero.
84. The encoder according to any of claims 80 to 83, wherein the second encoding circuit comprises:
the code value combination unit is used for splicing the third binary code, the second binary code and the first binary code of the block to be coded to obtain a ZBP code of the block to be coded;
and the third registers are used for storing the ZBP codes of each block to be coded.
85. The encoder according to any of the claims 47 to 84, wherein the third encoding circuit is specifically configured to:
and determining the layer LYR code of the block to be coded, wherein the LYR code of the block to be coded is used for indicating the contained information of the block to be coded in the quality hierarchy.
86. The encoder according to claim 85, wherein the third encoding circuit is specifically configured to:
and determining the LYR code of the block to be coded according to the ZBP code of the block to be coded.
87. The encoder according to claim 86, wherein the third encoding circuit is specifically configured to:
and determining LYR codes of the blocks to be coded in the quality hierarchy according to the ZBP codes and the coded quality hierarchy of the blocks to be coded.
88. The encoder according to claim 87, wherein the third encoding circuit is specifically configured to:
starting from the highest bit of the ZBP code of the block to be coded, searching the position of the first zero in the ZBP code, and taking the first zero and the bit before the first zero as the LYR code of the first quality hierarchy; or if the ZBP codes of the blocks to be coded are all 1, determining the ZBP codes as LYR codes of the first quality hierarchy.
89. The encoder of claim 88, wherein the third encoding circuit is further configured to:
removing the first zero and the bit before the first zero in the ZBP code, and using the ZBP code after shifting as an updated ZBP code of the block to be coded;
determining LYR codes of the blocks to be coded in the next quality hierarchy according to the updated ZBP codes of the blocks to be coded; or if the updated ZBP codes of the blocks to be coded are all 1, determining the updated ZBP codes as LYR codes of the next quality layer.
90. The encoder according to any one of claims 87 to 89, wherein the third encoding circuit is further configured to:
if the block to be coded is included for the first time in the quality hierarchy and the least significant bit of the LYR code of the block to be coded in the quality hierarchy is 1, the LYR code of the block to be coded in other subsequent quality hierarchies is not determined.
91. The encoder according to any one of claims 87 to 90, wherein the determining the LYR encoding of the block to be encoded comprises:
and if the first-level high-level node of the block to be coded is coded and the quality hierarchy of the current code is smaller than the ZBP information of the father node of the block to be coded, determining that the LYR code of the block to be coded in the quality hierarchy is zero.
92. The encoder according to any of claims 85 to 91, wherein the third encoding circuit comprises:
k processing units, configured to determine LYR encoding of the block to be encoded in each of K quality layers, where K is greater than 1;
and the K fourth registers are used for caching processing results output by the K processing units, and the processing results comprise LYR codes and shifted ZBP codes of the blocks to be coded in quality hierarchy.
93. The encoder according to any of the claims 85 to 92, wherein the encoder further comprises:
and the code stream generation module is used for outputting the code blocks to be coded, which are obtained by coding the code blocks to be coded, to packet headers of data packets of the code streams of the quality hierarchy in the LYR coding and ZBP coding of the quality hierarchy.
94. The encoder according to any of the claims 57 to 93, wherein the first encoding circuit is further configured to:
and after the advanced node of the block to be coded in the mark tree is coded, updating the coding identification information of the advanced node of the block to be coded.
95. The encoder of claim 94, wherein the first encoding circuit is specifically configured to:
after the first-level advanced node of the block to be coded is coded, updating the coding identification information of the first-level advanced node and the second-level advanced node of the block to be coded into coded information; or
And after the second-level advanced node of the block to be coded is coded, updating the coding identification information of the second-level advanced node of the block to be coded into coded information.
96. The encoder according to claim 94 or 95, characterized in that the encoder further comprises:
and the fifth registers are used for storing the coding identification information of the high-level node of each block to be coded.
97. An encoding system, comprising:
the coding circuit comprises a tier-1 coding circuit and a coding circuit, wherein the tier-1 coding circuit is used for carrying out tier-1 coding on a code block of an image to be coded to obtain zero bit plane ZBP information or contained information of the code block;
a memory for storing ZBP information or inclusion information of the code block;
the encoder of any of claims 47-96, configured to retrieve ZBP information or inclusion information for the codeblock from the memory, and to construct a token tree from the ZBP information or inclusion information for the codeblock, and to encode the codeblock in parallel, resulting in a ZBP encoding and a layer LYR encoding of the codeblock.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/093379 WO2020258189A1 (en) | 2019-06-27 | 2019-06-27 | Encoding method, encoder, and encoding system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111699687A true CN111699687A (en) | 2020-09-22 |
Family
ID=72476319
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201980009151.4A Pending CN111699687A (en) | 2019-06-27 | 2019-06-27 | Encoding method, encoder and encoding system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111699687A (en) |
WO (1) | WO2020258189A1 (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1442807A (en) * | 2003-04-07 | 2003-09-17 | 西安交通大学 | VLSI designing method of TAGTREE encoder |
US6915015B1 (en) * | 2000-03-21 | 2005-07-05 | Hewlett-Packard Development Company, L.P. | Apparatus for and method for SNR scalable quad-tree bit-plane coding |
CN101360242A (en) * | 2008-09-22 | 2009-02-04 | 西安电子科技大学 | Tag-tree encoding method based on JPEG2000 |
CN102771125A (en) * | 2009-12-10 | 2012-11-07 | Sk电信有限公司 | Encoding / decoding method and apparatus using a tree structure |
CN108513130A (en) * | 2017-12-29 | 2018-09-07 | 西安电子科技大学 | A kind of realization system and method for Tag-Tree codings |
-
2019
- 2019-06-27 WO PCT/CN2019/093379 patent/WO2020258189A1/en active Application Filing
- 2019-06-27 CN CN201980009151.4A patent/CN111699687A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6915015B1 (en) * | 2000-03-21 | 2005-07-05 | Hewlett-Packard Development Company, L.P. | Apparatus for and method for SNR scalable quad-tree bit-plane coding |
CN1442807A (en) * | 2003-04-07 | 2003-09-17 | 西安交通大学 | VLSI designing method of TAGTREE encoder |
CN101360242A (en) * | 2008-09-22 | 2009-02-04 | 西安电子科技大学 | Tag-tree encoding method based on JPEG2000 |
CN102771125A (en) * | 2009-12-10 | 2012-11-07 | Sk电信有限公司 | Encoding / decoding method and apparatus using a tree structure |
CN108513130A (en) * | 2017-12-29 | 2018-09-07 | 西安电子科技大学 | A kind of realization system and method for Tag-Tree codings |
Non-Patent Citations (2)
Title |
---|
徐伟哲: "JPEG2000编码器中EBCOT的VLSI设计", 《中国优秀硕士论学位论文全文数据库(电子期刊) 信息科技辑》 * |
王伊洛: "EBCOT中T2编码器的VLSI设计", 《中国优秀硕士论学位论文全文数据库(电子期刊) 信息科技辑》 * |
Also Published As
Publication number | Publication date |
---|---|
WO2020258189A1 (en) | 2020-12-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Muthukumaran et al. | The performances analysis of fast efficient lossless satellite image compression and decompression for wavelet based algorithm | |
US11470322B2 (en) | Method and apparatus for image compression | |
RU2417518C2 (en) | Efficient coding and decoding conversion units | |
US5818877A (en) | Method for reducing storage requirements for grouped data values | |
TWI344797B (en) | System and method for compressing digital data | |
US6345126B1 (en) | Method for transmitting data using an embedded bit stream produced in a hierarchical table-lookup vector quantizer | |
US8942502B2 (en) | Parallelization of variable length decoding | |
KR101041973B1 (en) | Flag encoding method, flag decoding method, and apparatus thereof | |
KR20110102451A (en) | Fast parsing of variable-to-fixed-length codes | |
KR102123620B1 (en) | Method and apparatus for entropy encoding or entropy decoding of video signals for large-scale parallel processing | |
EP1946246A2 (en) | Extended amplitude coding for clustered transform coefficients | |
US20070133677A1 (en) | Method and apparatus for encoding and decoding video signals on group basis | |
CN113228668A (en) | Entropy coding for signal enhancement coding | |
CN1726644B (en) | Apparatus and method for multiple description encoding | |
Mobasseri et al. | Watermarking of MPEG-2 video in compressed domain using VLC mapping | |
EP1333679B1 (en) | Data compression | |
US9344720B2 (en) | Entropy coding techniques and protocol to support parallel processing with low latency | |
CN111656784A (en) | Decoding method, decoder and decoding system | |
KR100858245B1 (en) | Recorded medium having program for coding and decoding using bit-precision, and Apparatus there of | |
US20140092987A1 (en) | Entropy coding techniques and protocol to support parallel processing with low latency | |
Taubman et al. | FBCOT: a fast block coding option for JPEG 2000 | |
US20220109891A1 (en) | Features of range asymmetric number system encoding and decoding | |
CN111699687A (en) | Encoding method, encoder and encoding system | |
JP4727669B2 (en) | LASeR binary representation point sequence encoding / decoding method and apparatus | |
Gupta et al. | Image Compression Using Lossless Compression Techniques |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20200922 |
|
WD01 | Invention patent application deemed withdrawn after publication |