WO2020258189A1 - 编码方法、编码器和编码*** - Google Patents

编码方法、编码器和编码*** Download PDF

Info

Publication number
WO2020258189A1
WO2020258189A1 PCT/CN2019/093379 CN2019093379W WO2020258189A1 WO 2020258189 A1 WO2020258189 A1 WO 2020258189A1 CN 2019093379 W CN2019093379 W CN 2019093379W WO 2020258189 A1 WO2020258189 A1 WO 2020258189A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
coded
information
zbp
reference information
Prior art date
Application number
PCT/CN2019/093379
Other languages
English (en)
French (fr)
Inventor
任子木
张健华
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN201980009151.4A priority Critical patent/CN111699687A/zh
Priority to PCT/CN2019/093379 priority patent/WO2020258189A1/zh
Publication of WO2020258189A1 publication Critical patent/WO2020258189A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods 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/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods 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/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods 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/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/63Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using sub-band based transform, e.g. wavelets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods 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/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods 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/96Tree coding, e.g. quad-tree coding

Definitions

  • This application relates to the field of image decoding, and more specifically, to an encoding method, an encoder, and an encoding system.
  • JPEG Joint Photographic Experts Group
  • JPEG 2000 Joint Photographic Experts Group 2000 are commonly used image coding standards.
  • JPEG 2000 uses wavelet transform and performs entropy coding based on optimized interception of embedded block coding (embedded block coding with optimized truncation, EBCOT), which has a higher compression ratio than JPEG, and supports progressive download and display.
  • EBCOT embedded block coding with optimized truncation
  • Tagtree encoding is used in the JPEG 2000 standard to implement code stream organization, but the traditional tagtree encoding process is to first determine the encoding value of each code block, and then merge them together to form the final encoding value.
  • This implementation method The operation speed is slow and the time complexity is high, usually O(n 2 ), where n is the total number of code blocks, which becomes the bottleneck of system performance.
  • the present application provides an encoding method, an encoder, and an encoding system, which can reduce the time complexity of tagtree encoding, thereby improving system performance.
  • an encoding method including: obtaining zero-bit plane ZBP information or inclusion information of each block to be encoded in a set of blocks to be encoded; constructing an identifier according to the ZBP information or inclusion information of each block to be encoded Tree, and encode the tag tree in parallel.
  • an encoder including:
  • a tree building circuit for constructing an identification tree according to the ZBP information or included information of each block to be coded
  • the encoding circuit is used to encode the tag tree in parallel when the tree building circuit constructs the tag tree.
  • an encoding system including: the encoder of the second aspect.
  • a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, which when run on a computer, cause the computer to execute the method described in the first aspect.
  • a computer program product containing instructions which when run on a computer, causes the computer to execute the method described in the first aspect.
  • the technical solution of the embodiment of the present application constructs a flag tree according to the ZBP information or information contained in each block to be coded in the set of blocks to be coded, and simultaneously encodes the blocks to be coded in the flag tree in parallel, which is beneficial to improve coding efficiency. Thereby improving system performance.
  • Figure 1 is a coding framework diagram of JPEG 2000.
  • Figure 2 is a schematic diagram of the data packet structure obtained by encoding.
  • Fig. 3 is a schematic structural diagram of an encoder provided by an embodiment of the present application.
  • Fig. 4 is a schematic diagram of the principle of wavelet transform of image blocks.
  • Fig. 5 is a schematic diagram of a typical structure of a flag tree in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of the composition structure of a tree-building circuit according to an embodiment of the present application.
  • Figure 7 is a schematic diagram of a flag tree.
  • FIG. 8 is a schematic diagram of the composition and structure of a first encoding circuit in an embodiment of the present application.
  • FIG. 9 is a schematic diagram of the composition structure of a third encoding circuit in an embodiment of the present application.
  • Fig. 10 is a schematic structural diagram of a decoder provided by an embodiment of the present application.
  • Figure 11 is a schematic diagram of the reconstruction process of tagtree.
  • FIG. 12 is a schematic flowchart of an encoding method provided by an embodiment of the present application.
  • This application can be applied to the field of image coding and decoding, video coding and decoding, hardware video coding and decoding, dedicated circuit video coding and decoding, and real-time video coding and decoding.
  • the encoder provided in this application can be used to perform lossy compression (lossy compression) on an image, and can also be used to perform lossless compression (lossless compression) on an image.
  • the lossless compression can be a visually lossless compression (visually lossless compression) or a mathematically lossless compression (mathematically lossless compression).
  • the coding framework of JPEG 2000 may include a preprocessing module 12, a transformation module 14, a quantization module 16, and an EBCOT module 18.
  • the preprocessing module 12 may include a slice processing module 120, a component transformation module 122, and a direct current level shift module 124.
  • the segmentation processing module 120 is used to segment the original image to obtain a certain number of image blocks (tile), or image segments, and each image block can be coded as an independent source image.
  • the image block may be rectangular blocks of equal size and non-overlapping each other, for example, may be 512 ⁇ 512 (units are pixels), and the embodiment of the present application does not specifically limit the size of the image block.
  • the component transformation module 122 may perform a certain transformation on the components of the image to reduce the correlation between the components. For example, the component transformation module 122 can transform each component of the image from the current color domain to another color domain.
  • the component transformation module 122 may support multiple color transformation modes. Therefore, the component transformation module 122 may sometimes be referred to as a multi-mode color transform (MCT) module.
  • MCT multi-mode color transform
  • the component transform module 122 may support irreversible color transform (ICT) or reversible color transform (RCT). It should be noted that the component transformation module 122 is optional. In the actual encoding process, it is also possible to directly perform subsequent processing without performing component transformation on the image.
  • the DC level shifting module 124 can be used to shift the center of the component values so that the component values are symmetrically distributed with respect to 0, so as to facilitate subsequent transformation operations.
  • the transform module 14 uses wavelet transform to transform each image block of the image to obtain wavelet coefficients of subbands.
  • the quantization module 16 may be used to quantize the wavelet coefficients of the subbands to obtain the quantized wavelet coefficients of the subbands.
  • the EBCOT module 18 is the entropy coding module of JEPG 2000, and belongs to the core module of JEPG 2000.
  • the EBCOT module 18 may include a tier-1 encoding module 182 and a tier-2 encoding module 184.
  • the tier-1 encoding module 182 can be used to perform tier-1 encoding on a code block (the subband can be further divided into multiple independent code blocks).
  • Tier-1 coding can include bit-plane coding and arithmetic coding.
  • the tier-2 encoding module 184 is mainly responsible for the organization of the code stream, such as truncating the code stream of the code block according to a specific code rate.
  • the tier-2 encoding module 184 mainly adopts a post-compression rate-distortion optimization (PCRD) algorithm for code rate control.
  • PCCD post-compression rate-distortion optimization
  • the tier-2 encoding module 184 can calculate the rate distortion according to the rate and distortion of each bit stream (that is, the code stream (pass) of each code block) output by the tier-1 encoding module 184. Slope.
  • the rate-distortion slope can be used to evaluate the contribution of the current code block to the entire image block.
  • the rate-distortion slope can be used for subsequent code stream organization, such as code stream layering and truncation.
  • the code stream of the code block can be processed according to the target code rate and the rate-distortion slope.
  • the code stream of the code block can be truncated according to the target code rate and the rate-distortion slope.
  • the code streams of multiple code blocks can be reorganized, code streams are layered, and so on.
  • the code stream of the code block in the image block can form a group of data packets.
  • the data packet consists of a packet header and an optimized truncated bit stream.
  • the information contained in the code block is listed in the order of the code blocks. (code block inclusion information), zero bit plane (Zero bit plane, ZBP) information, the number of coding channels, the interception length information of the included code block and other information are encoded to form the packet header information.
  • the packet body is immediately followed by the packet header, which includes the code The bit stream to which the block is intercepted.
  • Figure 2 shows the schematic diagram of the structure of the encoded data packet, where H b,n represents the header information of the nth code block of subband b, and I in H b,n is the coded value of the information contained in the code block ,
  • N is the coding value of the ZBP information, corresponding to the ZBP coding below
  • P is the coding value of the number of coding channels
  • L is the coding value of the included code block interception length L
  • zero means the Whether the data packet is a null data packet
  • B b,n represents the bit stream of the nth code block of the subband b.
  • the bit stream of the code block may be intercepted to different quality layers, that is, the bit stream of each code block can contribute to one or more layers of the output code stream.
  • the quality layer where the code block was intercepted for the first time can be taken as the included information of the code block. For example, if cb0, cb1, cb2, cb3, cb5 appear for the first time in quality layer 0, and cb4 appears for the first time in quality layer 1, then The inclusion information of cb0 to cb5 is 000010 respectively. If the quality layer number is L and the inclusion information is L, it means that the code block is not included in the compressed code stream.
  • a bit plane is formed.
  • the maximum number of bit planes is M. Not all bit planes are coded during actual coding. If the ZBP information is N, the actual coded bit plane is MN, where , ZBP information can be used to indicate the position of the zero bit plane.
  • the specific position of the zero bit plane usually corresponds to the code block. That is, each code block corresponds to one ZBP information.
  • the tagtree encoder is a typical encoder of the tier-2 encoding module. It uses the tagtree algorithm to encode the included information and ZBP information of the code block. The specific process is as follows:
  • each group points to a higher-level node, and then continue to group these high-level nodes until there is only one node, which is called the root node.
  • Nodes of different levels form a tree, which can be called a tag tree, or tagtree.
  • each node on the tree is coded. Specifically, the root node is coded first, and then coded down to the lowest leaf node. That is to say, when encoding, you need to calculate the encoding value of each code block, and then combine the encoding values of each code block to obtain the final encoding value.
  • the time complexity of encoding is relatively high, usually O(n 2 ), Wherein, n is the number of blocks to be encoded. For example, encoding a component containing 64 code blocks requires 3000-4000 clock cycles (cycle), high power consumption, and consumption of logic resources.
  • the embodiments of the present application provide an encoder that can implement efficient tagtree encoding.
  • the time complexity of tagtree encoding can be reduced to O(n). For example, for encoding a component containing 64 code blocks Only 60-70 cycles are needed, which can reduce power consumption and consumption of logic resources.
  • FIG. 3 is a schematic structural diagram of an encoder 20 provided by an embodiment of the application.
  • the encoder 20 may include: a tree building circuit 22, a first encoding circuit 24, and a second encoding circuit 26.
  • the tree building circuit 22 is used to build a corresponding tag tree (tagtree) according to the ZBP information or the included information of the block to be encoded. It can be understood that the block to be coded constitutes the leaf node of the marker tree, and the tree building process is the process of generating the parent node and ancestor node of the leaf node.
  • the block to be coded may be called a leaf node, or level 0 node, a first-level node, etc.; a higher-level node of the block to be coded may be called a parent node, a level 1 node, or The second-level node, the first-level high-level node; the root node of the tree can be called the ancestor node or level 2 node, or the third-level node, the second-level high-level node.
  • the tree-building circuit 22 may obtain the ZBP information or information contained in the block to be coded from an external memory. In other embodiments, the tree-building circuit 22 may also obtain the ZBP information from the register output by the upper-level processing circuit. The ZBP information or contained information of the block to be coded. For example, the tree-building circuit 22 can obtain the ZBP information or contained information of the block to be coded from an external memory or a register output by the previous processing circuit through a reading circuit. The example does not limit the method of obtaining the information of the block to be encoded.
  • the block to be coded may be a code block in a subband of an image block, that is, the encoder according to the embodiment of the present application may perform coding in units of subbands, and after coding a subband, It is possible to encode another subband until the entire image to be encoded is encoded.
  • 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 to the embodiment of the present application.
  • the number of layers of the tagtree may also be possible. For example, it can be 4 levels.
  • the root node is level 3
  • the structure of the tagtree can also be adjusted, and the tagtree can also include more cbs, or fewer cbs, etc., but the coding principle is similar. I won't repeat it here.
  • the 64 code blocks constitute the leaf nodes of the tagtree.
  • Construct 10 trees where cb of the same resolution level is used to construct the same tree, for example, cb16 to cb31 correspond to the same tree, and cb48 to cb63 correspond to the same tree.
  • cb0 to cb3 the resolution level is the highest, and no corresponding parent node is required.
  • Each cb builds a separate tree, which is recorded as the first type of flag tree. This type of flag tree has only layer 0 nodes and no layer 1 nodes And layer2 node.
  • a corresponding tree is constructed based on cb4 ⁇ cb7, cb8 ⁇ cb11, and cb12 ⁇ cb15 respectively.
  • This group of trees has layer 1 node and no layer 2 node, which is recorded as the second type of symbol tree.
  • the value of the layer 1 node may be the minimum value of a group of layer 0 nodes.
  • the value of the parent node of cb4 to cb7 may be the minimum value of the LBP information of cb4 to cb7.
  • a corresponding flag tree is constructed.
  • This group of flag trees has layer 1 node and layer 2 node, which is recorded as the third type of flag tree.
  • the layer 1 node can be generated by a group of layer 0 nodes taking the minimum value
  • the layer 2 node can be generated by a group of layer 1 nodes taking the minimum value.
  • a group of layer 0 nodes and layer 1 nodes constitute a subtree in this tree, that is, the third type tree may include four subtrees, which are respectively recorded as the first subtree. Tree, second subtree, third subtree and fourth subtree.
  • the minimum value of cb16, cb17, cb20, and cb21 can be used to generate the value of the layer 1 node corresponding to the four layer 0 nodes, and the other three groups can be determined in the same way The value of the layer 1 node corresponding to the layer 0 node, and then take the minimum value according to this group of layer 1 nodes to obtain the value of the layer 2 node of this tree.
  • the tree building circuit 22 may include multiple registers for caching the ZBP information of the leaf nodes, parent nodes, and ancestor nodes of the multiple blocks to be encoded.
  • the tree building circuit 22 may include multiple first-level comparators for determining the value of the corresponding parent node according to the values of multiple leaf nodes, and multiple first-level comparators.
  • the secondary comparator is used to determine the value of the root node according to the values of multiple parent nodes.
  • the tree building circuit 22 may include 15 first-level comparators (denoted as Comp1_0 ⁇ Comp1_14) for comparing the value of each group of leaf nodes in the 60 leaf nodes of cb4 ⁇ cb63. Value, determine the value of the corresponding parent node, and three second-level comparators (denoted as Comp2_0 ⁇ Comp2_2), used to determine the value of the corresponding root node according to the values of a group of parent nodes.
  • first-level comparators denoted as Comp1_0 ⁇ Comp1_14
  • Comp2_0 ⁇ Comp2_2_2 three second-level comparators
  • Comp1_0 can compare cb4 ⁇ cb7 to obtain the minimum value to obtain fa0, and store fa0 in the register corresponding to fa0.
  • Comp1_14 can compare the ZBP information of cb58, cb59, cb62 and cb63 to obtain the minimum value
  • the ZBP information of fa14 and the ZBP information of fa14 are stored in the register corresponding to fa14.
  • Comp2_0 can compare the ZBP information of fa3 to fa6 to obtain the minimum value to obtain the ZBP information of fafa0, and store the ZBP information of fafa0 in the register corresponding to fafa0 Where faX represents the parent node X, and fafaX represents the ancestor node X.
  • the first step generates the layer1 node of the leaf node
  • the second step generates the layer 2 node of the leaf node.
  • the first step can pass 15 first-level comparisons.
  • the second step can be realized by three second-level comparators.
  • the first coding circuit 24 can determine the coding reference information of each block to be coded according to the ZBP information of each block to be coded in the flag tree, and the coding reference information of the block to be coded can be used to indicate the block to be coded.
  • the first encoding circuit 24 is specifically configured to:
  • the coding reference information of each block to be coded is determined.
  • the ZBP information of its parent node can be considered to be zero, or if the block to be coded has no ancestor node, the ZBP information of its ancestor node can be considered to be zero.
  • the first encoding circuit 24 is further configured to:
  • the ZBP information of each block to be coded in the flag tree the ZBP information of the parent node of the block to be coded and the ZBP information of the ancestor node of the block to be coded, combined with the coding identification of the parent node of the block to be coded
  • the information and the coding identification information of the ancestor node of the block to be coded determine the coding reference information of each block to be coded.
  • the encoding identification information of the parent node may be used to indicate whether the parent node has been encoded, and the encoding identification information of the ancestor node may be used to indicate whether the ancestor node has been encoded.
  • the block to be coded has no parent node, it can be considered that its parent node has been coded, or if the block to be coded has no ancestor node, it can be considered that its ancestor node has been coded.
  • the parent node (if any) and ancestor node (if any) of each block to be encoded can correspond to a register, which is used to indicate whether the parent node or ancestor node has been encoded.
  • the encoding identification information of the parent node and ancestor node of the block to be encoded is stored through the register. Assuming that the initial value of the encoding identification information is 0, it means that the corresponding node has not been encoded. When the node is encoded, the corresponding node The code identification information is updated to 1.
  • 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 situations:
  • Case 1 The block to be coded has no parent node, or the parent node of the block to be coded has been coded. In this case, it can be considered that the coding identification information of the parent node and the ancestor node of the block to be coded are both 1;
  • the block to be coded has a parent node, and the parent node of the block to be coded has no parent node, or the parent node of the block to be coded has a parent node, and the parent node of the block to be coded has a parent node The node has been coded.
  • the coding identification information of the ancestor node of the block to be coded is 1;
  • Case 3 The block to be coded has a parent node, and the parent node of the parent node of the block to be coded has not been coded. In this case, it can be considered that the coding identification information of the parent node and the ancestor node of the block to be coded are both 0 .
  • the ZBP coding of the block to be coded may include the code value of the block to be coded.
  • the ZBP coding of the block to be coded may include the code value of the block to be coded and its parent node.
  • the ZBP coding of the block to be coded may include the coding values of the block to be coded and its parent node and root node.
  • whether the parent node and the root node of the block to be coded have been coded can be determined according to the order of appearance of the block to be coded in the tree.
  • the parent node of the first block to be coded if the first block to be coded appears first in the second type of tree, the parent node of the first block to be coded has not been coded, Encoding the first block to be encoded will simultaneously encode the parent node of the first block to be encoded. After the encoding is completed, the parent node of the first block to be encoded is marked as encoded, and the encoding is the same as the first block to be encoded. When it is judged that the corresponding parent node has been coded for other blocks to be coded in a flag tree, the parent node may not be coded.
  • the parent node and ancestor node of the second block to be coded are not After encoding, encoding the second block to be encoded will simultaneously encode the parent node and ancestor node of the first block to be encoded.
  • the parent node and ancestor node of the second block to be encoded are both marked as encoded, and then When coding the third to-be-coded block belonging to the same subtree as the second to-be-coded block, since the third to-be-coded block and the second to-be-coded block correspond to the same parent node and ancestor node, only the third block to be coded can be coded
  • the parent node and root node are not coded; or when the fourth block to be coded belongs to the same tree and belongs to a different subtree as the second block to be coded, the fourth block to be coded and the second block to be coded are The coding block corresponds to the same ancestor node but corresponds to a different parent node.
  • the ancestor node may not be coded. Whether to encode the parent node of the fourth block to be coded can be determined according to the coding identification information of the parent node of the fourth block to be coded If the fourth block to be coded appears first in its corresponding subtree, its corresponding parent node can be coded, otherwise, its corresponding parent node is not coded.
  • the encoded parent node and ancestor node can be marked during the encoding process, thereby avoiding repeated encoding of the same parent node and ancestor node, which is beneficial to reduce the time complexity of tagtree encoding .
  • the coding reference information of the block to be coded may include first reference information (denoted as cnt0), second reference information (denoted as cnt1) and third reference information (denoted as cnt1) cnt2), wherein the first reference information is used to indicate the relationship between the ZBP information of the block to be coded and its parent node, and the second reference information is used to indicate the relationship between the parent node of the block to be coded and the The relationship between the ZBP information of the parent node of the parent node, and the third reference information is used to indicate the ZBP information of the root node of the block to be encoded.
  • first reference information is used to indicate the relationship between the ZBP information of the block to be coded and its parent node
  • the second reference information is used to indicate the relationship between the parent node of the block to be coded and the The relationship between the ZBP information of the parent node of the parent node
  • the third reference information is used to indicate the ZBP information of the root node of the block to
  • ZBP fafa is the ZBP information of the ancestor node of the block to be encoded
  • the ZBP fa is the ZBP information of the parent node of the block to be encoded
  • the ZBP cb is the ZBP information of the block to be encoded.
  • the ZBP information ZBP fa of the parent node of the block to be coded can be taken as zero; or, if the parent node of the block to be coded does not have a parent node, then When calculating the second reference information, the ZBP information ZBP fafa of the ancestor node of the block to be coded can be taken as zero.
  • the first encoding circuit 24 may include a data selector (MUX) and a calculation unit, where the calculation unit is used to calculate each block to be encoded.
  • the MUX is used to calculate the first reference information of the block to be coded, and when the second reference information and the third reference information are selected, the parent corresponding to the block to be coded is selected. Node and root node to obtain the ZBP information of the corresponding parent node and root node.
  • the first encoding circuit 24 may also include multiple registers for determining the first reference information, second reference information, and third reference information of each block to be encoded. After that, the first reference information, the second reference information and the third reference information of each block to be encoded are stored in the corresponding register, so that the second encoding circuit 26 can obtain the first reference information of the block to be encoded from the register , The second reference information and the third reference information, and according to the first reference information, the second reference information and the third reference information, the ZBP coding of the block to be coded is determined.
  • the second encoding circuit 26 may splice the three encoding values of the block to be encoded to obtain the ZBP encoding of the block to be encoded, for example, according to the third reference information, the second reference information Splicing with the order of the first reference information to obtain the ZBP coding of the block to be coded, or it can also be spliced in the order of the first reference information, the second reference information and the third reference information to obtain the ZBP of the block to be coded For encoding, you only need to adjust the corresponding decoding algorithm.
  • 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.
  • the second reference information or the third reference information is NULL in the ZBP encoding. ), that is, no bits are occupied, that is, the ZBP coding of the block to be coded does not include the coding value of the parent node or ancestor node of the block to be coded, which can reduce the occupation of storage space.
  • 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 the splicing of the binary codes to obtain ZBP coding of the block to be coded.
  • 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.
  • the number of zeros in the binary code is the difference between the ZBP information of the block to be coded and its parent node.
  • 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, then The converted binary code is 1.
  • the number of zeros in the binary code corresponding to the first reference information can represent the difference between the leaf node of the block to be coded and the parent node ZBP information of the block to be coded
  • the number of zeros in the binary code corresponding to the second reference information can be It represents the difference between the ZBP information of the parent node of the block to be coded and the parent node of the parent node
  • the number of zeros in the binary code corresponding to the third reference information represents the ZBP information of the ancestor node of the block to be coded.
  • the ZBP information of the parent node and the ancestor node follows the code block that appears for the first time in the flag tree, that is, in the flag tree
  • the ZBP code of the first code block includes the ZBP information of its parent node and ancestor node.
  • the corresponding binary codes can be obtained as 001, NULL, and NULL respectively, and then the ZBP code of the cb0 can be obtained as 001 by splicing.
  • the encoder of the embodiment of the present application when encoding each block to be encoded, only the parent node and ancestor node that have not been encoded are encoded, instead of encoding the parent node and ancestor node of each block to be encoded , Can reduce the time complexity of coding, and can reduce the consumption of logic resources at the same time.
  • the second encoding circuit 26 may include:
  • the code value combination unit is used to convert the first reference information, the second reference information and the third reference information of the block to be coded into the third binary code, the second binary code and the first binary code respectively Performing codeword splicing to obtain the ZBP code of the block to be coded;
  • Multiple registers are used to buffer the ZBP coding of each block to be coded for subsequent processing.
  • the third coding circuit 28 separates the ZBP coding of the block to be coded to obtain the quality of each block to be coded.
  • Layered layer (Layer, LYR) coding Layered layer (Layer, LYR) coding.
  • the code block can appear in one or more layers in the quality layer, and the ZBP coding of the block to be coded may include the coding value of the block to be coded in each quality layer. Therefore, the The ZBP coding of the block to be coded is separated, and the LYR coding of the block to be coded in each quality layer can be determined.
  • the encoder 20 may further include:
  • the third coding circuit 28 is configured to determine the LYR coding of the block to be coded in each quality layer according to the ZBP coding of the block to be coded.
  • the block to be coded corresponds to 8 layer information, and each layer information corresponds to one LYR code.
  • the LYR code can be used to determine the first layer of quality of the block to be coded, that is, first layer information.
  • the third encoding circuit 28 is specifically configured to:
  • the current quality layer is i, and the current ZBP code is X, starting from the highest bit of the current ZBP code, search for the position of the first zero in the current ZBP code, the first zero and the bits before the first zero Bit as the LYR code of the current quality layer i, then remove the first zero in the current ZBP code and the bit before the first zero, and use the shifted ZBP code as the next quality score Layer ZBP encoding, then add 1 to the quality layer, and repeat the above process.
  • the ZBP code can be used as the LYR code of the current quality layer.
  • the third encoding circuit 28 may include:
  • K processing units including processing unit 0 to processing unit K-1, are used to determine the LYR coding of the block to be coded in each of the K quality layers;
  • K registers including registers 0 to K-1, are used to buffer the processing results output by the K processing units, and the processing results may include the LYR encoding of the block to be encoded in the quality layer and the shifted ZBP encoding .
  • the ZBP code of cb16 is 0100101, and there are 5 quality layers in total to illustrate the process of determining the LYR code of cb16 in each quality layer:
  • Stage 0 determine the LYR code of quality layer 0;
  • the processing unit 0 first obtains the ZBP code of the cb16 from the register of the second coding circuit 26;
  • the first zero and the bits before it are shifted, and the shifted ZBP code is 100101.
  • the LYR code 0 and the shifted ZBP code 100101 are buffered in register 0.
  • the register 0 may include two registers for buffering the LYR code 0 and the shifted ZBP code 100101 respectively;
  • Stage 1 determine the LYR code of quality layer 1;
  • the processing unit 1 obtains the current ZBP code from register 0 as 100101;
  • the LYR code 10 and the updated ZBP code 0101 are stored in register 1 and cached in register 1.
  • the register 1 may also include two registers, which are respectively used to cache the quality layered LYR code And the ZBP code after shifting;
  • Stage 2 determine the LYR code of quality layer 2;
  • the processing unit 2 obtains the current ZBP code as 0101 from the register 1;
  • the LYR code 0 and the updated ZBP code 101 are stored in register 2.
  • the register 2 may also include two registers for buffering the quality layered LYR code and the shifted ZBP code;
  • Stage 3 determine the LYR code of quality layer 3
  • the processing unit 3 obtains the current ZBP code as 101 from the register 2;
  • the LYR code 10 and the updated ZBP code 1 are stored in the register 3.
  • the register 3 may also include two registers for buffering the quality layered LYR code and the shifted ZBP code;
  • Stage 4 determine the LYR code of quality layer 4;
  • the processing unit 4 obtains the current ZBP code as 1 from the register 3;
  • the processing unit 4 determines that the current ZBP code of cb16 is all 1, and uses the current ZBP code as the code value of the current quality layer 4. That is, the LYR code of cb16 in quality layer 4 is 1, and the LYR code 1 is further cached in the register 4 in.
  • the LYR coding of the first layer of the code block if the bit 0 of the LYR coding is 1, the LYR coding of the code block in other subsequent quality layers may not be determined.
  • the first layer of cb16 is quality layer 1, that is, the cb16 appears in the first layer of quality layer 1, and its LYR code in this layer is 10, and bit 0 indicates that the cb16 is in the next quality.
  • Layered containment information The bit is set to 1, indicating that the cb16 is included in the next quality layer, and the bit is set to 0, which indicates that the cb16 is not included in the next quality layer. When the bit is set to 1, you can Do not continue to determine the LYR coding of the cb in other layers.
  • the third encoding circuit can implement parallel processing of the ZBP encoding of multiple code blocks through multiple processing units and multiple registers, and can reduce the time complexity of tagtree encoding.
  • the encoding process in the embodiments of the present application mainly includes a tree building process, a first encoding process, a second encoding process, and a third encoding process.
  • the tree building process can establish a corresponding mark tree according to multiple code blocks to be encoded. That is, the information of the parent node and the ancestor node of the block to be encoded is determined.
  • the first encoding process is used to determine the first reference information, the second reference information and the third reference information of the block to be encoded.
  • the first reference information, the second reference information and the third reference information of the block determine the ZBP coding of the block to be coded.
  • the third coding process is used to determine the block to be coded in each quality layer according to the ZBP coding of the block to be coded.
  • LYR encoding is used to determine the block to be coded in each quality layer according to the ZBP coding of the block to be coded.
  • the foregoing encoding process can be performed using pipelines, which can improve the utilization of logic resources and reduce the time consumption of encoding, for example, through the establishment circuit, the first encoding circuit, the second encoding circuit, and the third encoding circuit.
  • the encoding circuit performs parallel encoding processing on the block to be encoded. For example, since there is no need to calculate the value of the parent node of cb0 ⁇ cb3, it can generate cb0 ⁇ cb3 in parallel while constructing the layer 1 node and layer 2 node of cb4 ⁇ cb63.
  • ZBP coding can improve coding efficiency.
  • the code blocks of a plurality of subbands are processed in parallel by the foregoing circuit.
  • the encoder 20 may further include at least one of the following:
  • the transform circuit is used to perform wavelet transform on the image block to be coded
  • the tier-1 encoding circuit is used to perform tier-1 encoding on the code block of the image block to obtain the code stream of the code block.
  • the encoder 20 may also encode information such as the number of encoding channels of the code block and the interception length of the included code block, and the specific encoding method may adopt an existing encoding method. I won't repeat it here.
  • the ZBP code of the code block will be stored in the header of the data packet corresponding to the quality layer that the code block first appears.
  • the LYR code of each layer of the code block will be stored in the corresponding quality layer.
  • the specific storage sequence is shown in Figure 2.
  • the ZBP information of the code block is encoded, and the ZBP encoding of the code block is not included in the other quality layers that appear in the code block. Therefore, the The ZBP coding of a code block must first determine the quality layer that the code block appears for the first time, that is, the first layer information.
  • FIG. 10 is a schematic structural diagram of a decoder according to an embodiment of the present application. As shown in FIG. 10, the decoder 80 may include:
  • the first layer parsing circuit 82 is used to determine the first layer information of the code block to be decoded according to the LYR encoding of the code block, that is, in which quality layer the code block to be decoded is the first layer Once appears, that is, the I in the packet header shown in Figure 2 is parsed.
  • the ZBP parsing circuit 83 is used to analyze the ZBP code of the code block to be decoded in the first layer of the code block to be decoded to determine the ZBP information of the code block to be decoded, that is, to analyze the N in the packet header shown in FIG. 2 .
  • the encoder 80 may further include:
  • the code stream reading circuit is used to read the code stream data to be decoded.
  • an advanced extensible interface AXI
  • AXI advanced extensible interface
  • the decoder 80 may also perform alignment processing on the code stream data to facilitate subsequent processing by the parsing circuit.
  • the decoder 80 may further include at least one of the following circuits:
  • the channel number analysis circuit 84 is used to decode the number of encoding channels of the code block to be decoded, that is, to analyze the P in the packet header shown in FIG. 2;
  • the interception length analysis circuit 85 is used to analyze the interception length of the contained code block of the code block to be decoded, that is, to analyze the L in the packet header shown in FIG. 2;
  • the packet body parsing circuit 86 is used for parsing the bit stream of the code block to be decoded, that is, parsing B b,n in the packet body shown in FIG. 2;
  • the packet body extraction circuit 87 is used to reorganize the decoded data parsed by the packet body analysis circuit 86 and store the organized data in the memory, so that the subsequent circuit can further process the data.
  • the decoder 80 may further include at least one of the following:
  • An inverse quantization circuit for inversely quantizing the data output by the packet body extraction circuit 87;
  • the inverse transform circuit is used to inversely transform the data output by the inverse quantization circuit.
  • the inverse transform can be discrete wavelet inverse transform.
  • the output circuit is used to write the data output by the inverse conversion circuit into an external memory.
  • the data output by the inverse conversion circuit can be written to an external memory through AXI.
  • the decoder 80 may further include:
  • the control circuit 81 is used to control the working state of at least one of the first layer analysis circuit 82, the LBP analysis circuit 83 and the channel number analysis circuit 84, the interception length analysis circuit 85, the packet body analysis circuit 86, and the packet body extraction circuit 87 .
  • the control circuit 81 can be used to control the activation of the corresponding circuit to work according to the information of the parsed code stream.
  • control circuit 81 first judges whether the data packet is an empty packet according to the zero in the header of the data packet. If it is an empty packet, it waits for a new code stream; otherwise, it activates the first layer analysis circuit 82 to perform first Layer analysis, that is, to determine whether the code block is in the current quality layer. If the code block is in the current quality layer, the ZBP analysis circuit 83 is activated to perform ZBP decoding on the code block. After the ZBP decoding is completed, the channel number analysis circuit 84 and the interception length analysis circuit 85 can be further activated, respectively The number of coding channels and the interception length of the contained code block are decoded, and the above process is performed cyclically.
  • the packet body analysis circuit 86 is activated to analyze the packet body in the data packet, The bit stream information included in the code block is obtained, and then the packet body extraction circuit 87 is activated to reorganize the parsed bit stream and buffer it in the memory.
  • the third encoding circuit of the encoder can separate the ZBP encoding of the code block to obtain the LYR encoding of the code block in each quality layer.
  • the LYR encoding of the code block is finally included in the corresponding quality layer. Therefore, by parsing the header of a quality-layered data packet, it is possible to know the inclusion information of the code block in the quality layer, that is, whether the code block is included in the quality layer.
  • the first layer analysis circuit 82 may analyze the LYR code of the code block in the current quality layer to determine whether the current quality layer is the first layer of the code block.
  • the first layer analysis circuit 82 may include:
  • Multiple first layer registers are used to buffer the first layer information of each block to be decoded.
  • cb0 ⁇ cb63 each correspond to a register for storing the first layer information of cb
  • fa0 ⁇ fa14 each correspond to a register for storing the first layer information of the parent node of cb
  • fafa0 ⁇ fafa2 each correspond to a register for storing The first layer information of the ancestor node of cb.
  • each block to be decoded may also correspond to one piece of encoding identification information, which is used to indicate whether the node to be encoded has been encoded.
  • the parent node or ancestor node of each block to be decoded may also correspond to a piece of encoding identification information, which is used to indicate whether the parent node or ancestor node of the block to be encoded has been encoded.
  • the block to be decoded and the encoding identification information of the parent node or ancestor node of the block to be encoded may be stored in a corresponding register.
  • a register value of 0 indicates that the block to be decoded has not been coded
  • a register value of 1 indicates that the block to be decoded has been coded
  • the coding identification information of the block to be decoded is initially 0, and in the process of decoding according to the order of quality hierarchical from low to high, the to-be-coded is determined according to the LYR encoding in each quality hierarchical data packet in turn Whether the block has been coded in each quality layer, if the block to be coded appears for the first time in a certain quality layer, the coding identification information of the block to be coded is updated from 0 to 1, and the quality layer As the first layer of the block to be encoded, it is stored in the corresponding first layer register.
  • the LYR of the code block to be decoded is parsed to 0 when parsing the header of a data packet of a certain quality layer, it means that the code block to be decoded does not appear in the quality layer.
  • a certain number of code blocks need to be skipped, that is, it is not necessary to perform first layer analysis on this part of the code blocks.
  • the number of code blocks that need to be skipped can be based on the storage order of the code blocks in the data packet to be parsed, marking the tree
  • the sequence of the code block is determined by the code identification information of the parent node and root node of the code block.
  • the parent node of the code block has not been coded, it can be considered that other leaf nodes of the parent node in the tagtree also do not appear in the quality layer, because if other leaf nodes appear in the quality layer, the parent Nodes must have been encoded, in this case, these leaf nodes can be skipped.
  • the leaf node of the ancestor node does not appear in the quality layer in the tagtree, because if other leaf nodes appear in the quality layer, the ancestor Nodes must have been encoded, in this case, these leaf nodes can be skipped.
  • the code blocks are stored in the code stream in the order of the number of the code blocks.
  • the order of the code blocks is cb16, cb17, cb18, cb19, cb20, cb21... cb30, cb31; and in the logo tree, they are not stored in this order.
  • cb16, cb17, cb20, and cb21 are a group
  • cb18, cb19, cb22 and cb23 are a group
  • cb24, cb25, cb28, and cb29 are a group
  • cb26, cb27, cb30, and cb31 are a group, that is, the number of cb in each group is not continuous.
  • the LYR code corresponding to any code block from cb16 to cb31 is parsed to 0 (denoted as case 1), indicating the number of code blocks that need to be skipped, cur_cb represents the number of the current code block to be decoded, and add_cb represents the need
  • the number of skipped code blocks can specifically include the following situations:
  • cb16 has not appeared in the current quality layer, and its ancestor node has not been coded in the quality layer, it means that none of the code blocks in the tree where the cb16 is located has appeared in the quality layer. In this case, all code blocks in the tree can be skipped, and the code blocks in the next tree (that is, the tree corresponding to cb32 to cb47) can be parsed. Therefore, the next cb to be decoded is cb32;
  • cb16 has not appeared in the current quality layer, and the ancestor node of cb16 has been coded, it means that a code block has appeared in the tree where cb16 is located, which may be the code block in the first subtree in the tree. It may also be a code block in other subtrees in the tree. Further, it can be determined whether the parent node of cb16 has been coded.
  • the first subtree can be determined The code block in has not appeared in the quality layer, so the first subtree can be skipped, and the code block in the second subtree can be parsed, that is, the next cb to be decoded is cb18, or, If the parent node of the cb16 has been coded, it can be determined that a code block in the first subtree has appeared in the quality layer, and the next code block in the first subtree can be decoded, that is, to be The decoded cb is cb17.
  • the code block in the fourth subtree is analyzed, that is, the next cb to be decoded is cb26, or if the parent node of the cb24 has been coded, the third one can be determined A code block in the subtree has appeared in the quality layer, and the next code block in the third subtree can be decoded, that is, the next cb to be decoded is cb25.
  • the code block information is stored in order, for example, for cb16 to cb21, it is stored in the order of cb16, cb17, cb18, cb19, cb20, cb21, and cb22, while in tagtree, it is not stored in order Grouped, that is, cb16, cb17, cb19, and cb20 are a group, so if the parent node of cb16 is not included in this layer, the cb16, cb17, cb19, and cb20 will not be included in the current quality layer, so Introduce two identification information, skip1, used to indicate whether to skip the first subtree and the third subtree, and skip2, used to indicate whether to skip the second subtree and the fourth subtree.
  • cb18 has not appeared in the quality layer, and the parent node of cb18 has been coded, it can be determined that the code block in the second subtree where cb18 is located has appeared in the quality layer.
  • the next code block in the subtree is decoded, that is, the next code block to be parsed is cb19;
  • cb18 has not appeared in the quality hierarchy, and the parent node of cb18 has not been coded, it can be determined to skip the second subtree where the cb18 is located, and it can be determined whether skip1 is 1, that is, whether to skip If the first subtree and the third subtree are 1, it means skip, then the first code block in the third subtree will be parsed, that is, the next code block to be parsed is cb26, otherwise, It means not to skip, analyze the code block to be parsed after cb18. Because cb19 needs to be skipped, the next code block to be parsed is cb20.
  • the current code block to be decoded is cb19, it can be judged whether skip1 is 1, that is, whether to skip the first subtree and the third subtree. If it is 1, it means skip, then the next subtree in the second subtree is skipped.
  • One code block is parsed that is, the next code block to be parsed is cb22, otherwise, it means that the code block to be parsed after cb19 is not skipped, and the next code block to be parsed is cb20.
  • the current cb to be decoded is cb21, it can be judged whether skip2 is 1, that is, whether to skip the second subtree and the fourth subtree, if it is 1, it means skip, then the third subtree
  • the code block is parsed, that is, the next code block to be parsed is cb24, otherwise, it means that the code block to be parsed after cb21 is parsed, that is, the next code block to be parsed is cb22.
  • the next code block to be decoded is cb2.
  • the next code block to be decoded is cb6.
  • the next code block to be decoded is cb18.
  • the LYR code of the current code block to be decoded is parsed to 1 for the first time (denoted as case 2), in this case, it can be considered that the code block to be decoded has been coded in the current quality layer, and at the same time It can be considered that the parent node and ancestor node of the block to be coded have also been coded in the quality layer.
  • the coding identification information of the parent node and ancestor node of the block to be coded can be updated, that is, the parent node of the block to be coded And the coded identification information of the ancestor node is updated to 1.
  • the following situations can be specifically included:
  • the encoding identification information of the ancestor node fafa is 1, it is determined 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, the parent If the node has not been coded, update the coding identification information of its parent node fa to 1, or, if the coding identification information of the parent node fa is 1, it means that the parent node has been coded, and determine the coding identification information of the leaf node corresponding to cur_cb Whether it is 0, if the encoding identification information of the leaf node is 0, it means that the leaf node has not been encoded, then the encoding identification information of the leaf node is updated to 1.
  • the leaf node of the cb16 can be , The coded identification information of the parent node and ancestor node are updated to have been coded.
  • Case 2-3 For other cbs, it is determined 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, the coding identification information of the leaf node is updated to 1.
  • the coding identification information of the code block is updated from 0 to 1, it means that the code block appears for the first time in the quality layer, that is, the quality layer is the first layer of the code block.
  • the quality layer includes the ZBP code of the code block.
  • the ZBP analysis circuit 83 can analyze the ZBP code of the code block to determine the ZBP information of the leaf node corresponding to the code block.
  • the ZBP information of the parent node and the ancestor node is included in the ZBP coding of the first code block in the tree, that is, the ZBP coding of the first code block in the tree includes The ZBP information of the parent node (if there is a parent node) and the ancestor node (if there is an ancestor node) of the code block.
  • the ZBP code of the first code block in the subtree includes the ZBP information of the parent node of the code block .
  • Step 1 Determine the leaf node, parent node and ancestor node information of the first code block according to the ZBP encoding of the first code block that appears first in the tree, and decode the ZBP information of the code block according to the principle of ZBP encoding
  • the process is actually the process of finding 1 in the ZBP encoding of the code block:
  • Step 1-1 Determine the node information of the ancestor node of the first code block
  • the node information of the ancestor node can correspond to the cn2-1 mentioned above, and then shift the first 1 and the bits before the first 1, and use it as the ZBP code of the next step , Marked as ZBP code 1;
  • Step 1-2 Determine the node information of the parent node of the first code block
  • the node information of can correspond to the cn1-1 mentioned above, and then shift the first 1 and the bits before the first 1, and use it as the ZBP code of the next step, which is recorded as ZBP code 2;
  • Step 1-3 Determine the node information of the leaf node of the first code block
  • the node information of can correspond to the cn0-1 described above.
  • the ZBP information of the second code block is determined according to the ZBP code of the second code block that appears second in the tree.
  • the second code block may be the same as that of the first code block.
  • the code block does not belong to the first code block (denoted as) in other subtrees of the same subtree.
  • the ZBP encoding of the second code block includes the ZBP of the leaf node and the parent node of the second code block
  • the information may also be a code block belonging to the same subtree as the first code block.
  • the second code block only includes the ZBP information of the leaf nodes of the second code block. Take the decoding of the second code block in the first case as an example. The specific process is as follows:
  • step 2-1 starting from the highest bit of the ZBP code of the second code block, search for the first 1 in the ZBP code, and use the number of zeros before the first 1 as the second code block The node information of the parent node of, and then shift the first 1 and the bits before the first 1, and use it as the ZBP code of the next step, which is recorded as ZBP code 3;
  • step 2-2 Starting from the highest bit of the ZBP code 3, search for the first 1 in the ZBP code 3, and use the number of zeros before the first 1 as the node information of the second code block .
  • the process of rebuilding the tree of cb16 to cb31 is taken as an example to illustrate the decoding process of the ZBP information of cb. As shown in Figure 11, the tree starts as an empty tree.
  • the ZBP code of the cb25 includes the node information of the parent node and ancestor node of the cb25, and the three are separated by 1, and by constantly searching for the first occurrence of 1 Position, and determine how many zeros are in front of it, and then write the number of zeros into the corresponding register to get the node information of the ancestor node, parent node and leaf node.
  • cb18 If the third occurrence of cb is cb18, and the ancestor and parent nodes of cb18 have been decoded, you only need to decode the cb18.
  • the node information of each node in the tree can be obtained in turn.
  • the node information on the path from the leaf node of the code block to the ancestor node can be accumulated to obtain the ZBP information of the leaf node of the code block.
  • the ZBP parsing circuit may include a three-level decoding unit, a first decoding unit, a second decoding unit, and a third decoding unit, which are respectively used to determine code blocks The node information of the ancestor node, the node information of the parent node and the node information of the leaf node.
  • the ZBP parsing circuit may also include multiple registers for caching the node information of the ancestor node of the code block obtained by the analysis, the node information of the parent node and the node information of the leaf node, and the shifted code block ZBP encoding.
  • the channel number analysis circuit 84 After analyzing the ZBP encoding of the code block in the data packet, it is further possible to activate the channel number analysis circuit 84, through which the channel number analysis circuit 84 analyzes the encoding channel number information of the code block, and can also activate the interception length analysis circuit 85 Analyze the information contained in the interception length of the code block, and at the same time can activate other parsing circuits to parse other information in the packet header, which is not repeated in this embodiment of the application.
  • the packet body parsing circuit and the packet header extraction circuit can also parse the packet body part in the data packet, reorganize the decoded data obtained by the analysis, and combine The organized data is stored in the memory so that the subsequent circuit can further process the data.
  • the encoding method of the embodiment of the present application may be the encoder of the foregoing embodiment of the present application or the method used by a device including the encoder of the embodiment of the present application to implement the technical solution of the embodiment of the present application.
  • the decoding method of the embodiment of the application is the method used by the decoder of the embodiment of the application or the device including the decoder of the embodiment of the application to implement the technical solution of the embodiment of the application.
  • the following is for brevity , I won’t repeat it here.
  • FIG. 12 shows a schematic flowchart of an encoding method 400 according to an embodiment of the present application.
  • the method 400 includes:
  • S401 Obtain zero-bit plane ZBP information or inclusion information of each block to be encoded in the set of blocks to be encoded;
  • S402 Construct an identification tree according to the ZBP information or inclusion information of each block to be encoded, and encode the tag tree in parallel.
  • the method 400 further includes:
  • the ZBP information or included information of each block to be coded is stored in a register corresponding to each block to be coded.
  • the constructing an identification tree according to the ZBP information or included information of each block to be coded may specifically include:
  • the set of blocks to be coded includes 64 code blocks, numbered from 0 to 63 respectively, and the construction of an identification tree according to the ZBP information of each block to be coded includes:
  • Group the blocks to be coded numbered 4 to 7, the blocks to be coded numbered 8 to 11, and the blocks to be coded numbered 12 to 15, determine the high-level node to which each grouping points, and obtain three second-type signs tree;
  • the to-be-coded blocks numbered 16, 17, 20, 21 among the numbered blocks 16 to 31 can be grouped into a group, and the numbered blocks are 18, 19, 22, and 23.
  • the blocks to be coded are divided into one group, and the blocks to be coded numbered 26, 27, 30, and 31 are divided into one group, and the first-level advanced node of each group is determined;
  • the second-level high-level node pointed to by each group is determined, and a third-type flag tree is obtained.
  • the determining the first-level high-level node pointed to by each group includes:
  • the flag trees of other blocks to be coded in the set of blocks to be coded are constructed in parallel.
  • the encoding the tag tree includes:
  • the coding reference information of the block to be coded is determined, and the coding reference information is used to indicate the node on the path from the block to be coded to the highest node of the block to be coded and the value of the node The relationship between the ZBP information of the parent node;
  • the determining the coding reference information of the block to be coded according to the flag tree includes:
  • the flag tree determine the first reference information, second reference information, and third reference information of the block to be coded, wherein the first reference information is used to indicate the ZBP information of the block to be coded and the The relationship between the ZBP information of the first-level advanced node of the block to be encoded, and the second reference information is used to indicate the ZBP information of the first-level advanced node of the block to be encoded and the second-level information of the block to be encoded.
  • the relationship between the ZBP information of the advanced node, and the third reference information is used to indicate the information of the ZBP information of the second-level advanced node of the block to be encoded and the ZBP information of the third-level advanced node of the block to be encoded The relationship between.
  • the first reference information of the block to be coded is the difference between 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 plus 1.
  • the second reference information of the block to be encoded is the difference between the ZBP information of the first-level advanced node of the block to be encoded and the ZBP information of the second-level advanced node of the block to be encoded plus one
  • the The third reference information of the block to be encoded is the difference between the ZBP information of the second-level advanced node of the block to be encoded and the ZBP information of the third-level advanced node of the block to be encoded plus one.
  • the first reference information, second reference information, and third reference information of the block to be coded are determined according to the flag tree, including:
  • the first reference information, the second reference information and the third reference information of the block to be coded are determined.
  • Embodiment 1 If the block to be encoded does not have an advanced node, determine the first reference information of the block to be encoded according to the ZBP information of the block to be encoded, and determine the second reference information of the block to be encoded and The third reference information is zero. For example, it may be determined that the first reference information of the node to be coded is the ZBP information of the block to be coded plus one.
  • Embodiment 2 If the block to be coded has an advanced node, the first reference information, the second reference information and the third reference information of the block to be coded are determined according to the coding identification information of the advanced node of the block to be coded.
  • the first reference information of the block to be coded may be determined according to whether the block to be coded has a second-level high-level node, combined with the coding identification information of the high-level node of the block to be coded, The second reference information and the third reference information.
  • Embodiment 2.1 If the block to be encoded does not have a second-level advanced node, the first reference information, the second reference information, and the first reference information of the block to be encoded are determined according to the encoding identification information of the first advanced node of the block to be encoded Third reference information.
  • Case 1 If the first high-level node of the block to be coded has been coded, determine the first reference information of the block to be coded according to the ZBP information of the block to be coded, and determine the second reference information of the block to be coded The reference information and the third reference information are zero. For example, it may be determined that the first reference information of the node to be coded is the difference between 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 plus one.
  • Case 2 If the first high-level node of the block to be coded has not been coded, determine the block to be coded according to the ZBP information of the block to be coded and the ZBP information of the first-level high-level node of the block to be coded And determine that the third reference information of the to-be-coded block is zero. For example, it may be determined that the first reference information of the node to be encoded is the difference between the ZBP information of the block to be encoded and the ZBP information of the first-level advanced node of the block to be encoded plus one, and the The second reference information of the block is the ZBP information of the first-level advanced node of the block to be coded plus one.
  • Embodiment 2.2 If the block to be coded has a second-level high-level node, the coding identification information of the first high-level node of the block to be coded and the coding identification information of the second high-level node of the block to be coded are used to determine the The first reference information, the second reference information and the third reference information of the block to be encoded.
  • Case 1 If the first high-level node of the block to be coded has been coded, determine the first reference information of the block to be coded according to the ZBP information of the block to be coded, and determine the second reference information of the block to be coded The reference information and the third reference information are zero. For example, it may be determined that the first reference information of the node to be coded is the difference between 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 plus one.
  • Case 2 If the first high-level node of the block to be coded has not been coded, the first reference information of the block to be coded is determined according to the coding identification information of the second-level high-level node of the block to be coded, and the second Reference information and third reference information.
  • Case 2.1 If the second-level high-level node of the block to be coded has been coded, determine the block to be coded according to the ZBP information of the block to be coded and the ZBP information of the first-level high-level node of the block to be coded And determine that the third reference information of the to-be-coded block is zero.
  • the first reference information of the node to be encoded is the difference between the ZBP information of the block to be encoded and the ZBP information of the first-level advanced node of the block to be encoded plus one
  • the The second reference information of the block is the difference between the ZBP information of the first-level advanced node of the block to be encoded and the ZBP information of the second-level advanced node of the block to be encoded plus one
  • Case 2.2 If the second-level high-level section of the block to be coded has not been 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 block to be coded
  • the ZBP information of the second-level advanced node determines the first reference information, the second reference information and the third reference information of the block to be encoded. For example, it may be determined that the first reference information of the block to be coded is the difference between 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 plus one.
  • the second reference information is the difference between the ZBP information of the first-level advanced node of the block to be encoded and the ZBP information of the second-level advanced node of the block to be encoded plus one, and the third reference information of the block to be encoded Add one to the ZBP information of the second-level advanced node of the block to be coded.
  • the determining the ZBP coding of the block to be coded according to the coding reference information of the block to be coded includes:
  • the ZBP coding of the block to be coded is determined.
  • 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:
  • the third binary code, the second binary code, and the first binary code are spliced to obtain the ZBP code of the block to be coded.
  • 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 zero.
  • the second reference information and the converted second binary code have the following relationship:
  • 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.
  • the third reference information and the converted third binary code have the following relationship:
  • the third binary code is empty
  • 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.
  • the encoding the tag tree includes:
  • the LYR code of the block to be coded is used to indicate the information contained in the quality layer of the block to be coded.
  • the determining the LYR code of the block to be coded includes: determining the LYR code of the block to be coded according to the ZBP code of the block to be coded.
  • the determining the LYR code of the block to be coded according to the ZBP code of the block to be coded includes:
  • the position of the first zero in the ZBP code is searched, and the first zero and the bits before the first zero are regarded as the first LYR codes of the first quality layer; or if the ZBP codes of the block to be coded are all 1s, it is determined that the ZBP code is the LYR code of the first quality layer.
  • the first zero in the ZBP code and the bits before the first zero are removed, and the shifted ZBP code is used as the updated ZBP code of the block to be coded ;
  • the updated ZBP coding of the block to be coded determine the LYR coding of the block to be coded in the next quality layer; or if the updated ZBP code of the block to be coded is all 1s, determine the updated ZBP code
  • the ZBP encoding is the next quality layered LYR encoding, and the above process is performed cyclically.
  • the determining the LYR coding of the block to be coded in the quality layer according to the ZBP coding of the block to be coded and the quality layer of the current coding further includes :
  • the block to be coded is included in the quality layer for the first time, and the lowest bit of the LYR code of the block to be coded in the quality layer is 1, it is uncertain whether the block to be coded is Subsequent LYR coding in other quality layers.
  • the determining the LYR code of the block to be coded includes:
  • the LYR of the block to be coded in the quality layer The code is zero.
  • the method further includes:
  • the LYR encoding and ZBP encoding of the quality layered block of the to-be-encoded block obtained by encoding the quality layer are output to the header of the data packet corresponding to the quality layer.
  • the method further includes:
  • the coding identification information of the high-level node of the block to be coded in the flag tree is updated.
  • the updating the coding identification information of the advanced node of the block to be coded in the flag tree includes:
  • the encoding identification information of the second-level advanced node of the block to be encoded is updated to have been encoded.
  • the method 400 further includes:
  • the encoding identification information of the advanced node of the block to be encoded is stored in a register corresponding to the advanced node of the block to be encoded.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, a solid state disk (SSD)), etc.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

提供一种编码方法、编码器和编码***。该编码器包括:获取待编码块集合中的每个待编码块的零比特平面ZBP信息或包含信息;根据所述每个待编码块的ZBP信息或包含信息构造标识树,以及并行对所述标签树进行编码。

Description

编码方法、编码器和编码***
版权申明
本专利文件披露的内容包含受版权保护的材料。该版权为版权所有人所有。版权所有人不反对任何人复制专利与商标局的官方记录和档案中所存在的该专利文件或者该专利披露。
技术领域
本申请涉及图像解码领域,更为具体地,涉及一种编码方法、编码器和编码***。
背景技术
联合图像专家小组(joint photographic experts group,JPEG)、JPEG 2000是常用的图像编码标准。
JPEG 2000采用小波变换,并基于优化截取内嵌码块编码(embedded block coding with optimized truncation,EBCOT)进行熵编码,具有比JPEG更高的压缩比,并支持渐进式下载和显示。
tagtree编码在JPEG 2000标准中用于实现码流组织环节,但是传统的tagtree编码过程是先确定每一个码块的编码值,然后将其合并在一起,组成最终的编码值,这种实现方式的运算速度较慢,时间复杂度较高,通常为O(n 2),n为码块的总数量,成为***性能的瓶颈。
发明内容
本申请提供一种编码方法、编码器和编码***,能够降低tagtree编码的时间复杂度,从而能够提升***性能。
第一方面,提供一种编码方法,包括:获取待编码块集合中的每个待编码块的零比特平面ZBP信息或包含信息;根据所述每个待编码块的ZBP信息或包含信息构造标识树,以及并行对所述标签树进行编码。
第二方面,提供了一种编码器,包括:
读取电路,用于获取待编码块集合中的每个待编码块的零比特平面ZBP信息或包含信息;
建树电路,用于根据所述每个待编码块的ZBP信息或包含信息构造标识树;
编码电路,用于在所述建树电路构造所述标志树时,并行对所述标签树进行编码。
第三方面,提供一种编码***,包括:第二方面的编码器。
第四方面,提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行第一方面所述的方法。
第五方面,提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行第一方面所述的方法。
本申请实施例的技术方案,通过根据待编码块集合中的每个待编码块的ZBP信息或包含信息构造标志树,同时并行对标志树中的待编码块进行编码,有利于提升编码效率,从而提升***性能。
附图说明
图1是JPEG 2000的编码框架图。
图2是编码得到数据包构成示意图。
图3是本申请实施例提供的编码器的结构示意图。
图4是图像块的小波变换的原理示意图。
图5是本申请实施例标志树的一种典型结构示意图。
图6是本申请实施例的建树电路的组成结构示意图。
图7是一种标志树的示意图。
图8是本申请实施例的第一编码电路的组成结构示意图。
图9是本申请实施例的第三编码电路的组成结构示意图。
图10是本申请实施例提供的解码器的结构示意图。
图11是tagtree的重建过程示意图。
图12是本申请实施例提供的编码方法的示意性流程图。
具体实施方式
本申请可应用于图像编解码领域、视频编解码领域、硬件视频编解码领域、专用电路视频编解码领域、实时视频编解码领域。
本申请提供的编码器可用于对图像进行有损压缩(lossy compression), 也可用于对图像进行无损压缩(lossless compression)。该无损压缩可以是视觉无损压缩(visually lossless compression),也可以是数学无损压缩(mathematically lossless compression)。
为了便于理解,先对JPEG 2000的编码框架进行简单介绍。
如图1所示,JPEG 2000的编码框架可以包括预处理模块12、变换模块14、量化模块16、EBCOT模块18。
预处理模块12可以包括分片处理模块120、分量变换(component transformation)模块122和直流电平平移(direct current level shift)模块124。
分片处理模块120用于将原始图像进行分割,得到一定数量的图像块(tile)或者说,图像分片,每个图像块都可以作为一个独立的源图像进行编码。可选地,该图像块可以是大小相等且互不重叠的矩形块,例如可以是512×512(单位为像素),本申请实施例对于该图像块的尺寸不作具体限定。
分量变换模块122可以对图像的分量进行某种变换以降低各分量之间的相关性。例如,分量变换模块122可以将图像的各个分量从当前颜色域转换至另一颜色域。
分量变换模块122可以支持多种颜色变换模式,因此,分量变换模块122有时也可称为多模颜色变换(multi-mode color transform,MCT)模块。例如,分量变换模块122可支持不可逆颜色变换(irreversible color transform,ICT)或可逆颜色变换(reversible color transform,RCT)。需要说明的是,分量变换模块122是可选的,实际编码过程中,也可以不对图像进行分量变换,直接进行后续处理。
直流电平平移模块124可用于对分量值进行中心平移,使得分量值关于0对称分布,以便于后续的变换操作。
变换模块14采用小波变换对图像的各个图像块进行变换,得到子带的小波系数。
量化模块16可用于对子带的小波系数进行量化,得到量化后的子带的小波系数。
EBCOT模块18是JEPG 2000的熵编码模块,属于JEPG 2000的核心模块。
EBCOT模块18可以包括tier-1编码模块182和tier-2编码模块184。tier-1编码模块182可用于对码块(子带可以进一步划分成独立的多个码块 (codeblock))进行tier-1编码。tier-1编码可以包括比特平面编码和算术编码。tier-2编码模块184主要负责码流的组织工作,如可以根据特定的码率对码块的码流进行截断等处理。tier-2编码模块184主要采用压缩后率失真优化算法(post-compression rate-distortion optimization,PCRD)进行码率控制。
例如,tier-2编码模块184可以根据tier-1编码模块184输出的每片码流(即每个码块的码流(pass))的码率(rate)和失真度(distortion)计算率失真斜率(slope)。率失真斜率可用于评估当前码块的码流在整个图像块的贡献度。该率失真斜率可用于后续的码流组织,如码流的分层、截断等。
进一步地,可根据目标码率以及率失真斜率对码块的码流进行处理。例如,可以根据目标码率以及率失真斜率截断码块的码流。进一步地,可以对多个码块的码流进行重新组织,码流分层等。
图像块中的码块的码流可以构成一组数据包,数据包由包头(packet header)和经优化截断的比特流组成,在数据包的包头中按照码块的顺序将码块的包含信息(code block inclusion information)、零比特平面(Zero bit plane,ZBP)信息、编码通道数、被包含码块截取长度信息等信息进行编码形成该包头信息,包头后面紧接着包体,包体包括码块被截取到的比特流。
如图2所示编码得到的数据包的构成示意图,其中,H b,n表示子带b的第n个码块的头信息,H b,n中的I为码块的包含信息的编码值,对应于下文所述的LYR编码,N为ZBP信息的编码值,对应于下文的ZBP编码,P为编码通道数的编码值,L为被包含码块截取长度L的编码值,zero表示该数据包是否为空数据包,B b,n表示子带b的第n个码块的比特流。
采用PCRD算法进行码率控制,码块的比特流可能被截取到不同的质量分层,也就是说,每个码块的比特流可以贡献给输出码流的分层中的一层或多层,可将码块首次被截取所在的质量分层作为码块的包含信息,例如,若cb0,cb1,cb2,cb3,cb5在质量分层0首次出现,cb4在质量分层1首次出现,则cb0~cb5的包含信息分别为000010,如果质量分层数为L,包含信息为L,则表示该码块在压缩码流中不被包含。通常来说,对图像重要的信息(例如,分辨率等级较高的码块)会放在质量分层中的较低层,后面的每一层都能够在前一层的基础上提高图像的质量,可见,在无损压缩情况下,所有层都应该被解码,如果只解码前面的几层,可以实现一定压缩比率下的有 损压缩。
对于小波变换后未压缩的码块系数,形成比特平面,最大比特平面数为M,实际编码时并不是所有的比特平面都被编码,若ZBP信息为N,实际编码的比特平面为M-N,其中,ZBP信息可以用于表示零比特平面的位置,零比特平面的具***置通常和码块对应,也就是说,每个码块对应一个ZBP信息,当码块在质量分层中第一次被包含时,该码块的ZBP信息才被编码。
tagtree编码器是tier-2编码模块的一种典型编码器,其采用tagtree算法对码块的包含信息和ZBP信息进行编码,具体过程如下:
首先,将待编码块按照一定的数量进行分组,每一组指向一个更高一级的节点,然后继续对这些高级节点分组,直到只剩一个节点为止,这个节点称为根节点,这样,由不同等级的节点组成一颗树,可称为标志树,即tagtree。
然后,对树上的各个节点进行编码,具体地,首先对根节点进行编码,然后逐级向下编码,直到最底层的叶子节点。也就是说,进行编码时,需要计算每一码块的编码值,然后将每一码块的编码值合并得到最终的编码值,编码的时间复杂度较高,通常为O(n 2),其中,n为待编码块的数量,例如,编码一个包含64个码块的分量需要3000~4000个时钟周期(cycle),功耗大,并且对逻辑资源的消耗也较大。
有鉴于此,本申请实施例提供了一种编码器,能够实现高效的tagtree编码,具体可以将tagtree编码的时间复杂度降低为O(n),例如,对于编码一个包含64个码块的分量只需60~70cycle,能够降低功耗以及对逻辑资源的消耗。
下面将结合图3至图9,对本申请的技术方案进行描述。
图3为本申请实施例提供的一种编码器20的示意性结构图。如图3所示,该编码器20可以包括:建树电路22,第一编码电路24,第二编码电路26。
该建树电路22用于根据待编码块的ZBP信息或包含信息,构建对应的标志树(tagtree)。可以理解,待编码块构成标志树的叶子节点,建树过程为生成叶子节点的父节点和祖先节点的过程。
应理解,在本申请实施例中,待编码块可称为叶子节点,或level 0节点,第一级节点等;待编码块的更高一级节点可称为父节点,level 1节点,或第二级节点,第一级高级节点;树的根节点可以称为祖先节点或level 2节点, 或第三级节点,第二级高级节点。
在一些实施例中,该建树电路22可以从外部存储器获取待编码块的ZBP信息或包含信息,在另一些实施例中,所述建树电路22也可以从上一级处理电路输出的寄存器中获取该待编码块的ZBP信息或包含信息,例如,所述建树电路22可以通过读取电路从外部存储器或上一次处理电路输出的寄存器中获取该待编码块的ZBP信息或包含信息,本申请实施例对于该待编码块的信息的获取方式不作限定。
需要说明的是,该待编码块可以为图像块的子带中的码块,也就是说,根据本申请实施例的编码器可以以子带为单位进行编码,在编码完一个子带后,可以对另一个子带进行编码,直到编码完整个待编码图像。
以下,结合图3至图5,以对64个码块(包括cb0~cb63)的ZBP信息建树为例,介绍具体的建树过程。
应理解,图4中码块的排列格式,以及图5中的tagtree的结构仅为示例,而不应对本申请实施例构成任何限定,随着编码规范的调整和发展,tagtree的层数也可能发生变化,例如,可以为4层,此情况下,根节点为level 3节点,tagtree的结构也可以调整,并且tagtree也可以包括更多个cb,或更少个cb等,但编码原理类似,这里不再赘述。
首先,获取tagtree的所有叶子节点的信息,即该64个码块的ZBP信息,该64个码块构成tagtree的叶子节点,根据该64个码块的分辨率等级,如图4所示,可以构建10颗树,其中,同一分辨率等级的cb用于构建同一棵树,例如,cb16~cb31对应同一颗树,cb48~cb63对应同一颗树。
具体地,cb0~cb3,分辨率等级最高,不需要生成对应的父节点,每个cb单独构建一颗树,记为第一类标志树,此类标志树只有layer 0节点,无layer 1节点和layer2节点。
基于cb4~cb7,cb8~cb11,cb12~cb15分别构建对应的一棵树,这一组树具有layer 1节点,没有layer2节点,记为第二类标志树。在该第二类标志树中,layer 1节点的取值可以为一组layer 0节点的最小值,例如,cb4~cb7的父节点的取值可以为cb4~cb7的LBP信息的最小值。
基于cb16~cb31,cb32~cb47,cb48~cb63分别构建对应的一颗标志树,这一组标志树中具有layer 1节点和layer2节点,记为第三类标志树。在该第三类标志树中,layer 1节点可以由一组layer 0节点取最小值生成,layer 2 节点是由一组layer 1节点取最小值生成。在该第三类标志树中,一组layer 0节点及其layer 1节点构成这棵树中的一颗子树,即该第三类树可以包括四颗子树,分别记为第一颗子树,第二颗子树,第三颗子树和第四颗子树。
对于cb16~cb31对应的第三类标志树,可以取cb16,cb17,cb20,cb21的最小值,生成这四个layer 0节点对应的layer 1节点的取值,按照同样的方式可以确定其他三组layer 0节点对应的layer 1节点的取值,然后根据该这一组layer 1节点取最小值,得到这棵树的layer 2节点的取值。
可选地,在本申请一个实施例中,所述建树电路22可以包括多个寄存器,用于缓存所述多个待编码块的叶子节点,父节点和祖先节点的ZBP信息。
可选地,在本申请一个实施例中,所述建树电路22可以包括多个第一级比较器,用于根据多个叶子节点的取值确定对应的父节点的取值,以及多个第二级比较器,用于根据多个父节点的取值,确定根节点的取值。
以对63个码块建树为例,该建树电路22可以包括15个第一级比较器(记为Comp1_0~Comp1_14),用于比较该cb4~cb63的60个叶子节点中每一组叶子节点的取值,确定对应的父节点的取值,以及3个第二级比较器(记为Comp2_0~Comp2_2),用于根据一组父节点的取值,确定对应的根节点的取值。
例如,如图6所示,Comp1_0可以比较cb4~cb7取最小值,得到fa0,并将fa0存储到fa0对应的寄存器中,Comp1_14可以比较cb58,cb59,cb62和cb63的ZBP信息取最小值,得到fa14的ZBP信息,并将fa14的ZBP信息存储到fa14对应的寄存器中,Comp2_0可以比较fa3~fa6的ZBP信息取最小值,得到fafa0的ZBP信息,并将fafa0的ZBP信息存储到fafa0对应的寄存器中,其中,faX表示父节点X,fafaX表示祖先节点X。
由此可见,构建一颗树需要两个步骤,第一个步骤生成叶子节点的layer1节点,第二个步骤生成叶子节点的layer 2节点,其中,第一个步骤可以通过15个第一级比较器实现,第二个步骤可以通过3个第二级比较器实现。
建树完成后,该第一编码电路24可以根据标志树中的每个待编码块的ZBP信息,确定每个待编码块的编码参考信息,该待编码块的编码参考信息可以用于表示该待编码块的ZBP信息、该待编码块的父节点的ZBP信息(如果该待编码块有父节点)以及该待编码块的祖先节点的ZBP信息(如果该 待编码块有根节点)之间的关系。
可选地,在本申请一个实施例中,该第一编码电路24具体用于:
根据标志树中的每个待编码块的ZBP信息,结合所述待编码块的父节点的ZBP信息和所述待编码块的祖先节点的ZBP信息,确定每个待编码块的编码参考信息。
应理解,在一些情况中,若待编码块没有父节点,则可以认为其父节点的ZBP信息为零,或者,若待编码块没有祖先节点,可以认为其祖先节点的ZBP信息为零。
可选地,在本申请一个实施例中,该第一编码电路24还用于:
根据标志树中的每个待编码块的ZBP信息,所述待编码块的父节点的ZBP信息和所述待编码块的祖先节点的ZBP信息,结合所述待编码块的父节点的编码标识信息和所述待编码块的祖先节点的编码标识信息,确定所述每个待编码块的编码参考信息。
其中,父节点的编码标识信息可以用于指示该父节点是否被编码过,该祖先节点的编码标识信息用于指示祖先节点是否被编码过。
应理解,在一些情况中,若待编码块没有父节点,则可以认为其父节点被编码过,或者,若待编码块没有祖先节点,可以认为其祖先节点被编码过。
应理解,在本申请实施例中,每个待编码块的父节点(如果有)和祖先节点(如果有)都可以对应一个寄存器,用于表示父节点或祖先节点是否被编码过,即可以通过寄存器存储该待编码块的父节点和祖先节点的编码标识信息,假设,该编码标识信息的初始值为0,表示对应的节点未被编码过,当该节点被编码过后,该节点对应的编码标识信息更新为1。
可选地,在一些实施例中,所述待编码块的父节点和所述待编码块的祖先节点的编码情况可以包括如下情况:
情况1,所述待编码块没有父节点,或所述待编码块的父节点被编码过,此情况都可以认为待编码块的父节点和祖先节点的编码标识信息都为1;
情况2,所述待编码块有父节点,且所述待编码块的父节点无父节点,或者,所述待编码块的父节点有父节点,且所述待编码块的父节点的父节点被编码过,此情况都可以认为待编码块的祖先节点的编码标识信息为1;
情况3,所述待编码块有父节点,且所述待编码块的父节点的父节点未被编码过,此情况都可以认为待编码块的父节点和祖先节点的编码标识信息 都为0。
对于情况1,可以只编码该待编码块,而不必编码其父节点和根节点,则该待编码块的ZBP编码可以包括该待编码块的编码值。
对于情况2,可以只编码该待编码块及其父节点,而不必编码其根节点,则该待编码块的ZBP编码可以包括该待编码块及其父节点的编码值。
对于情况3,需要编码该待编码块及其父节点和根节点,则该待编码块的ZBP编码可以包括该待编码块及其父节点和根节点的编码值。
可选地,在本申请一些实施例中,所述待编码块的父节点和根节点是否被编码过可以根据所述待编码块在树中的出现顺序确定。
例如,对于第二类标志树中的第一待编码块,若该第一待编码块在该第二类树中第一个出现,则该第一待编码块的父节点没有被编码过,编码该第一待编码块会同时编码该第一待编码块的父节点,编码完成后,该第一待编码块的父节点被标识为编码过,在编码与该第一待编码块属于同一棵标志树的其他待编码块时,判断其对应的父节点被编码过,则可以不对该父节点进行编码。
又例如,对于第三类树中的第二待编码块,若该第二待编码块在该第三类树第一个出现,则该第二待编码块的父节点和祖先节点都没有被编码过,编码该第二待编码块会同时编码该第一待编码块的父节点和祖先节点,编码完成后,该第二待编码块的父节点和祖先节点都被标识为编码过,然后,在编码与该第二待编码块属于同一颗子树的第三待编码块时,由于第三待编码块和第二待编码块对应同一父节点和祖先节点,则可以只编码该第三待编码块,不编码该父节点和根节点;或者在编码与该第二待编码块属于同一颗树且属于不同子树的第四待编码块时,由于第四待编码块和第二待编码块对应同一祖先节点,但对应不同的父节点,则可以不编码该祖先节点,是否编码该第四待编码块的父节点,可以根据该第四待编码块的父节点的编码标识信息确定,若该第四待编码块在其对应的子树中第一个出现,则可以编码其对应的父节点,否则,不编码其对应的父节点。
也就是说,在本申请实施例中,在编码过程可以对已编码的父节点和祖先节点进行标记,从而可以避免对同一父节点和祖先节点进行重复编码,有利于降低tagtree编码的时间复杂度。
可选地,在本申请一些实施例中,所述待编码块的编码参考信息可以包 括第一参考信息(记为cnt0),第二参考信息(记为cnt1)和第三参考信息(记为cnt2),其中,所述第一参考信息用于指示所述待编码块和其父节点的ZBP信息之间的关系,所述第二参考信息用于指示所述待编码块的父节点与该父节点的父节点的ZBP信息之间的关系,所述第三参考信息用于指示所述待编码块的根节点的ZBP信息。
可选地,在一些具体实施例中,所述第一参考信息可以为所述待编码块的ZBP信息与所述待编码块的父节点的ZBP信息的差值加一,即cnt0=ZBP cb-ZBP fa+1;
所述第二参考信息为所述待编码块的父节点的ZBP信息和所述待编码块的祖先节点的ZBP信息的差值加一,即cnt1=ZBP fa-ZBP fafa+1;
所述第三参考信息为所述待编码块的祖先节点的ZBP信息与0的差值加一,即cnt2=ZBP fafa-0+1,其中,0可以理解为该编码节点的祖先节点的父节点的LBP信息。
其中,ZBP fafa为所述待编码块的祖先节点的ZBP信息,所述ZBP fa为所述待编码块的父节点的ZBP信息,所述ZBP cb为所述待编码块的ZBP信息。
特别地,若待编码块没有父节点,则计算第一参考信息时,可以取该待编码块的父节点的ZBP信息ZBP fa为零;或,若待编码块的父节点没有父节点,则计算第二参考信息时,可以取该待编码块的祖先节点的ZBP信息ZBP fafa为零。
以图7所示的一种简单的tagtree结构为例,介绍前述的三种情况中第一参考信息,第二参考信息和第三参考信息的确定方式。
对于前述的情况1:即待编码块无父节点,或者该待编码块的父节点被编码过,例如,cb0、cb17和cb21,则cnt0=ZBP cb-ZBP fa+1,cnt1=0,cnt2=0。
例如,对于cb0,其对应的cnt0=2-0+1=3,cnt1=0,cnt2=0。
又例如,对于cb17,其对应的cnt0=3-3+1=3,cnt1=0,cnt2=0。
对于前述的情况2:待编码块有父节点,且所述待编码块的父节点无父节点,或者,所述待编码块的父节点的父节点被编码过,例如,cb4和cb20,则cnt0=ZBP cb-ZBP fa+1,cnt1=ZBP fa-ZBP fafa+1,cnt2=0。
例如,对于cb4,其对应的cnt0=2-2+1=1,cnt1=2-0+1=3,cnt2=0。
又例如,对于cb20,其对应的cnt0=2-1+1=2,cnt1=1-1+1=1,cnt2=0。
对于前述的情况3:待编码块有父节点,且该待编码块的父节点的父节 点没有被编码过,例如,cb16,则cnt0=ZBP cb-ZBP fa+1,cnt1=ZBP fa-ZBP fafa+1,cnt2=ZBP fafa-0+1。
例如,对于cb16,其对应的cnt0=4-3+1=2,cnt1=3-1+1=3,cnt2=1-0+1=2。
可选地,在本申请一个实施例中,如图8所示,所述第一编码电路24可以包括数据选择器(MUX)和计算单元,其中,该计算单元用于计算每个待编码块的第一参考信息,第二参考信息和第三参考信息,该MUX用于计算待编码块的第一参考信息,第二参考信息和第三参考信息时,选通该待编码块对应的父节点和根节点,以获取对应的父节点和根节点的ZBP信息。
可选地,在本申请一个实施例中,所述第一编码电路24还可以包括多个寄存器,用于在确定每个待编码块的第一参考信息,第二参考信息和第三参考信息之后,将每个待编码块的第一参考信息,第二参考信息和第三参考信息存储在对应的寄存器中,以便于第二编码电路26从寄存器中获取该待编码块的第一参考信息,第二参考信息和第三参考信息,并根据该第一参考信息,第二参考信息和第三参考信息,确定该待编码块的ZBP编码。
可选地,在一些实施例中,该第二编码电路26可以将该待编码块的三个编码值拼接,得到该待编码块的ZBP编码,例如,按照第三参考信息,第二参考信息和第一参考信息的顺序进行拼接,得到该待编码块的ZBP编码,或者,也可以按照第一参考信息,第二参考信息和第三参考信息的顺序进行拼接,得到该待编码块的ZBP编码,只需调整对应的解码算法即可。
可选地,若第二参考信息或第三参考信息为零,即不必对父节点或祖先节点进行编码,此情况下,该第二参考信息或第三参考信息在ZBP编码中为空(NULL),即不占比特位,即待编码块的ZBP编码不包括该待编码块的父节点或祖先节点的编码值,从而能够降低对存储空间的占用。
可选地,在本申请一些实施例中,该第二编码电路26可以将第一参考信息,第二参考信息和第三参考信息转换为特定的二进制编码,然后进行二进制编码的拼接,以得到所述待编码块的ZBP编码。
在一种实现方式中,第一参考信息和转换得到的二进制编码具有如下关系:
所述二进制编码的长度为所述第一参考信息的值,所述二进制编码的最低位为1,其他位为零。也就是说,该二进制编码中零的个数为待编码块和其父节点的ZBP信息之差。
例如,若该第一参考信息为3,则转换得到的二进制编码为001,或者,若第一参考信息为2,则转换得到的二进制编码为01,或者,若第一参考信息为1,则转换得到的二进制编码为1。
将第二参考信息和第三参考信息转换得到二进制编码的具体实现类似,这里不再赘述。
则第一参考信息对应的二进制编码中零的个数可以表示待编码块的叶子节点和该待编码块的父节点ZBP信息之差,该第二参考信息对应的二进制编码中零的个数可以表示待编码块的父节点和该父节点的父节点的ZBP信息之差,第三参考信息对应的二进制编码中的零的个数表示待编码块的祖先节点的ZBP信息。
由上述第一参考信息,第二参考信息和第三参考信息的确定方式可以看出,父节点和祖先节点的ZBP信息跟随标志树中第一次出现的码块,也就是说,标志树中第一个出现的码块的ZBP编码中包括其父节点和祖先节点的ZBP信息。
接着上述示例,根据cb0的cnt0=3,cnt1=0,cnt2=0,可以得到对应的二进制编码分别为001,NULL,NULL,则拼接可得该cb0的ZBP编码为001。
由cb20的cnt0=2,cnt1=1,cnt2=0,可以得到对应的二进制编码分别为01,1,NULL,则拼接可得该cb20的ZBP编码为011。
由cb16的cnt0=2,cnt1=3,cnt2=2,可以得到对应的二进制编码分别为01,001,01,则拼接可得该cb16的ZBP编码为0100101。
综上,根据本申请实施例的编码器,对每个待编码块进行编码时,只需编码未被编码过的父节点和祖先节点,而不必编码每个待编码块的父节点和祖先节点,能够降低编码的时间复杂度,同时能够降低对逻辑资源的消耗。
可选地,在本申请实施例中,该第二编码电路26可以包括:
编码值组合单元,用于将待编码块的第一参考信息,第二参考信息和第三参考信息分别转换得到的第三二进制编码,第二二进制编码和第一二进制编码进行码字拼接,得到所述待编码块的ZBP编码;
多个寄存器,用于缓存该每个待编码块的ZBP编码,用于后续的处理过程,例如,第三编码电路28对该待编码块的ZBP编码进行分离得到该待编码块在每个质量分层的层(Layer,LYR)编码。
由上文描述可知,码块可以在质量分层中的一层或多层中出现,该待编码块的ZBP编码可以包括该待编码块在各个质量分层中的编码值,因此,对该待编码块的ZBP编码进行分离,可以确定该待编码块在各个质量分层中的LYR编码。
可选地,在本申请一些实施例中,所述编码器20还可以包括:
第三编码电路28,用于根据所述待编码块的ZBP编码,确定所述待编码块在每个质量分层中的LYR编码。
若该质量分层数为K,该待编码块在每个质量分层对应一个layer信息,该layer信息用于指示该待编码块是否在该质量分层中出现,例如,若K=8,该待编码块对应8个layer信息,每个layer信息对应一个LYR编码,该LYR编码可以用于确定该待编码块第一个出现的质量分层,即first layer信息。
可选地,在本申请一些实施例中,所述第三编码电路28具体用于:
若当前质量分层为i,当前ZBP编码为X,从当前ZBP编码的最高位开始,查找当前ZBP编码中第一个零的位置,将该第一个零以及该第一个零之前的比特位作为当前质量分层i的LYR编码,然后移除当前ZBP编码中的该第一个零以及该第一个零之前的比特位,并将移位后的所述ZBP编码作为下一个质量分层的ZBP编码,然后将质量分层加1,循环执行上述过程。
可选地,在一些实施例中,若在某个质量分层,当前ZBP编码为全1,则可以将该ZBP编码作为当前质量分层的LYR编码。
可选地,在一些实施例中,如图9所示,所述第三编码电路28可以包括:
K个处理单元,包括处理单元0~处理单元K-1,用于确定待编码块在K个质量分层中的每个质量分层中的LYR编码;
K个寄存器,包括寄存器0~寄存器K-1,用于缓存所述K个处理单元输出的处理结果,该处理结果可以包括待编码块在质量分层中的LYR编码以及移位后的ZBP编码。
结合图9,以cb16的ZBP编码为0100101,共有5个质量分层,说明cb16在各个质量分层的LYR编码的确定过程:
阶段0,确定质量分层0的LYR编码;
首先,处理单元0首先从第二编码电路26的寄存器中获取该cb16的ZBP编码;
其次,查找该ZBP编码0100101中的第一个零的位置,并将该第一个零,及其之前的比特位都作为质量分层0的LYR编码,即cb16在质量分层0的LYR编码为0;
然后,移位掉该第一个零及其之前的比特位,得到移位后的ZBP编码为100101。
进一步地,将LYR编码0以及移位后的ZBP编码100101缓存在寄存器0中,可选地,该寄存器0可以包括两个寄存器,分别用于缓存LYR编码0以及移位后的ZBP编码100101;
阶段1,确定质量分层1的LYR编码;
首先,处理单元1从寄存器0中获取当前的ZBP编码为100101;
其次,查找100101中的第一个零的位置,并将该第一个零,以及之前的比特位都作为质量分层1的LYR编码,即cb16在质量分层1的LYR编码为10;
然后移位掉该第一个零,以及之前的比特位,得到移位后的ZBP编码为0101。
进一步地,将LYR编码10,以及更新后的ZBP编码0101存储在寄存器1中缓存在寄存器1中,类似地,该寄存器1也可以包括两个寄存器,分别用于缓存该质量分层的LYR编码以及移位后的ZBP编码;
阶段2,确定质量分层2的LYR编码;
首先,处理单元2从寄存器1中获取当前的ZBP编码为0101;
其次,查找0101中的第一个零的位置,并将该第一个零,以及之前的比特位都作为质量分层2的LYR编码,即cb16在质量分层2的LYR编码为0;
然后移位掉该第一个零,以及之前的比特位,得到更新后的ZBP编码为101。
进一步地,将LYR编码0,以及更新后的ZBP编码101存储在寄存器2中,类似地,该寄存器2也可以包括两个寄存器,分别用于缓存该质量分层的LYR编码以及移位后的ZBP编码;
阶段3,确定质量分层3的LYR编码;
首先,处理单元3从寄存器2中获取当前的ZBP编码为101;
其次,查找101中的第一个零的位置,并将该第一个零,以及之前的比 特位都作为质量分层3的LYR编码,即cb16在质量分层3的LYR编码为10;
然后移位掉该第一个零,以及之前的比特位,得到更新后的ZBP编码为1。
进一步地,将LYR编码10,以及更新后的ZBP编码1存储在寄存器3中,类似地,该寄存器3也可以包括两个寄存器,分别用于缓存该质量分层的LYR编码以及移位后的ZBP编码;
阶段4,确定质量分层4的LYR编码;
首先,处理单元4从寄存器3中获取当前的ZBP编码为1;
其次,处理单元4确定cb16当前的ZBP编码为全1,将当前ZBP编码作为当前质量分层4的编码值,即cb16在质量分层4的LYR编码为1,进一步将LYR编码1缓存在寄存器4中。
需要说明的是,对于码块的第一层(first layer)的LYR编码,若该LYR编码的比特位0为1,则可以不确定该码块在后续的其他质量分层中的LYR编码。
由上个例子可知,cb16的第一层是质量分层1,即该cb16在质量分层1第一层出现,其在该层的LYR编码为10,其中比特位0表示该cb16在下一质量分层的包含信息,该比特位取1,表示该cb16在下一质量分层中包含,该比特位取0,表示该cb16在下一质量分层中不包含,当该比特位取1时,可以不继续确定该cb在其他分层中的LYR编码。
因此,第三编码电路通过多个处理单元和多个寄存器能够实现对多个码块的ZBP编码的并行处理,能够降低tagtree编码的时间复杂度。
应理解,在本申请实施例中,所述第三编码电路包括的处理单元的个数可以根据质量分层的总层数K确定,例如,若K=8,该第三编码电路可以包括8个处理单元,或者,该第三编码电路也可以包括其他个数个处理单元,例如,2~7个,此情况也能够实现一定程度的并行处理,本申请实施例对此不作限定。
综上,本申请实施例的编码过程主要包括建树过程,第一编码过程和第二编码过程和第三编码过程,其中,该建树过程可以根据待编码的多个码块建立对应的标志树,即确定待编码块的父节点和祖先节点的信息,第一编码过程用于确定待编码块的第一参考信息,第二参考信息和第三参考信息,第 二编码过程用于根据该待编码块的第一参考信息,第二参考信息和第三参考信息确定该待编码块的ZBP编码,第三编码过程用于根据该待编码块的ZBP编码确定该待编码块在各个质量分层中的LYR编码。
在本申请实施例中,上述编码过程可以采用流水线进行作业,能够提高逻辑资源的利用率,同时还可以降低编码的耗时,例如通过建树电路、第一编码电路,第二编码电路和第三编码电路对待编码块并行进行编码处理,例如,由于不需要计算cb0~cb3的父节点的取值,因此,可以在构建cb4~cb63的layer 1节点和layer 2节点的同时,并行生成cb0~cb3的ZBP编码,能够提高编码效率。又例如,通过上述电路并行对多个子带的码块并行处理等。
可选地,在本申请一些实施例中,所述编码器20还可以包括以下中的至少一个:
变换电路,用于对待编码的图像块进行小波变换;
量化电路,用于对所述图像块的小波系数进行量化;
tier-1编码电路,用于对所述图像块的码块进行tier-1编码,得到所述码块的码流。
以上,结合图3至图9,说明了码块ZBP信息和包含信息的编码过程。可选地,在本申请实施例中,所述编码器20还可以对码块的编码通道数以及被包含码块的截取长度等信息进行编码,具体的编码方式可以采用现有的编码方式,这里不再赘述。
编码完成之后,码块的ZBP编码会存放在该码块第一次出现的质量分层对应的数据包的包头中,该码块在每一层的LYR编码会存放在对应的质量分层对应的数据包中,具体的存放顺序如图2所示。
也就是说,该码块在第一次被包含时,该码块的ZBP信息才被编码,在该码块出现的其他质量分层中不包含该码块的ZBP编码,因此,要获取该码块的ZBP编码首先要确定该码块第一次出现的质量分层,即first layer信息。
以下,结合图10至图12,介绍根据本申请实施例的解码器的工作原理。
图10是根据本申请实施例的解码器的示意性结构图,如图10所示,解码器80可以包括:
第一层(first layer)解析电路82,用于根据该码块的LYR编码,确定待解码码块的第一层(first layer)信息,即该待解码码块在哪一个质量分层 中第一次出现,即解析图2所示包头中的I。
ZBP解析电路83,用于在该待解码码块的first layer中,对该待解码码块的ZBP编码进行解析,确定该待解码码块的ZBP信息,即解析图2所示包头中的N。
可选地,在本申请实施例中,所述编码器80还可以包括:
码流读取电路,用于读取待解码的码流数据,例如可以利用高级可扩展接口(advanced eXtensible interface,AXI)从外部存储器(如内存)中读取该待解码的码流。
应理解,在读取待解码的码流数据之后,在本申请实施例中,该解码器80还可以对码流数据进行对齐处理,以便于后续的解析电路的处理。
可选地,在一些实施例中,所述解码器80还可以包括以下中的至少一个电路:
通道数解析电路84,用于对待解码码块的编码通道数进行解码,即用于解析图2所示包头中的P;
截取长度解析电路85,用于对待解码码块的被包含码块的截取长度解析,即用于解析图2所示包头中的L;
包体解析电路86,用于解析待解码码块的比特流,即解析图2所示包体中的B b,n
包体提取电路87,用于对包体解析电路86解析得到的解码数据进行重新组织,并将组织好的数据存储在存储器中,以便于后级电路对该数据做进一步的处理。
可选地,在本申请一些实施例中,所述解码器80还可以包括以下中的至少一个:
逆量化电路,用于对所述包体提取电路87输出的数据进行逆量化;
逆变换电路,用于对逆量化电路输出的数据进行逆变换。逆变换的方式可以是离散小波逆变换。
输出电路,用于将逆变换电路输出的数据写入到外部的存储器中。例如,可以通过AXI将逆变换电路输出的数据写入到外部的存储器中。
可选地,在本申请一些实施例中,所述解码器80还可以包括:
控制电路81,用于控制第一层解析电路82,LBP解析电路83以及通道数解析电路84,截取长度解析电路85,包体解析电路86,包体提取电路87 中的至少一个电路的工作状态。
所述控制电路81可以用于根据解析的码流的信息,控制激活相应的电路进行工作。
具体而言,所述控制电路81首先根据数据包的包头中的zero判断该数据包是否为空包,若为空包,则等待新的码流,否则,激活first layer解析电路82,进行first layer的解析,即判断该码块是否在当前质量分层中。若码块在当前质量分层中,则激活ZBP解析电路83,对该码块进行ZBP解码,ZBP解码完毕之后,进一步可以激活该通道数解析电路84和截取长度解析电路85,分别对码块的编码通道数和被包含码块的截取长度进行解码,循环执行上述过程,若当前数据包中的码块的包头都解析完毕,激活包体解析电路86对数据包中的包体进行解析,获取码块包括的比特流信息,然后激活包体提取电路87,对解析的比特流进行重组,并缓冲到存储器中。
以下,结合图5,对first layer解析电路82和ZBP解析电路83的工作原理进行详细说明。
由前文描述可知,编码器的第三编码电路可以对码块的ZBP编码进行分离,得到该码块在每个质量分层的LYR编码,该码块的LYR编码最终包含在该质量分层对应的数据包的包头中,因此,解析一个质量分层的数据包的包头,可以获知该码块在该质量分层中的包含信息,即该码块是否包含在该质量分层中。
first layer解析电路82可以解析码块在当前质量分层中的LYR编码,确定当前质量分层是否为该码块的first layer。
可选地,在本申请一些实施例中,所述first layer解析电路82可以包括:
多个first layer寄存器,用于缓存每个待解码块的first layer信息。
例如,cb0~cb63分别对应一个寄存器,用于存储cb的first layer信息,fa0~fa14分别对应一个寄存器,用于存储cb的父节点的first layer信息,fafa0~fafa2分别对应一个寄存器,用于存储cb的祖先节点的first layer信息。
可选地,在本申请实施例中,每个待解码块还可以对应一个编码标识信息,用于指示该待编码节点是否被编码过。
可选地,在本申请实施例中,每个待解码块的父节点或祖先节点也可以对应一个编码标识信息,用于指示该待编码块的父节点或祖先节点是否被编码过。
可选地,在一些实施例中,所述待解码块,所述待编码块的父节点或祖先节点的编码标识信息可以存储在对应的寄存器中。
例如,寄存器取0表示该待解码块没有被编码过,寄存器取1表示该待解码块被编码过。
在一些实施例中,待解码块的编码标识信息初始为0,按照质量分层从低到高的顺序解码的过程中,依次根据每个质量分层的数据包中的LYR编码,确定待编码块在每个质量分层是否被编码过,若该待编码块在某个质量分层第一次出现,则将该待编码块的编码标识信息从0更新为1,并将该质量分层作为该待编码块的first layer,存储到对应的first layer寄存器中。
以下,结合图5,说明first layer解析电路82的具体工作原理。
在一种情况中,若在解析某一质量分层的数据包的包头时,待解码码块的LYR编码时解析到0,表示该待解码码块没有在该质量分层出现,此情况下,需要跳过一定数量的码块,也就是说,可以不必对此部分码块进行first layer解析,需要跳过的码块的数量可以根据待解析的数据包中码块的存放顺序,标志树中码块的排列顺序,码块的父节点和根节点的编码标识信息确定。
例如,若码块的父节点未被编码过,可以认为在tagtree中该父节点的其他叶子节点也未出现在该质量分层,因为,如果有其他叶子节点出现在该质量分层,该父节点必然被编码过,此情况下,这些叶子节点可以跳过。
又例如,若码块的祖先节点未被编码过,可以认为在tagtree中该祖先节点的叶子节点也未出现在该质量分层,因为,如果有其他叶子节点出现在该质量分层,该祖先节点必然被编码过,此情况下,这些叶子节点可以跳过。
如图4和图5所示,码块在码流中是按照码块的编号的顺序存放的,例如,对于cb16~cb31,码块的顺序是cb16,cb17,cb18,cb19,cb20,cb21…cb30,cb31;而在标志树中,并不是按照这个顺序存放的,具体地,在标志树中,cb16,cb17,cb20和cb21为一组,cb18,cb19,cb22和cb23为一组,cb24,cb25,cb28和cb29为一组,cb26,cb27,cb30和cb31为一组,也就是说,每个分组中cb的编号并不是连续的。
也就是说,在数据包的包头中,若cb16的父节点没有被编码过,cb17,cb20和cb21必然没有被编码过,此情况下,解析到cb17,cb20和cb21时,可以跳过,cb16和cb24情况类似,cb18和cb26情况类似。
以下,以cb16~cb31中的任一码块对应的LYR编码解析到0(记为情况 1),说明需要跳过的码块的个数,cur_cb表示当前待解码码块的编号,add_cb表示需要跳过的码块的个数,具体可以包括如下几种情况:
情况1-1:cur_cb=16,并且其祖先节点未被编码过,则add_cb=16,否则,判断其父节点是否被编码过,如果其父节点未被编码过,则add_cb=2,否则add_cb=1;
也就是说,如果cb16未在当前质量层出现过,并且其祖先节点在该质量分层也未被编码过,则表示该cb16所在的树中的码块都未在该质量分层出现过,此情况下,可以跳过该树中的所***块,解析下一颗树(即cb32~cb47对应的树)中的码块,因此,下一个待解码的cb为cb32;
或者,如果cb16未在当前质量层出现过,并且cb16的祖先节点被编码过,表示该cb16所在的树中***块出现过,可能是该树中的第一颗子树中的码块,也可能是该树中的其他子树中的码块,进一步地,可以判断该cb16的父节点是否被编码过,若该cb16的父节点未被编码过,则可以确定该第一颗子树中的码块未在该质量分层出现过,因此可以跳过该第一颗子树,对第二颗子树中的码块进行解析,即对下一个待解码的cb为cb18,或者,若该cb16的父节点被编码过,可以确定该第一颗子树中***块在该质量分层出现过,进一步可以对该第一颗子树中的下一个码块进行解码,即待解码的cb为cb17。
情况1-2:如果cur_cb=24,并且其父节点未被编码过,则add_cb=2,否则add_cb=1;
若cb24未在该质量分层出现过,并且该cb24的父节点未被编码过,则可以确定该cb24所在的第三颗子树中的码块未在该质量分层出现过,因此可以跳过该第三颗子树,对第四颗子树中的码块进行解析,即对下一个待解码的cb为cb26,或者,若该cb24的父节点被编码过,可以确定该第三颗子树中***块在该质量分层出现过,进一步可以对该第三颗子树中的下一个码块进行解码,即下一个待解码的cb为cb25。
由于在码流中,码块的信息是按照顺序存放的,例如对于cb16~cb21,则按照cb16,cb17,cb18,cb19,cb20,cb21,cb22的顺序存放,而在tagtree中,并不是按照顺序分组的,即cb16,cb17,cb19,cb20为一组,故如果cb16的父节点在该层中没有包含,则该cb16,cb17,cb19,cb20都不会在当前质量分层中被包含,故引入两个标识信息,skip1,用于表示是否跳过第 一颗子树和第三颗子树,以及skip2,用于表示是否跳过第二颗子树和第四颗子树。
情况1-3:如果cur_cb=18或26,并且其父节点被编码过,则add_cb=1,否则判断skip1是否为1,若skip1为1则add_cb=6,否则add_cb=2;
若cb18未在该质量分层出现过,并且cb18的父节点被编码过,则可以确定该cb18所在的第二颗子树中的码块在该质量分层出现过,进一步可以对该第二颗子树中的下一个码块进行解码,即下一个待解析码块为cb19;
或者,若cb18未在该质量分层出现过,并且cb18的父节点未被编码过,则可以确定跳过该cb18所在的第二颗子树,进一步可以判断skip1是否为1,即是否跳过第一颗子树和第三颗子树,若为1,则表示跳过,则对第三颗子树中的第一个码块进行解析,即下一个待解析码块为cb26,否则,表示不跳过,对cb18之后的待解析码块进行解析,由于cb19需要跳过,因此,下一个待解析码块为cb20。
Cb26的情况与cb18类似,这里不再赘述。
情况1-4:如果cur_cb=19或27,判断skip1是否为1,为1则add_cb=3,否则add_cb=1;
若当前待解码码块为cb19,可以判断skip1是否为1,即是否跳过第一颗子树和第三颗子树,若为1,表示跳过,则对第二颗子树中的下一个码块进行解析,即下一个待解析码块为cb22,否则,表示不跳过,对cb19之后的待解析码块进行解析,即下一个待解析码块为cb20。
Cb27的情况与cb19类似,这里不再赘述。
情况5:如果cur_cb=21或29,判断skip2是否为1,为1则add_cb=3,否则add_cb=1;
若当前待解码的cb为cb21,可以判断skip2是否为1,即是否跳过第二颗子树和第四颗子树,若为1,即表示跳过,则对第三颗子树中的码块进行解析,即下一个待解析码块为cb24,否则,表示不跳过,对cb21之后的待解析码块进行解析,即下一个待解析码块为cb22。
Cb29的情况与cb21类似,这里不再赘述。
情况6:对于标志树中的其他cb,add_cb为1。
例如,对于cb1,下一个待解码的码块为cb2。
又例如,对于cb5,下一个待解码的码块为cb6。
再例如,对于cb17,下一个待解码的码块为cb18。
应理解,cb32~cb47,cb48~cb63对应的第三类树中与该cb16~cb31中位置相同的cb的add_cb的确定方式相同,这里不再赘述。
在另一种情况中,若当前待解码码块的LYR编码第一次解析到1(记为情况2),此情况下,可以认为该待解码码块在当前质量分层被编码过,同时可以认为该待编码块的父节点和祖先节点也在该质量分层被编码过,据此,可以更新该待编码块的父节点和祖先节点的编码标识信息,即将该待编码块的父节点和祖先节点的编码标识信息更新为1。根据tagtree中cb的存放顺序,具体可以包括如下情况:
情况2-1:如果cur_cb为16,32,48,判断其祖先节点fafa的编码标识信息是否为0,若祖先节点fafa的编码标识信息为0表示该祖先节点未被编码过,此情况下,将祖先节点fafa的编码标识信息更新为1,若祖先节点fafa的编码标识信息为1,则判断其父节点fa的编码标识信息是否为0,若父节点fa的编码标识信息为0表示该父节点未被编码过,则将其父节点fa的编码标识信息更新为1,或者,若父节点fa的编码标识信息为1表示该父节点被编码过,判断cur_cb对应的叶子节点的编码标识信息是否为0,若叶子节点的编码标识信息为0表示该叶子节点未被编码过,则将该叶子节点的编码标识信息更新为1。
具体而言,若cb16的ZBP编码解析到1,则表示该cb16在该质量分层出现过,该cb16的叶子节点,父节点和祖先节点必然被编码过,因此,可以将该cb16的叶子节点,父节点和祖先节点的编码标识信息都更新为已编码过。
情况2-2:如果cur_cb为18,24,26,34,40,42,50,56,58,判断其父节点fa的编码标识信息是否为0,若父节点fa的编码标识信息为0,将父节点fa的编码标识信息更新为1;若父节点fa的编码标识信息为1,判断cur_cb对应的叶子节点的编码标识信息是否为0,若叶子节点的编码标识信息为0,则将该叶子节点的编码标识信息更新为1。
情况2-3:对于其他cb,判断cur_cb对应的叶子节点的编码标识信息是否为0,若叶子节点的编码标识信息为0,则将该叶子节点的编码标识信息更新为1。
若在当前质量分层中,码块的编码标识信息由0更新为1,则表示该码 块在该质量分层中第一次出现,即该质量分层为该码块的first layer,也就是说,该质量分层中包括该码块的ZBP编码,进一步地,该ZBP解析电路83可以对该码块的ZBP编码进行解析,确定该码块对应的叶子节点的ZBP信息。
由码块的ZBP编码原理可知,父节点和祖先节点的ZBP信息包括在树中第一个出现的码块的ZBP编码中,也就是说,树中第一个出现的码块的ZBP编码包括该码块的父节点(若有父节点的话)和祖先节点(若有祖先节点的话)的ZBP信息,子树中第一个出现的码块的ZBP编码包括该码块的父节点的ZBP信息。
以解码第三类树中的码块的ZBP编码,得到该第三类树中的码块的ZBP信息为例,说明具体的ZBP解码过程。
步骤1:根据该树中第一个出现的第一码块的ZBP编码确定该第一码块的叶子节点,父节点以及祖先节点的节点信息,根据ZBP编码原理,码块的ZBP信息的解码过程实际上是在该码块的ZBP编码中找1的过程:
步骤1-1:确定该第一码块的祖先节点的节点信息;
从当前ZBP编码(记为ZBP编码0)的最高位开始,查找该ZBP编码0中的第一个1,将该第一个1之前的零的个数作为该第一码块的祖先节点的节点信息,该祖先节点的节点信息可以对应于前文所述的cn2-1,然后移位掉该第一个1以及该第一个1之前的比特位,并将其作为下一个步骤的ZBP编码,记为ZBP编码1;
步骤1-2:确定该第一码块的父节点的节点信息;
从该ZBP编码1的最高位开始,查找该ZBP编码1中的第一个1,将该第一个1之前的零的个数作为该第一码块的父节点的节点信息,该父节点的节点信息可以对应于前文所述的cn1-1,然后移位掉该第一个1以及该第一个1之前的比特位,将其作为下一个步骤的ZBP编码,记为ZBP编码2;
步骤1-3:确定该第一码块的叶子节点的节点信息;
从该ZBP编码2的最高位开始,查找该ZBP编码2中的第一个1,将该第一个1之前的零的个数作为该第一码块的节点信息,该码块的叶子节点的节点信息可以对应于前文所述的cn0-1。
至此,树中第一个出现的码块的叶子节点,父节点和祖先节点的节点信息均已获得。
进一步地,在步骤2中,根据该树中第二个出现的第二码块的ZBP编码,确定该第二码块的ZBP信息,可选地,该第二码块可以为与该第一码块不属于同一子树的其他子树中第一个出现的码块(记为),此情况下,该第二码块的ZBP编码包括该第二码块的叶子节点和父节点的ZBP信息,或者也可以为与该第一码块属于同一子树的码块,此情况下,该第二码块仅包括该第二码块的叶子节点的ZBP信息。以对第一种情况中的第二码块的解码为例说明。具体过程如下:
在步骤2-1中:从该第二码块的ZBP编码的最高位开始,查找该ZBP编码中的第一个1,将该第一个1之前的零的个数作为该第二码块的父节点的节点信息,然后移位掉该第一个1以及该第一个1之前的比特位,将其作为下一个步骤的ZBP编码,记为ZBP编码3;
在步骤2-2中:从该ZBP编码3的最高位开始,查找该ZBP编码3中的第一个1,将该第一个1之前的零的个数作为该第二码块的节点信息。
至此,获得树中第二个出现的码块的叶子节点和父节点的节点信息。
结合图11,以cb16~cb31的树的重建过程为例进行说明cb的ZBP信息的解码过程。如图11所示,开始该树为一颗空树。
若该树中第一个出现的cb为cb25,则该cb25的ZBP编码中包括该cb25的父节点和祖先节点的节点信息,三者之间通过1分隔,通过不断查找第一个1出现的位置,并判断其前面有几个0,然后将0的个数写入对应的寄存器中,可以得到祖先节点,父节点和叶子节点的节点信息。
假设cb25的ZBP编码为001011,第一个1之前有2个0,则可以将2写入cb25的祖先节点的寄存器中,第二个1之前有1个0,则可以将1写入cb25的父节点的寄存器中,第三个1之前有0个0,则可以将0写入cb25的叶子节点的寄存器中。也就是说,cb25对应的cn2-1=2,cnt1-1=1,cnt0-1=0。
若第二个出现的cb为cb22,cb22的祖先节点已经被解码过,则只需要解码cb22的父节点和cb22本身,若cb22的ZBP编码为0001001,第一个1之前有3个0,则向cb22的父节点的寄存器中写入3,第二个1之前有2个0,则向cb22对应的叶子节点的寄存器中写入2。也就是说,cb22对应的cnt1-1=3,cnt0-1=2。
若第三个出现的cb为cb18,cb18的祖先节点和父节点都被解码过,则只需要解码该cb18,cb18的ZBP编码为01,1之前有1个0,则将1写入 cb18的叶子节点的寄存器中。也就是说,cb18对应的cnt0-1=1。
根据该树中依次出现的cb的ZBP编码,可以依次得到该树中的每个节点的节点信息,根据前文所述的cnt0,cn1和cnt2的定义,即cnt0=ZBP cb-ZBP fa+1,cnt1=ZBP fa-ZBP fafa+1,cnt2=ZBP fafa-0+1,可知cnt0-1=ZBP cb-ZBP fa,cnt1-1=ZBP fa-ZBP fafa,cnt2-1=ZBP fafa-0,其中,cnt0-1,cnt1-1,cnt2-1分别为码块的叶子节点,父节点和祖先节点的节点信息,从而求三者的累加和可以得到cb的叶子节点的ZBP信息ZBP cb,即ZBP cb=(cnt0-1)+(cnt1-1)+(cnt2-1)。
也就是说,得到整棵树上的每个节点的节点信息之后,可以将码块的叶子节点到祖先节点路径上的节点信息累加,即可得到该码块的叶子节点的ZBP信息。
可选地,在本申请一个实施例中,对于三层tagtree,所述ZBP解析电路可以包括三级解码单元,第一解码单元,第二解码单元和第三解码单元,分别用于确定码块的祖先节点的节点信息,父节点的节点信息和叶子节点的节点信息。
可选地,所述ZBP解析电路还可以包括多个寄存器,用于缓存解析得到的码块的祖先节点的节点信息,父节点的节点信息和叶子节点的节点信息,以及移位后的码块的ZBP编码。
在解析完数据包中的码块的ZBP编码之后,进一步地,还可以激活通道数解析电路84,通过该通道数解析电路84解析码块的编码通道数信息,还可以激活截取长度解析电路85,解析该码块的被包含截取长度的信息,同时还可以激活其他解析电路,解析该包头中的其他信息,本申请实施例对此不作赘述。
在解析完该数据包中的每个码块的包头之后,进一步地,包体解析电路和包头提取电路还可以解析数据包中的包体部分,将解析得到的解码数据进行重新组织,并将组织好的数据存储在存储器中,以便于后级电路对该数据做进一步的处理。
以上,结合图3至图11,描述了本申请实施例的编码器和解码器,下面,结合图12,描述本申请实施例的编码方法。
应理解,本申请实施例的编码方法可以为前述本申请实施例的编码器或包括本申请实施例的编码器的设备实施本申请实施例的技术方案时的方法, 相关描述可以参考前述实施例,以下为了简洁,在此不再赘述。本申请实施例的解码方法为前述本申请实施例的解码器或包括本申请实施例的解码器的设备实施本申请实施例的技术方案时的方法,相关描述可以参考前述实施例,以下为了简洁,在此不再赘述。
图12示出了根据本申请实施例的编码方法400的示意性流程图。
如图12所示,该方法400包括:
S401,获取待编码块集合中的每个待编码块的零比特平面ZBP信息或包含信息;
S402,根据所述每个待编码块的ZBP信息或包含信息构造标识树,以及并行对所述标签树进行编码。
可选地,在本申请一个实施例中,所述方法400还包括:
将所述每个待编码块的ZBP信息或包含信息存储在所述每个待编码块对应的寄存器中。
可选地,在本申请一个实施例中,所述根据所述每个待编码块的ZBP信息或包含信息构造标识树可以具体包括:
将所述待编码码块集合中的待编码块按照固定的数量进行分组,确定每个分组所指向的第一级高级节点;
对所述每个分组所指向的第一级高级节点继续进行分组,确定所述第一级高级节点所指向的第二级高级节点,直到所述标志树中只有一个最高级节点。
在一些实施例中,所述待编码块集合包括64个码块,编号分别为0至63,所述根据所述每个待编码块的ZBP信息构造标识树,包括:
将编号为0至3的码块单独构造为四颗第一类标志树;
将编号为4至7的待编码块,编号为8至11的待编码块,编号为12至15的待编码块进行分组,确定每个分组所指向的高级节点,得到三颗第二类标志树;
将编号为16至31的待编码块,编号为32至47的待编码块,编号为48至63的待编码块按照固定的数量进行分组,确定每个分组的高级节点,直到只剩一个最高级节点,得到三颗第三类标志树。
在一个具体实施例中,可以将所述编号为16至31的待编码块中的编号为16,17,20,21的待编码块分为一组,编号为18,19,22,23的待编码块分为一 组,编号为26,27,30,31的待编码块分为一组,确定每个分组的第一级高级节点;
根据所述每个分组的第一级高级节点,确定所述每个分组所指向的第二级高级节点,得到一颗所述第三类标志树。
在本申请实施例中,所述确定每个分组所指向的第一级高级节点,包括:
将所述每个分组内的待编码块的ZBP信息中的最小值,确定为所述分组所指向的更高级节点的ZBP信息。
可选地,在本申请一个实施例中,在对编号0至3的码块进行编码时,并行构建所述待编码块集合中的其他待编码块的标志树。
可选地,在本申请一实施例中,所述对所述标签树进行编码,包括:
根据所述标志树,确定所述待编码块的编码参考信息,所述编码参考信息用于指示所述待编码块至所述待编码块的最高级节点的路径上的节点和所述节点的父节点的ZBP信息之间的关系;
根据所述待编码块的编码参考信息,确定所述待编码块的ZBP编码。
可选地,在本申请一实施例中,所述根据所述标志树,确定所述待编码块的编码参考信息,包括:
根据所述标志树,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,其中,所述第一参考信息用于指示所述待编码块的ZBP信息和所述待编码块的第一级高级节点的ZBP信息之间的关系,所述第二参考信息用于指示所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息之间的关系,所述第三参考信息用于指示所述待编码块的第二级高级节点的ZBP信息的信息与所述待编码块的第三级高级节点的ZBP信息之间的关系。
可选地,在本申请一实施例中,所述待编码块的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息的差值加一,所述待编码块的第三参考信息为所述待编码块的第二级高级节点的ZBP信息与所述待编码块的第三级高级节点的ZBP信息的差值加一。
可选地,在本申请一实施例中,所述根据所述标志树,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包括:
根据所述标志树,结合所述待编码块是否具有高级节点,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
实施例1:若所述待编码块不具有高级节点,根据所述待编码块的ZBP信息,确定所述待编码块的第一参考信息,并确定所述待编码块的第二参考信息和所述第三参考信息为零。例如,可以确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息加一。
实施例2:若所述待编码块具有高级节点,根据所述待编码块的高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
在该实施例2中,进一步地,可以根据所述待编码块是否具有二级高级节点,结合所述待编码块的高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
实施例2.1:若所述待编码块不具有二级高级节点,根据所述待编码块的第一高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
情况1:若所述待编码块的第一高级节点被编码过,根据所述待编码块的ZBP信息,确定所述待编码块的第一参考信息,并确定所述待编码块的第二参考信息和第三参考信息为零。例如,可以确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一。
情况2:若所述待编码块的第一高级节点未被编码过,根据所述待编码块的ZBP信息和所述待编码块的第一级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息,并确定所述待编码块的第三参考信息为零。例如,可以确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,并确定所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息加一。
实施例2.2:若所述待编码块具有二级高级节点,根据所述待编码块的第一高级节点的编码标识信息和所述待编码块的第二高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
情况1:若所述待编码块的第一高级节点被编码过,根据所述待编码块 的ZBP信息,确定所述待编码块的第一参考信息,并确定所述待编码块的第二参考信息和第三参考信息为零。例如,可以确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一。
情况2:若所述待编码块的第一高级节点未被编码过,根据所述待编码块的第二级高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
情况2.1:若所述待编码块的第二级高级节点被编码过,根据所述待编码块的ZBP信息和所述待编码块的第一级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息,并确定所述待编码块的第三参考信息为零。例如,可以确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,并确定所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息的差值加一。
情况2.2:若所述待编码块的第二级高级节未被编码过,根据所述待编码块的ZBP信息,所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息和第三参考信息。例如,可以确定所述待编码块的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息的差值加一,所述待编码块的第三参考信息为所述待编码块的第二级高级节点的ZBP信息加一。
进一步地,在本申请一个实施例中,所述根据所述待编码块的编码参考信息,确定所述待编码块的ZBP编码,包括:
根据所述待编码块的第一参考信息,第二参考信息和第三参考信息,确定所述待编码块的ZBP编码。
在本申请一个实施例中,所述根据所述待编码块的第一参考信息,第二参考信息和第三参考信息,确定所述待编码块的ZBP编码,包括:
将所述第一参考信息,所述第二参考信息和所述第三参考信息分别转换为第一二进制编码,第二二进制编码和第三二进制编码;
将所述第三二进制编码,所述第二二进制编码和所述第一二进制编码进行拼接,得到所述待编码块的ZBP编码。
可选地,在本申请一个实施例中,所述第一参考信息和转换得到的第一二进制编码具有如下关系:
所述第一二进制编码的长度为所述第一参考信息,所述第一二进制编码的最低位为1,其他位为零。
可选地,在本申请一个实施例中,所述第二参考信息和转换得到的第二二进制编码具有如下关系:
若所述第二参考信息为零,所述第二二进制编码为空;或者
若所述第二参考信息不为零,所述第二二进制编码的长度为所述第二参考信息,所述第二二进制编码的最低位为1,其他位为零。
可选地,在本申请一个实施例中,所述第三参考信息和转换得到的第三二进制编码具有如下关系:
若所述第三参考信息为零,所述第三二进制编码为空;或者
若所述第三参考信息不为零,所述第三二进制编码的长度为所述第三参考信息,所述第三二进制编码的最低位为1,其他位为零。
可选地,在本申请一个实施例中,所述对所述标签树进行编码,包括:
确定所述待编码块的层LYR编码,所述待编码块的LYR编码用于指示所述待编码块在质量分层的包含信息。
可选地,在本申请一个实施例中,所述确定所述待编码块的LYR编码,包括:根据所述待编码块的ZBP编码,确定所述待编码块的LYR编码。
可选地,在本申请一个实施例中,所述根据所述待编码块的ZBP编码,确定所述待编码块的LYR编码,包括:
根据所述待编码块的ZBP编码和当前编码的质量分层,确定所述待编码块在所述质量分层中的LYR编码。
例如,从所述待编码块的ZBP编码的最高位开始,查找所述ZBP编码中第一个零的位置,将所述第一个零以及所述第一个零之前的比特位作为第一个质量分层的LYR编码;或若所述待编码块的ZBP编码为全1,确定所述ZBP编码为所述第一个质量分层的LYR编码。
进一步地,移除所述ZBP编码中的所述第一个零以及所述第一个零之前的比特位,将移位后的所述ZBP编码作为所述待编码块的更新后的ZBP 编码;
根据所述待编码块的更新后的ZBP编码,确定所述待编码块在下一质量分层的LYR编码;或者若所述待编码块的更新后的ZBP编码为全1,确定所述更新后的ZBP编码为下一个质量分层的LYR编码,循环执行上述过程。
可选地,在本申请一个实施例中,所述根据所述待编码块的ZBP编码和当前编码的质量分层,确定所述待编码块在所述质量分层中的LYR编码,还包括:
若所述待编码块在所述质量分层中第一次被包含,并且所述待编码块在所述质量分层中的LYR编码的最低比特位为1,不确定所述待编码块在后续其他质量分层中的LYR编码。
可选地,在本申请一个实施例中,所述确定所述待编码块的LYR编码,包括:
若所述待编码块的第一级高级节点被编码过,且当前编码的质量分层小于所述待编码块的父节点的ZBP信息,确定所述待编码块在所述质量分层的LYR编码为零。
可选地,在本申请一个实施例中,所述方法还包括:
将对所述待编码块进行编码得到的所述待编码块在所述质量分层的LYR编码和ZBP编码输出到所述质量分层对应的数据包的包头中。
可选地,在本申请一个实施例中,所述方法还包括:
在对所述标志树中所述待编码块的高级节点进行编码后,更新所述标志树中所述待编码块的高级节点的编码标识信息。
可选地,在本申请一个实施例中,所述更新所述标志树中所述待编码块的高级节点的编码标识信息,包括:
在对所述待编码块的第一级高级节点进行编码后,将所述待编码块的第一级高级节点和第二级高级节点的编码标识信息更新为已编码过;或
在对所述待编码块的第二级高级节点进行编码后,将所述待编码块的第二级高级节点的编码标识信息更新为已编码过。
可选地,在本申请一个实施例中,所述方法400还包括:
将所述待编码块的高级节点的编码标识信息存储到所述待编码块的高级节点对应的寄存器中。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其他任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的***、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (97)

  1. 一种编码方法,其特征在于,包括:
    获取待编码块集合中的每个待编码块的零比特平面ZBP信息或包含信息;
    根据所述每个待编码块的ZBP信息或包含信息构造标识树,以及并行对所述标签树进行编码。
  2. 根据权利要求1所述的编码方法,其特征在于,所述方法还包括:
    将所述每个待编码块的ZBP信息或包含信息存储在所述每个待编码块对应的寄存器中。
  3. 根据权利要求1或2所述的编码方法,其特征在于,所述根据所述每个待编码块的ZBP信息或包含信息构造标识树,包括:
    将所述待编码码块集合中的待编码块按照固定的数量进行分组,确定每个分组所指向的第一级高级节点;
    对所述每个分组所指向的第一级高级节点继续进行分组,确定所述第一级高级节点所指向的第二级高级节点,直到所述标志树中只有一个最高级节点。
  4. 根据权利要求3所述的编码方法,其特征在于,所述待编码块集合包括64个码块,编号分别为0至63,所述根据所述每个待编码块的ZBP信息构造标识树,包括:
    将编号为0至3的码块单独构造为四颗第一类标志树。
  5. 根据权利要求4所述的编码方法,其特征在于,所述根据所述每个待编码块的ZBP信息或包含信息构造标识树,以及并行对所述标签树进行编码,包括:
    在对编号0至3的码块进行编码时,并行构建所述待编码块集合中的其他待编码块的标志树。
  6. 根据权利要求4或5所述的编码方法,其特征在于,所述根据所述每个待编码块的ZBP信息或包含信息构造标识树,包括:
    将编号为4至7的待编码块,编号为8至11的待编码块,编号为12至15的待编码块进行分组,确定每个分组所指向的高级节点,得到三颗第二类标志树。
  7. 根据权利要求4至6中任一项所述的编码方法,其特征在于,所述 根据所述每个待编码块的ZBP信息构造标识树,包括:
    将编号为16至31的待编码块,编号为32至47的待编码块,编号为48至63的待编码块按照固定的数量进行分组,确定每个分组的高级节点,直到只剩一个最高级节点,得到三颗第三类标志树。
  8. 根据权利要求7所述的编码方法,其特征在于,所述根据所述每个待编码块的ZBP信息或包含信息构造标识树,包括:
    将所述编号为16至31的待编码块中的编号为16,17,20,21的待编码块分为一组,编号为18,19,22,23的待编码块分为一组,编号为26,27,30,31的待编码块分为一组,确定每个分组的第一级高级节点;
    根据所述每个分组的第一级高级节点,确定所述每个分组所指向的第二级高级节点,得到一颗所述第三类标志树。
  9. 根据权利要求3至8中任一项所述的编码方法,其特征在于,所述确定每个分组所指向的第一级高级节点,包括:
    将所述每个分组内的待编码块的ZBP信息中的最小值,确定为所述分组所指向的更高级节点的ZBP信息。
  10. 根据权利要求1至9中任一项所述的编码方法,其特征在于,所述对所述标签树进行编码,包括:
    根据所述标志树,确定所述待编码块的编码参考信息,所述编码参考信息用于指示所述待编码块至所述待编码块的最高级节点的路径上的节点和所述节点的父节点的ZBP信息之间的关系;
    根据所述待编码块的编码参考信息,确定所述待编码块的ZBP编码。
  11. 根据权利要求10所述的编码方法,其特征在于,所述根据所述标志树,确定所述待编码块的编码参考信息,包括:
    根据所述标志树,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,其中,所述第一参考信息用于指示所述待编码块的ZBP信息和所述待编码块的第一级高级节点的ZBP信息之间的关系,所述第二参考信息用于指示所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息之间的关系,所述第三参考信息用于指示所述待编码块的第二级高级节点的ZBP信息的信息与所述待编码块的第三级高级节点的ZBP信息之间的关系。
  12. 根据权利要求11所述的编码方法,其特征在于,所述待编码块的 第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息的差值加一,所述待编码块的第三参考信息为所述待编码块的第二级高级节点的ZBP信息与所述待编码块的第三级高级节点的ZBP信息的差值加一。
  13. 根据权利要求11或12所述的编码方法,其特征在于,所述根据所述标志树,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包括:
    根据所述标志树,结合所述待编码块是否具有高级节点,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  14. 根据权利要求13所述的编码方法,其特征在于,所述根据所述标志树,结合所述待编码块是否具有高级节点,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包括:
    若所述待编码块不具有高级节点,根据所述待编码块的ZBP信息,确定所述待编码块的第一参考信息,并确定所述待编码块的第二参考信息和所述第三参考信息为零。
  15. 根据权利要求14所述的编码方法,其特征在于,所述根据所述待编码块的ZBP信息,确定所述待编码块的第一参考信息,包括:
    确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息加一。
  16. 根据权利要求13所述的编码方法,其特征在于,所述根据所述标志树,结合所述待编码块是否具有高级节点,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包括:
    若所述待编码块具有高级节点,根据所述待编码块的高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  17. 根据权利要求16所述的编码方法,其特征在于,所述根据所述待编码块的高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包括:
    根据所述待编码块是否具有二级高级节点,结合所述待编码块的高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  18. 根据权利要求17所述的编码方法,其特征在于,所述根据所述待 编码块是否具有二级高级节点,结合所述待编码块的高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包括:
    若所述待编码块不具有二级高级节点,根据所述待编码块的第一高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  19. 根据权利要求18所述的编码方法,其特征在于,所述根据所述待编码块的第一高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包括:
    若所述待编码块的第一高级节点被编码过,根据所述待编码块的ZBP信息,确定所述待编码块的第一参考信息,并确定所述待编码块的第二参考信息和第三参考信息为零。
  20. 根据权利要求19所述的编码方法,其特征在于,所述根据所述待编码块的ZBP信息,确定所述待编码块的第一参考信息,包括:
    确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一。
  21. 根据权利要求18所述的编码方法,其特征在于,所述根据所述待编码块的第一高级节点的编码标识信息,确定所述待编码块的第一参考信息、第二参考信息和第三参考信息,包括:
    若所述待编码块的第一高级节点未被编码过,根据所述待编码块的ZBP信息和所述待编码块的第一级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息,并确定所述待编码块的第三参考信息为零。
  22. 根据权利要求18所述的编码方法,其特征在于,所述根据所述待编码块的ZBP信息和所述待编码块的第一级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息,包括:
    确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,并确定所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息加一。
  23. 根据权利要求17所述的编码方法,其特征在于,所述根据所述待编码块是否具有二级高级节点,结合所述待编码块的高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包 括:
    若所述待编码块具有二级高级节点,根据所述待编码块的第一高级节点的编码标识信息和所述待编码块的第二高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  24. 根据权利要求23所述的编码方法,其特征在于,所述根据所述待编码块的第一高级节点的编码标识信息和所述待编码块的第二高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包括:
    若所述待编码块的第一高级节点被编码过,根据所述待编码块的ZBP信息,确定所述待编码块的第一参考信息,并确定所述待编码块的第二参考信息和第三参考信息为零。
  25. 根据权利要求24所述的编码方法,其特征在于,所述根据所述待编码块的ZBP信息,确定所述待编码块的第一参考信息,包括:
    确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一。
  26. 根据权利要求24所述的编码方法,其特征在于,所述根据所述待编码块的第一高级节点的编码标识信息和所述待编码块的第二高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包括:
    若所述待编码块的第一高级节点未被编码过,根据所述待编码块的第二级高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  27. 根据权利要求26所述的编码方法,其特征在于,所述根据所述待编码块的第二级高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包括:
    若所述待编码块的第二级高级节点被编码过,根据所述待编码块的ZBP信息和所述待编码块的第一级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息,并确定所述待编码块的第三参考信息为零。
  28. 根据权利要求27所述的编码方法,其特征在于,所述根据所述待编码块的ZBP信息和所述待编码块的第一级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息,包括:
    确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,并确定所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息的差值加一。
  29. 根据权利要求26所述的编码方法,其特征在于,所述根据所述待编码块的第二级高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息,包括:
    若所述待编码块的第二级高级节未被编码过,根据所述待编码块的ZBP信息,所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息和第三参考信息。
  30. 根据权利要求29所述的编码方法,其特征在于,所述根据所述待编码块的ZBP信息,所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息和第三参考信息,包括:
    确定所述待编码块的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息的差值加一,所述待编码块的第三参考信息为所述待编码块的第二级高级节点的ZBP信息加一。
  31. 根据权利要求11至30中任一项所述的编码方法,其特征在于,所述根据所述待编码块的编码参考信息,确定所述待编码块的ZBP编码,包括:
    根据所述待编码块的第一参考信息,第二参考信息和第三参考信息,确定所述待编码块的ZBP编码。
  32. 根据权利要求31所述的编码方法,其特征在于,所述根据所述待编码块的第一参考信息,第二参考信息和第三参考信息,确定所述待编码块的ZBP编码,包括:
    将所述第一参考信息,所述第二参考信息和所述第三参考信息分别转换为第一二进制编码,第二二进制编码和第三二进制编码;
    将所述第三二进制编码,所述第二二进制编码和所述第一二进制编码进 行拼接,得到所述待编码块的ZBP编码。
  33. 根据权利要求32所述的编码方法,其特征在于,所述第一参考信息和转换得到的第一二进制编码具有如下关系:
    所述第一二进制编码的长度为所述第一参考信息,所述第一二进制编码的最低位为1,其他位为零。
  34. 根据权利要求32或33所述的编码方法,其特征在于,所述第二参考信息和转换得到的第二二进制编码具有如下关系:
    若所述第二参考信息为零,所述第二二进制编码为空;或者
    若所述第二参考信息不为零,所述第二二进制编码的长度为所述第二参考信息,所述第二二进制编码的最低位为1,其他位为零。
  35. 根据权利要求32至34中任一项所述的编码方法,其特征在于,所述第三参考信息和转换得到的第三二进制编码具有如下关系:
    若所述第三参考信息为零,所述第三二进制编码为空;或者
    若所述第三参考信息不为零,所述第三二进制编码的长度为所述第三参考信息,所述第三二进制编码的最低位为1,其他位为零。
  36. 根据权利要求1至35中任一项所述的编码方法,其特征在于,所述对所述标签树进行编码,包括:
    确定所述待编码块的层LYR编码,所述待编码块的LYR编码用于指示所述待编码块在质量分层的包含信息。
  37. 根据权利要求36所述的编码方法,其特征在于,所述确定所述待编码块的LYR编码,包括:
    根据所述待编码块的ZBP编码,确定所述待编码块的LYR编码。
  38. 根据权利要求37所述的编码方法,其特征在于,所述根据所述待编码块的ZBP编码,确定所述待编码块的LYR编码,包括:
    根据所述待编码块的ZBP编码和当前编码的质量分层,确定所述待编码块在所述质量分层中的LYR编码。
  39. 根据权利要求38所述的编码方法,其特征在于,所述根据所述待编码块的ZBP编码和当前编码的质量分层,确定所述待编码块在所述质量分层中的LYR编码,包括:
    从所述待编码块的ZBP编码的最高位开始,查找所述ZBP编码中第一个零的位置,将所述第一个零以及所述第一个零之前的比特位作为第一个质 量分层的LYR编码;或若所述待编码块的ZBP编码为全1,确定所述ZBP编码为所述第一个质量分层的LYR编码。
  40. 根据权利要求39所述的编码方法,其特征在于,所述根据所述待编码块的ZBP编码和当前编码的质量分层,确定所述待编码块在所述质量分层中的层编码,还包括:
    移除所述ZBP编码中的所述第一个零以及所述第一个零之前的比特位,将移位后的所述ZBP编码作为所述待编码块的更新后的ZBP编码;
    根据所述待编码块的更新后的ZBP编码,确定所述待编码块在下一质量分层的LYR编码;或者若所述待编码块的更新后的ZBP编码为全1,确定所述更新后的ZBP编码为下一个质量分层的LYR编码。
  41. 根据权利要求38至40中任一项所述的编码方法,其特征在于,所述根据所述待编码块的ZBP编码和当前编码的质量分层,确定所述待编码块在所述质量分层中的LYR编码,还包括:
    若所述待编码块在所述质量分层中第一次被包含,并且所述待编码块在所述质量分层中的LYR编码的最低比特位为1,不确定所述待编码块在后续其他质量分层中的LYR编码。
  42. 根据权利要求38至41中任一项所述的编码方法,其特征在于,所述确定所述待编码块的LYR编码,包括:
    若所述待编码块的第一级高级节点被编码过,且当前编码的质量分层小于所述待编码块的父节点的ZBP信息,确定所述待编码块在所述质量分层的LYR编码为零。
  43. 根据权利要求36至42中任一项所述的编码方法,其特征在于,所述方法还包括:
    将对所述待编码块进行编码得到的所述待编码块在所述质量分层的LYR编码和ZBP编码输出到所述质量分层对应的数据包的包头中。
  44. 根据权利要求1至42中任一项所述的编码方法,其特征在于,所述方法还包括:
    在对所述标志树中所述待编码块的高级节点进行编码后,更新所述标志树中所述待编码块的高级节点的编码标识信息。
  45. 根据权利要求44所述的编码方法,其特征在于,所述更新所述标志树中所述待编码块的高级节点的编码标识信息,包括:
    在对所述待编码块的第一级高级节点进行编码后,将所述待编码块的第一级高级节点和第二级高级节点的编码标识信息更新为已编码过;或
    在对所述待编码块的第二级高级节点进行编码后,将所述待编码块的第二级高级节点的编码标识信息更新为已编码过。
  46. 根据权利要求44或45所述的编码方法,其特征在于,所述方法还包括:
    将所述待编码块的高级节点的编码标识信息存储到所述待编码块的高级节点对应的寄存器中。
  47. 一种编码器,其特征在于,包括:
    读取电路,用于获取待编码块集合中的每个待编码块的零比特平面ZBP信息或包含信息;
    建树电路,用于根据所述每个待编码块的ZBP信息或包含信息构造标识树;
    编码电路,用于在所述建树电路构造所述标志树时,并行对所述标签树进行编码。
  48. 根据权利要求47所述的编码器,其特征在于,所述编码器还包括:
    多个第一寄存器,用于存储所述每个待编码块的ZBP信息或包含信息。
  49. 根据权利要求47或48所述的编码器,其特征在于,所述建树电路还用于:
    将所述待编码码块集合中的待编码块按照固定的数量进行分组,确定每个分组所指向的第一级高级节点;
    对所述每个分组所指向的第一级高级节点继续进行分组,确定所述第一级高级节点所指向的第二级高级节点,直到所述标志树中只有一个最高级节点。
  50. 根据权利要求49所述的编码器,其特征在于,所述建树电路包括:
    多个第一级比较器,用于根据每个分组内的待编码块的ZBP信息确定所述每个分组所指向的第一级高级节点的ZBP信息;以及
    多个第二级比较器,用于根据每个分组内的第一级高级节点的ZBP信息确定所述每个分组所指向的第二级高级节点的ZBP信息。
  51. 根据权利要求49所述的编码器,其特征在于,所述建树电路具体用于:
    将编号为0至3的码块单独构造为四颗第一类标志树。
  52. 根据权利要求51所述的编码器,其特征在于,所述建树电路还用于:
    在所述编码电路对编号0至3的码块进行编码时,并行构建所述待编码块集合中的其他待编码块的标志树。
  53. 根据权利要求49至52中任一项所述的编码器,其特征在于,所述建树电路还用于:
    将编号为4至7的待编码块,编号为8至11的待编码块,编号为12至15的待编码块进行分组,确定每个分组所指向的高级节点,得到三颗第二类标志树。
  54. 根据权利要求49至53中任一项所述的编码器,其特征在于,所述建树电路还用于:
    将编号为16至31的待编码块,编号为32至47的待编码块,编号为48至63的待编码块按照固定的数量进行分组,确定每个分组的高级节点,直到只剩一个最高级节点,得到三颗第三类标志树。
  55. 根据权利要求54所述的编码器,其特征在于,所述建树电路具体用于:
    将所述编号为16至31的待编码块中的编号为16,17,20,21的待编码块分为一组,编号为18,19,22,23的待编码块分为一组,编号为26,27,30,31的待编码块分为一组,确定每个分组的第一级高级节点;
    根据所述每个分组的第一级高级节点,确定所述每个分组所指向的第二级高级节点,得到一颗所述第三类标志树。
  56. 根据权利要求47至55中任一项所述的编码器,其特征在于,所述编码电路包括:
    第一编码电路,用于根据所述标志树,确定所述待编码块的编码参考信息,所述编码参考信息用于指示所述待编码块至所述待编码块的最高级节点的路径上的节点和所述节点的父节点的ZBP信息之间的关系;
    第二编码电路,用于根据所述待编码块的编码参考信息,确定所述待编码块的ZBP编码。
  57. 根据权利要求56所述的编码器,其特征在于,所述编码参考信息包括第一参考信息,第二参考信息和第三参考信息,其中,所述第一参考信 息用于指示所述待编码块的ZBP信息和所述待编码块的第一级高级节点的ZBP信息之间的关系,所述第二参考信息用于指示所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息之间的关系,所述第三参考信息用于指示所述待编码块的第二级高级节点的ZBP信息的信息与所述待编码块的第三级高级节点的ZBP信息之间的关系。
  58. 根据权利要求57所述的编码器,其特征在于,所述待编码块的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息的差值加一,所述待编码块的第三参考信息为所述待编码块的第二级高级节点的ZBP信息与所述待编码块的第三级高级节点的ZBP信息的差值加一。
  59. 根据权利要求57或58所述的编码器,其特征在于,所述第一编码电路还用于:
    根据所述标志树,结合所述待编码块是否具有高级节点,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  60. 根据权利要求59所述的编码器,其特征在于,所述第一编码电路具体用于:
    若所述待编码块不具有高级节点,根据所述待编码块的ZBP信息,确定所述待编码块的第一参考信息,并确定所述待编码块的第二参考信息和所述第三参考信息为零。
  61. 根据权利要求60所述的编码器,其特征在于,所述第一编码电路还用于:
    确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息加一。
  62. 根据权利要求59所述的编码器,其特征在于,所述第一编码电路还用于:
    若所述待编码块具有高级节点,根据所述待编码块的高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  63. 根据权利要求62所述的编码器,其特征在于,所述第一编码电路还用于:
    根据所述待编码块是否具有二级高级节点,结合所述待编码块的高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第 三参考信息。
  64. 根据权利要求63所述的编码器,其特征在于,所述第一编码电路具体用于:
    若所述待编码块不具有二级高级节点,根据所述待编码块的第一高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  65. 根据权利要求64所述的编码器,其特征在于,所述第一编码电路具体用于:
    若所述待编码块的第一高级节点被编码过,根据所述待编码块的ZBP信息,确定所述待编码块的第一参考信息,并确定所述待编码块的第二参考信息和第三参考信息为零。
  66. 根据权利要求65所述的编码器,其特征在于,所述第一编码电路具体用于:
    确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一。
  67. 根据权利要求64所述的编码器,其特征在于,所述第一编码电路还用于:
    若所述待编码块的第一高级节点未被编码过,根据所述待编码块的ZBP信息和所述待编码块的第一级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息,并确定所述待编码块的第三参考信息为零。
  68. 根据权利要求64所述的编码器,其特征在于,所述第一编码电路具体用于:
    确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,并确定所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息加一。
  69. 根据权利要求63所述的编码器,其特征在于,所述第一编码电路还用于:
    若所述待编码块具有二级高级节点,根据所述待编码块的第一高级节点的编码标识信息和所述待编码块的第二高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  70. 根据权利要求69所述的编码器,其特征在于,所述第一编码电路 还用于:
    若所述待编码块的第一高级节点被编码过,根据所述待编码块的ZBP信息,确定所述待编码块的第一参考信息,并确定所述待编码块的第二参考信息和第三参考信息为零。
  71. 根据权利要求70所述的编码器,其特征在于,所述第一编码电路具体用于:
    确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一。
  72. 根据权利要求70所述的编码器,其特征在于,所述第一编码电路还用于:
    若所述待编码块的第一高级节点未被编码过,根据所述待编码块的第二级高级节点的编码标识信息,确定所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  73. 根据权利要求72所述的编码器,其特征在于,所述第一编码电路还用于:
    若所述待编码块的第二级高级节点被编码过,根据所述待编码块的ZBP信息和所述待编码块的第一级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息,并确定所述待编码块的第三参考信息为零。
  74. 根据权利要求73所述的编码器,其特征在于,所述第一编码电路具体用于:
    确定所述待编码节点的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,并确定所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息的差值加一。
  75. 根据权利要求72所述的编码器,其特征在于,所述第一编码电路还用于:
    若所述待编码块的第二级高级节未被编码过,根据所述待编码块的ZBP信息,所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息,确定所述待编码块的第一参考信息和第二参考信息和第三参考信息。
  76. 根据权利要求75所述的编码器,其特征在于,所述第一编码电路 具体用于:
    确定所述待编码块的第一参考信息为所述待编码块的ZBP信息与所述待编码块的第一级高级节点的ZBP信息的差值加一,所述待编码块的第二参考信息为所述待编码块的第一级高级节点的ZBP信息和所述待编码块的第二级高级节点的ZBP信息的差值加一,所述待编码块的第三参考信息为所述待编码块的第二级高级节点的ZBP信息加一。
  77. 根据权利要求57至76中任一项所述的编码器,其特征在于,所述第一编码电路包括:
    数据选择器MUX,用于在计算所述待编码块的第一参考信息,第二参考信息和第三参考信息时,选通所述待编码块对应的第一级高级节点和第二级高级节点,以获取对应的第一级高级节点和第二级高级节点的ZBP信息;
    计算单元,用于计算所述待编码块的第一参考信息,第二参考信息和第三参考信息。
  78. 根据权利要求77所述的编码器,其特征在于,所述第一编码电路还包括多个第二寄存器,用于存储所述每个待编码块的第一参考信息,第二参考信息和第三参考信息。
  79. 根据权利要求57至78中任一项所述的编码器,其特征在于,所述第二编码电路具体用于:
    根据所述待编码块的第一参考信息,第二参考信息和第三参考信息,确定所述待编码块的ZBP编码。
  80. 根据权利要求79所述的编码器,其特征在于,所述第二编码电路具体用于:
    将所述第一参考信息,所述第二参考信息和所述第三参考信息分别转换为第一二进制编码,第二二进制编码和第三二进制编码;
    将所述第三二进制编码,所述第二二进制编码和所述第一二进制编码进行拼接,得到所述待编码块的ZBP编码。
  81. 根据权利要求80所述的编码器,其特征在于,所述第一参考信息和转换得到的第一二进制编码具有如下关系:
    所述第一二进制编码的长度为所述第一参考信息,所述第一二进制编码的最低位为1,其他位为零。
  82. 根据权利要求80或81所述的编码器,其特征在于,所述第二参考 信息和转换得到的第二二进制编码具有如下关系:
    若所述第二参考信息为零,所述第二二进制编码为空;或者
    若所述第二参考信息不为零,所述第二二进制编码的长度为所述第二参考信息,所述第二二进制编码的最低位为1,其他位为零。
  83. 根据权利要求80或82中任一项所述的编码器,其特征在于,所述第三参考信息和转换得到的第三二进制编码具有如下关系:
    若所述第三参考信息为零,所述第三二进制编码为空;或者
    若所述第三参考信息不为零,所述第三二进制编码的长度为所述第三参考信息,所述第三二进制编码的最低位为1,其他位为零。
  84. 根据权利要求80至83中任一项所述的编码器,其特征在于,所述第二编码电路包括:
    编码值组合单元,用于将所述待编码块的第三二进制编码,第二二进制编码和第一二进制编码进行拼接,得到所述待编码块的ZBP编码;
    多个第三寄存器,用于存储所述每个待编码块的ZBP编码。
  85. 根据权利要求47至84中任一项所述的编码器,其特征在于,所述第三编码电路具体用于:
    确定所述待编码块的层LYR编码,所述待编码块的LYR编码用于指示所述待编码块在质量分层的包含信息。
  86. 根据权利要求85所述的编码器,其特征在于,所述第三编码电路具体用于:
    根据所述待编码块的ZBP编码,确定所述待编码块的LYR编码。
  87. 根据权利要求86所述的编码器,其特征在于,所述第三编码电路具体用于:
    根据所述待编码块的ZBP编码和编码的质量分层,确定所述待编码块在所述质量分层中的LYR编码。
  88. 根据权利要求87所述的编码器,其特征在于,所述第三编码电路具体用于:
    从所述待编码块的ZBP编码的最高位开始,查找所述ZBP编码中第一个零的位置,将所述第一个零以及所述第一个零之前的比特位作为第一个质量分层的LYR编码;或若所述待编码块的ZBP编码为全1,确定所述ZBP编码为所述第一个质量分层的LYR编码。
  89. 根据权利要求88所述的编码器,其特征在于,所述第三编码电路还用于:
    移除所述ZBP编码中的所述第一个零以及所述第一个零之前的比特位,将移位后的所述ZBP编码作为所述待编码块的更新后的ZBP编码;
    根据所述待编码块的更新后的ZBP编码,确定所述待编码块在下一质量分层的LYR编码;或者若所述待编码块的更新后的ZBP编码为全1,确定所述更新后的ZBP编码为下一个质量分层的LYR编码。
  90. 根据权利要求87至89中任一项所述的编码器,其特征在于,所述第三编码电路还用于:
    若所述待编码块在所述质量分层中第一次被包含,并且所述待编码块在所述质量分层中的LYR编码的最低比特位为1,不确定所述待编码块在后续其他质量分层中的LYR编码。
  91. 根据权利要求87至90中任一项所述的编码器,其特征在于,所述确定所述待编码块的LYR编码,包括:
    若所述待编码块的第一级高级节点被编码过,且当前编码的质量分层小于所述待编码块的父节点的ZBP信息,确定所述待编码块在所述质量分层的LYR编码为零。
  92. 根据权利要求85至91中任一项所述的编码器,其特征在于,所述第三编码电路可以包括:
    K个处理单元,用于确定所述待编码块在K个质量分层中的每个质量分层中的LYR编码,其中,所述K大于1;
    K个第四寄存器,用于缓存所述K个处理单元输出的处理结果,所述处理结果包括所述待编码块在质量分层中的LYR编码以及移位后的ZBP编码。
  93. 根据权利要求85至92中任一项所述的编码器,其特征在于,所述编码器还包括:
    码流生成模块,用于将对所述待编码块进行编码得到的所述待编码块在所述质量分层的LYR编码和ZBP编码输出到所述质量分层的码流的数据包的包头中。
  94. 根据权利要求57至93中任一项所述的编码器,其特征在于,所述第一编码电路还用于:
    在对所述标志树中所述待编码块的高级节点进行编码后,更新所述待编 码块的高级节点的编码标识信息。
  95. 根据权利要求94所述的编码器,其特征在于,所述第一编码电路具体用于:
    在对所述待编码块的第一级高级节点进行编码后,将所述待编码块的第一级高级节点和第二级高级节点的编码标识信息更新为已编码过;或
    在对所述待编码块的第二级高级节点进行编码后,将所述待编码块的第二级高级节点的编码标识信息更新为已编码过。
  96. 根据权利要求94或95所述的编码器,其特征在于,所述编码器还包括:
    多个第五寄存器,用于存储所述每个待编码块的高级节点的编码标识信息。
  97. 一种编码***,其特征在于,包括:
    tier-1编码电路,用于对待编码图像的图像块的码块进行tier-1编码,得到所述码块的零比特平面ZBP信息或包含信息;
    存储器,用于存储所述码块的ZBP信息或包含信息;
    如权利要求47-96中任一项所述的编码器,用于从所述存储器中获取所述码块的ZBP信息或包含信息,并根据所述码块的ZBP信息或包含信息构造标志树,以及并行对所述码块进行编码,得到所述码块的ZBP编码和层LYR编码。
PCT/CN2019/093379 2019-06-27 2019-06-27 编码方法、编码器和编码*** WO2020258189A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980009151.4A CN111699687A (zh) 2019-06-27 2019-06-27 编码方法、编码器和编码***
PCT/CN2019/093379 WO2020258189A1 (zh) 2019-06-27 2019-06-27 编码方法、编码器和编码***

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/093379 WO2020258189A1 (zh) 2019-06-27 2019-06-27 编码方法、编码器和编码***

Publications (1)

Publication Number Publication Date
WO2020258189A1 true WO2020258189A1 (zh) 2020-12-30

Family

ID=72476319

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/093379 WO2020258189A1 (zh) 2019-06-27 2019-06-27 编码方法、编码器和编码***

Country Status (2)

Country Link
CN (1) CN111699687A (zh)
WO (1) WO2020258189A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1442807A (zh) * 2003-04-07 2003-09-17 西安交通大学 Tagtree编码器的vlsi设计方法
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
CN104661038A (zh) * 2009-12-10 2015-05-27 Sk电信有限公司 使用树形结构的解码装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101360242B (zh) * 2008-09-22 2010-06-02 西安电子科技大学 基于JPEG2000的Tag-tree编码方法
CN108513130B (zh) * 2017-12-29 2019-10-08 西安电子科技大学 一种Tag-Tree编码的实现***及方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
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 (zh) * 2003-04-07 2003-09-17 西安交通大学 Tagtree编码器的vlsi设计方法
CN104661038A (zh) * 2009-12-10 2015-05-27 Sk电信有限公司 使用树形结构的解码装置

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WANG, YILUO: "VLSI Design of T2 Encoder in EBCOT)", CHINA MASTER’S THESES FULL-TEXT DATABASE, 1 January 2009 (2009-01-01), pages 1 - 43, XP055773443 *
XU, WEIZHE: "VLSI Design of EBCOT in JPEG2000 Encoder", CHINA MASTER’S THESES FULL-TEXT DATABASE, 1 July 2013 (2013-07-01), pages 1 - 57, XP055773434 *

Also Published As

Publication number Publication date
CN111699687A (zh) 2020-09-22

Similar Documents

Publication Publication Date Title
AU2004240453B2 (en) Combined runlength coding and variable length coding for video compression
US5818877A (en) Method for reducing storage requirements for grouped data values
US7411529B2 (en) Method of decoding bin values using pipeline architecture and decoding device therefor
KR100775872B1 (ko) LASeR 이진 표현의 포인트 시퀀스 부호화/복호화 방법및 장치
US20110150351A1 (en) Parallelization of variable length decoding
JP2010509893A5 (zh)
EP1946246A2 (en) Extended amplitude coding for clustered transform coefficients
US20060126743A1 (en) Variable length code decoder and decoding method for variable length codes
BR112021001807A2 (pt) codificação de entropia para codificação de aprimoramento de sinal
US9665590B2 (en) Bitmap compression for fast searches and updates
WO2021012278A1 (zh) 一种数据的处理方法、***、编码器及解码器
US7609000B1 (en) Variable-length compression technique for encoding or decoding a sequence of integers
Mobasseri et al. Watermarking of MPEG-2 video in compressed domain using VLC mapping
WO2020258188A1 (zh) 解码方法、解码器和解码***
CN112449191B (zh) 压缩多个图像的方法、解压缩图像的方法和装置
CN101657973B (zh) 采用位精度的编码装置和编码方法
WO2020258189A1 (zh) 编码方法、编码器和编码***
US20140092987A1 (en) Entropy coding techniques and protocol to support parallel processing with low latency
US20140044194A1 (en) Entropy coding techniques and protocol to support parallel processing with low latency
JP4502384B2 (ja) 可変長符号復号化装置及び可変長符号復号化方法
WO2020186535A1 (zh) 点云属性编码方法和装置以及点云属性解码方法和装置
US8970405B2 (en) Method and apparatus for entropy decoding
CN101093998A (zh) 解码方法及装置
JP4727669B2 (ja) LASeR二進表現のポイントシーケンス符号化/復号化方法及び装置
CN100527847C (zh) 基于零前缀码的变长码解码方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19935489

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19935489

Country of ref document: EP

Kind code of ref document: A1