Encoding device, decoding device, encoding method, decoding method, data structure, and program
By employing multiple codebooks or code trees with a structured triplet format and prefix condition satisfaction, the technique addresses the challenge of unique decoding in reversible compression encoding, enabling efficient and precise bit-length assignment for encoding rules.
Patent Information
- Application Number
- PCT/JP2023/008630
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2024-09-12
AI Technical Summary
Existing reversible compression encoding techniques face challenges in uniquely decoding encoding rules expressed using multiple codebooks or code trees, limiting the number of encoding rules that can be expressed and increasing codebook size exponentially with input length.
The use of multiple codebooks or code trees with a predetermined structure, where each codebook consists of a triplet of an input pattern, an output codeword, and a next codebook, and is assigned a mode that ensures all expanded codewords satisfy the prefix condition, allowing for unique decoding.
This approach enables the expression of any encoding rule that satisfies unique decodability conditions, allowing for flexible and concise code design without increasing codebook size, and supports bit-length assignment with precision less than 1 bit per input.
Smart Images

Figure JP2023008630_12092024_PF_FP_ABST
Abstract
Description
Encoding device, decoding device, encoding method, decoding method, data structure, program
[0001] The present invention relates to a technique for lossless compression coding of finite-precision digital signals or digital data.
[0002] Currently, technologies have been developed for lossless compression coding of finite-precision digital signals and digital data, such as audio signals, image signals, time series signals obtained from various sensors (e.g., brightness sensors, acceleration sensors, and seismometers), character strings, and word sequences. When designing lossless compression coding technologies, rules for determining which codewords should be output for which inputs (hereafter referred to as coding rules) are expressed using codebooks or code trees. Consider inputs a, b, and c. These sequences are converted into codewords consisting of 0s and 1s, and the expected code length (hereafter referred to as expected code length) is minimized. In this case, it is effective to design a codebook that assigns the shortest codeword to the input with the highest occurrence probability among a, b, and c. For example, if the most frequently occurring input is a, then a codebook design such as (a, 1), (b, 01), and (c, 00) is appropriate. However, this design method cannot assign codewords to each input with precision less than one bit. Therefore, no matter how frequently input a occurs, the expected code length cannot be shortened beyond the rule shown above. Therefore, a method is known in which codewords are assigned to multiple sets of inputs, and the length of the codeword is more suitable for the input distribution. If the occurrence probability of input a is extremely high, a codeword can be assigned to input length 2 patterns such as (aa, 1), (ab, 011), (ac, 010), (ba, 0011), (ca, 0010), (bb, 00011), (bc, 00010), (cb, 000011), and (cc, 000010). This allows a 1-bit codeword to be assigned to input aa, and the length of the codeword per input can be less than 1 bit.
[0003] However, with this method, the longer the input length stored in the codebook, the finer the bit length assignment becomes, but the size of the codebook becomes exponentially larger. For example, if codewords are assigned to patterns with an input length of 7 for inputs a, b, and c, it is necessary to store codeword assignments for approximately 2,000 patterns, which is 3 to the power of 7.
[0004] Therefore, in order to enable allocation of a fine number of bits without increasing the size of the codebook, Non-Patent Document 1 discloses a technique in which multiple codebooks with an input length of 1 are provided and the encoding process is performed while switching the codebook to be used for encoding the next input depending on the context of which pattern of input has been encoded.
[0005] R. Sugiura, Y. Kamamoto, N. Harada and T. Moriya, “Optimal Golomb-Rice Code Extension for Lossless Coding of Low-Entropy Exponentially Distributed Sources,” in IEEE Transactions on Information Theory, vol.64, no.4, pp.3153-3161, April 2018.
[0006] However, when a coding rule is expressed using a simple codebook or code tree, it is difficult to ensure that a code using multiple codebooks / code trees can be uniquely decoded, and for example, the method described in Non-Patent Document 1 realizes unique decoding of a code by utilizing a special code structure. As a result, the method described in Non-Patent Document 1 has a problem in that, of all uniquely decodable codes, only a very small number can be expressed as multiple codebooks / code trees.
[0007] Therefore, an object of the present invention is to provide an encoding / decoding technique using multiple codebooks or code trees that can express any encoding rule that satisfies the condition that it can be uniquely decoded.
[0008] One aspect of the present invention is a pattern sequence x0x1...x of length L (where L is an integer equal to or greater than 2). L-1 (However, x i (i=0, 1,…, L-1) is a pattern) and the pattern sequence x0x1…x L-1 a coding device that outputs a codeword (hereinafter referred to as an output codeword) corresponding to a plurality of codebooks or code trees {T k} k=0 K-1 (where K is an integer greater than or equal to 2) to find pattern x i The codeword w corresponding to i and obtain the codewords w0, w1, …, w L-1 The codeword w0w1...w obtained by concatenating L (However, w L is a terminal codeword) as the output codeword, and k (k=0, 1, ..., K-1) consists of a triplet of a pattern, a codeword, and the next codebook or code tree to be used, and is assigned a mode, which is a set of codewords. The set consisting of all the expanded codewords of the codebook or code tree satisfies the prefix condition, and the expanded codewords of the codebook or code tree begin with any of the codewords included in the mode assigned to the codebook or code tree.
[0009] One aspect of the present invention is a decoding device that receives a codeword to be decoded (hereinafter referred to as an input codeword) and a pattern sequence of length L to be output, and outputs a pattern sequence of length L corresponding to the input codeword (hereinafter referred to as an output pattern sequence), and that uses a plurality of codebooks or code trees {T k} k=0 K-1 (where K is an integer greater than or equal to 2, k} k=0 K-1 a decoding unit that obtains patterns corresponding to code words that constitute the input code word using a plurality of codebooks or code trees used in the encoding process of the input code word, and outputs a pattern sequence of length L obtained by concatenating the obtained patterns as the output pattern sequence, and k(k=0, 1, ..., K-1) consists of a triplet of a pattern, a codeword, and the next codebook or code tree to be used, and is assigned a mode, which is a set of codewords. The set consisting of all the expanded codewords of the codebook or code tree satisfies the prefix condition, and the expanded codewords of the codebook or code tree begin with any of the codewords included in the mode assigned to the codebook or code tree.
[0010] According to the present invention, by using a plurality of codebooks or code trees having a predetermined structure, it becomes possible to express any coding rule that satisfies the condition that it can be uniquely decoded.
[0011] 1 is a diagram showing an example of a codebook; FIG. 2 is a diagram showing an example of a code tree; FIG. 3 is a block diagram showing the configuration of an encoding device 100; FIG. 4 is a flowchart showing the operation of the encoding device 100; FIG. 5 is a block diagram showing the configuration of a decoding device 200; FIG. 6 is a flowchart showing the operation of the decoding device 200; and FIG. 7 is a diagram showing an example of the functional configuration of a computer that realizes each device in an embodiment of the present invention.
[0012] Hereinafter, an embodiment of the present invention will be described in detail. Note that components having the same functions are given the same numbers and redundant explanations will be omitted.
[0013] Before describing each embodiment, the notation used in this specification will be explained.
[0014] ^ (caret) represents a superscript, e.g., x y^z Yes z is a superscript to x, and x y^z Yes z is a subscript to x. Also, _ (underscore) represents a subscript. For example, x y_z Yes z is a superscript to x, and x y_z Yes z is a subscript to x.
[0015] The superscripts "^" and "~" such as ^x and ~x for a certain letter x should be written directly above the "x", but due to restrictions on the notation in the specification, they are written as ^x and ~x.
[0016] <Technical Background> In encoding / decoding according to an embodiment of the present invention, a plurality of codebooks having a predetermined structure are used to be able to express any coding rule that satisfies the condition that it can be uniquely decoded (hereinafter referred to as the unique decodability condition). Note that a code tree may be used instead of the codebook, and this does not result in any difference in the encoding procedure / decoding procedure.
[0017] <<1: Codebook / Code Tree>> First, a mode will be described, which is a concept necessary for explaining codebooks used in embodiments of the present invention. A set of codewords is defined as a mode for a codebook. A mode is assigned to each of multiple codebooks used for encoding / decoding. Since a mode assigned to a codebook is defined as a set of codewords, it is assumed that there is no overlap of codewords included in a mode. It is preferable that a mode satisfy a prefix condition. Here, the prefix condition is a condition that, for any codeword included in a set whose elements are codewords, the codeword does not prefix any other codeword included in the set. For example, if there are two codebooks, codebook T0 and codebook T1, the modes assigned to codebook T0 and codebook T1 can be defined as {1, 00} and {10, 11, 01}, respectively.
[0018] The codebook used in the embodiment of the present invention consists of a triplet of an input pattern, an output codeword, and the next codebook to be used. FIG. 1 shows an example of a codebook. The codebook in FIG. 1 is used to encode a pattern sequence, which is a sequence of patterns {a, b}, into a codeword, which is a sequence of codes {0, 1}, and consists of five codebooks: T0, T1, T2, T3, and T4. λ in FIG. 1 represents a codeword of length 0. Note that codeword λ can be the prefix of any codeword. Codebook T0 is assigned the mode {λ}, and codebook T1 is assigned the mode {1, 001}. Codebook T0 outputs codeword λ for pattern a, and the next codebook to be used is T1. Codebook T0 outputs codeword 0 for pattern b, and the next codebook to be used is T2.
[0019] Next, we will explain the conditions required for a codebook so that encoding / decoding in an embodiment of the present invention satisfies the unique decodability condition. To this end, we will define the concept of an expanded codeword. A codeword is an expanded codeword of a codebook if it is obtained by concatenating a codeword included in the codebook with a codeword that is an element of a mode assigned to the next codebook to be used and corresponds to the codeword. Here, a codeword included in a codebook refers to a codeword that is an element of a triplet constituting the codebook. For example, the expanded codewords of codebook T0 in FIG. 1 are codewords 1 and 011 obtained by concatenating codeword λ corresponding to pattern a with codeword 1 and 011, which are elements of mode {1, 011} assigned to the next codebook T1 to be used and corresponds to pattern a, and codewords 00 and 010 obtained by concatenating codeword 0 corresponding to pattern b with codeword 0 and 10, which are elements of mode {0, 10} assigned to the next codebook T2 to be used and corresponds to pattern b.
[0020] The following two conditions are required for the codebook in order for encoding / decoding to satisfy the unique decodability condition.
[0021] (1) For any codebook included in a plurality of codebooks, a set consisting of all expanded codewords in the codebook satisfies the prefix condition.
[0022] (2) For any codebook included in a plurality of codebooks, the expanded codeword of the codebook has as its prefix any codeword included in the mode assigned to the codebook.
[0023] When encoding / decoding using multiple codebooks is uniquely decodable, multiple codebooks including a codebook to which a mode that does not satisfy the prefix condition is assigned can be expressed as multiple codebooks to which only modes that satisfy the prefix condition are assigned, which are equivalent except for the terminal codeword (i.e., expressing a rule that assigns the same codeword except for the terminal codeword to the same input). Since multiple codebooks to which only modes that satisfy the prefix condition are assigned provide a more concise expression, as mentioned above, it is preferable that the modes satisfy the prefix condition. Terminal codewords will be described later.
[0024] As mentioned above, the coding rule can also be expressed using a code tree. Figure 2 shows an example of a code tree, and the code tree in Figure 2 is equivalent to the codebook in Figure 1. The above explanation of the codebook also applies to the code tree, simply by replacing the word "codebook" with "code tree." By replacing the word "codebook," the following explanation of the code tree can be obtained:
[0025] A set of code words for a code tree is defined as a mode. A mode is assigned to each of the multiple code trees used for encoding / decoding.
[0026] A code tree is composed of a triplet of an input pattern, an output code word, and the code tree to be used next.
[0027] A code word is an expanded code word of a code tree if it is obtained by concatenating a code word included in the code tree with a code word that is an element of a mode assigned to the next code tree to be used, corresponding to the code word. Here, a code word included in a code tree refers to a code word that is an element of a triplet that constitutes the code tree.
[0028] The following two conditions are required for the code tree in order for encoding / decoding to satisfy the unique decodability condition.
[0029] (1) For any code tree included in a plurality of code trees, a set consisting of all expanded code words of the code tree satisfies the prefix condition.
[0030] (2) For any code tree included in a plurality of code trees, the expanded code word of the code tree has any code word included in the mode assigned to the code tree as its prefix.
[0031] <<2: Encoding Procedure / Decoding Procedure>> First, the encoding procedure in the embodiment of the present invention will be described. The encoding procedure in the embodiment of the present invention is a sequence of patterns x0x1...x of length L (where L is an integer equal to or greater than 2). L-1 (However, x i (i=0, 1,…, L-1) is a pattern) is input, and multiple codebooks {T k} k=0 K-1 (where K is an integer greater than or equal to 2) to find pattern x i The codeword w corresponding to i and obtain the codewords w0, w1, …, w L-1 The codeword w0w1...w obtained by concatenating L (However, w L is the terminal codeword). k} k=0 K-1 Using pattern x i The codeword w corresponding to i In the process of obtaining the pattern sequence x0x1…x L-1 The pattern x that composes i For (i=0, 1,…, L-1), in turn, use the current codebook to find the pattern x i The codeword w corresponding to i Obtain the pattern x i The process of setting the next codebook to be used corresponding to the current codebook is repeated.
[0032] More specifically, the encoding procedure in the embodiment of the present invention comprises the following three processes.
[0033] (1) A predetermined codebook T k is used as the current codebook to start encoding, where k is an arbitrary integer between 0 and K-1, for example, k=0.
[0034] (2) For i=0, 1,..., L-1, use the current codebook to find the pattern x i The codeword w corresponding to i Obtain the pattern x i The next codebook to be used corresponding to is set as the current codebook.
[0035] (3) After the process (2) for i=L-1 is completed, select one element of the mode assigned to the current codebook and assign that element to the terminal codeword w L and obtain the codeword w0w1...w L is output, and the encoding process ends.
[0036] In addition, the terminal codeword w L can be any element of the mode assigned to the current codebook, for example, the codeword with the shortest length among the elements of the mode assigned to the current codebook.
[0037] Next, a decoding procedure in the embodiment of the present invention will be described. The decoding procedure in the embodiment of the present invention takes a codeword to be decoded (hereinafter referred to as an input codeword) and the length L of a pattern sequence to be output as input, and k} k=0 K-1 (However, if multiple codebooks {T k} k=0 K-1 is the codebook used in the encoding procedure) to obtain patterns corresponding to the codewords that make up the input codeword, and output a pattern sequence of length L obtained by concatenating the obtained patterns. k} k=0 K-1In the process of obtaining a pattern corresponding to a codeword constituting an input codeword using
[0000] , if there is a codeword (hereinafter referred to as codeword w) included in the current codebook that matches the prefix of the current codeword, and if there is a codeword included in the mode assigned to the codebook to be used next that matches the prefix of a codeword obtained by deleting the prefix that matches that of codeword w from the current codeword, a pattern corresponding to that codeword w is obtained, the codebook to be used next that corresponds to that codeword w is set as the current codebook, and the codeword obtained by deleting the prefix that matches that of codeword w from the current codeword is set as the current codeword, this process is repeated until a pattern sequence of length L is obtained. Here, the current codeword refers to the codeword currently being decoded, and the current codeword at the start of decoding refers to the input codeword.
[0038] More specifically, the decoding procedure in the embodiment of the present invention comprises the following three processes.
[0039] (1) A predetermined codebook T k is set as the current codebook and decoding begins. Here, k is the codebook number used when the encoding process of the input codeword began. Also, the input codeword is set as the current codeword.
[0040] (2) Using the current codebook, compare the current codeword with the codewords contained in that codebook. If there is a codeword (hereinafter referred to as codeword w) contained in the current codebook that matches the prefix of the current codeword, and if there is a codeword contained in the mode assigned to the codebook to be used next that matches the prefix of the codeword obtained by deleting the prefix that matches that of codeword w from the current codeword, obtain a pattern corresponding to that codeword w, set the codebook to be used next that corresponds to that codeword w as the current codebook, and set the codeword obtained by deleting the prefix that matches that of codeword w from the current codeword as the current codeword.
[0041] (3) If the length of the pattern sequence obtained by concatenating the patterns obtained by the process in (2) is L, the pattern sequence of length L is output and the decoding process is terminated, but otherwise, the process returns to the process in (2).
[0042] The encoding procedure / decoding procedure using the codebook described above can also be converted to an encoding procedure / decoding procedure using a code tree simply by replacing the word "codebook" with "code tree."
[0043] <<3: Example of Encoding / Decoding>> Here, as an example of encoding / decoding, encoding / decoding of the pattern sequence abbaa when using the codebook in Fig. 1 will be described. First, encoding will be described. Here, it is assumed that codebook T0 is used as the current codebook at the start of the encoding process. Note that the input is the pattern sequence abbaa to be encoded.
[0044] (1) For the first pattern a in the pattern sequence abbaa, the current codebook T0 is used to obtain the codeword λ as the codeword corresponding to pattern a, and the codebook T1 to be used next that corresponds to pattern a is set as the current codebook.
[0045] (2) For the first pattern b in the pattern sequence bbaa, the current codebook T1 is used to obtain the codeword λ as the codeword corresponding to pattern b, and the codebook T3 to be used next that corresponds to pattern b is set as the current codebook.
[0046] (3) For the first pattern b in the pattern sequence baa, the current codebook T3 is used to obtain the codeword 100 as the codeword corresponding to pattern b, and the next codebook T0 to be used corresponding to pattern b is set as the current codebook.
[0047] (4) For the first pattern a in the pattern sequence aa, the current codebook T0 is used to obtain the codeword λ as the codeword corresponding to pattern a, and the next codebook T1 to be used corresponding to pattern a is set as the current codebook.
[0048] (5) For the first pattern a in the pattern sequence a, codeword 1 is obtained as the codeword corresponding to pattern a using the current codebook T1, and the next codebook to be used, T4, corresponding to pattern a, is set as the current codebook.
[0049] (6) The element of the mode assigned to the current codebook T4, 1, is obtained as the terminal codeword, and the codeword λλ100λ11, that is, the codeword 10011, is output.
[0050] It should be noted that in encoding, the modes assigned to the codebook are only used to obtain the terminal codewords.
[0051] Next, decoding will be explained. At the start of the decoding process, the codebook T0 used at the start of the encoding process is set as the current codebook. The input is the codeword 10011 to be decoded and the length of the pattern sequence to be output is 5.
[0052] (1) Using the current codebook T0, the current codeword 10011 is compared with the codewords contained in the codebook T0. There is codeword λ as a codeword contained in the current codebook T0 that matches the prefix of the current codeword 10011, and there is codeword 1 as a codeword contained in the mode assigned to the codebook T1 to be used next that matches the prefix of codeword 10011 obtained by deleting the prefix that matches codeword λ from the current codeword 10011. Therefore, pattern a corresponding to codeword λ is obtained, and the codebook T1 to be used next that corresponds to codeword λ is set as the current codebook, and codeword 10011 obtained by deleting the prefix that matches codeword λ from the current codeword 10011 is set as the current codeword. The currently obtained pattern sequence is a, and its length is 1, so processing continues.
[0053] (2) Using the current codebook T1, the current codeword 10011 is compared with the codewords contained in the codebook T1. There is codeword 1 as a codeword contained in the current codebook T1 that matches the prefix of the current codeword 10011, but there is no codeword contained in the mode assigned to the codebook T4 to be used next that corresponds to codeword 1 and matches the prefix of codeword 0011 obtained by deleting the prefix that matches codeword 1 from the current codeword 10011. Therefore, pattern a corresponding to codeword 1 is not obtained as the correct pattern. Next, codeword λ is found as a codeword included in the current codebook T1 that matches the prefix of current codeword 10011, and codeword 100 is found as a codeword included in the mode assigned to the codebook T3 to be used next that matches the prefix of codeword 10011 obtained by deleting the prefix that matches codeword λ from the current codeword 10011, so pattern b corresponding to codeword λ is obtained, the codebook T3 to be used next that corresponds to codeword λ is set as the current codebook, and codeword 10011 obtained by deleting the prefix that matches codeword λ from the current codeword 10011 is set as the current codeword. The currently obtained pattern sequence is ab, and its length is 2, so processing continues.
[0054] (3) Using the current codebook T3, the current codeword 10011 is compared with the codewords contained in the codebook T3. There is codeword 100 as a codeword contained in the current codebook T3 that matches the prefix of the current codeword 10011, and there is codeword λ as a codeword contained in the mode assigned to the codebook T0 to be used next that matches the prefix of codeword 11 obtained by deleting the prefix that matches codeword 100 from the current codeword 10011. Therefore, pattern b corresponding to codeword 100 is obtained, and the codebook T0 to be used next that corresponds to codeword 100 is set as the current codebook, and codeword 11 obtained by deleting the prefix that matches codeword 100 from the current codeword 10011 is set as the current codeword. The currently obtained pattern sequence is abb, and its length is 3, so processing continues.
[0055] (4) Using the current codebook T0, the current codeword 11 is compared with the codewords contained in the codebook T0. There is codeword λ as a codeword contained in the current codebook T0 that matches the prefix of the current codeword 11, and there is codeword 1 as a codeword contained in the mode assigned to the next codebook T1 to be used that corresponds to codeword λ and matches the prefix of codeword 11 obtained by deleting the prefix that matches codeword λ from the current codeword 11. Therefore, pattern a corresponding to codeword λ is obtained, the next codebook T1 to be used that corresponds to codeword λ is set as the current codebook, and codeword 11 obtained by deleting the prefix that matches codeword λ from the current codeword 11 is set as the current codeword. The currently obtained pattern sequence is abba, and its length is 4, so processing continues.
[0056] (5) Using the current codebook T1, the current codeword 11 is compared with the codewords contained in the codebook T1. Codeword 1 is found as a codeword contained in the current codebook T1 that matches the prefix of the current codeword 11, and codeword 1 is found as a codeword contained in the mode assigned to the codebook T4 to be used next that matches the prefix of codeword 1 obtained by deleting the prefix that matches codeword 1 from the current codeword 11. Therefore, pattern a corresponding to codeword 1 is obtained, the codebook T4 to be used next that corresponds to codeword 1 is set as the current codebook, and codeword 1 obtained by deleting the prefix that matches codeword 1 from the current codeword 11 is set as the current codeword. The currently obtained pattern sequence is abbaa, and its length is 5, so the process ends. It should be noted that although there is a codeword λ as a codeword contained in the current codebook T1 that matches the prefix of the current codeword 11, there is no codeword contained in the mode assigned to the next codebook T3 to be used that corresponds to codeword λ and matches the prefix of codeword 11 obtained by deleting the prefix that matches codeword λ from the current codeword 11.
[0057] <<4: Features of Encoding / Decoding>> Encoding / decoding in an embodiment of the present invention uses multiple codebooks. Each codebook included in the multiple codebooks is composed of a triplet of an input pattern, an output codeword, and the codebook to be used next. A mode is assigned to each codebook included in the multiple codebooks. In order for encoding / decoding to satisfy the unique decodability condition, any codebook included in the multiple codebooks satisfies the following two conditions (hereinafter referred to as the unique decodability condition for the codebook): (1) The set consisting of all expanded codewords in a codebook satisfies the prefix condition. (2) The expanded codeword of a codebook begins with one of the codewords included in the mode assigned to the codebook. As mentioned above, a code tree may be used instead of a codebook.
[0058] From the above, the encoding / decoding in the embodiment of the present invention has the following features.
[0059] (1) The next codebook, which is an element of a triplet constituting a codebook, represents a rule for selectively using multiple codebooks. By providing a rule for selectively using multiple codebooks in a codebook, it becomes possible to construct a uniquely decodable code even if the set of codewords included in the codebook does not satisfy the prefix condition, as long as the codebook satisfies the unique decodability condition for the codebook. Furthermore, by introducing mode assignment to the codebook, it becomes possible to easily ensure the unique decodability condition.
[0060] (2) If the set of codewords included in a single codebook does not satisfy the prefix condition, multiple codeword candidates may be available for decoding in the decoding process. For example, when considering decoding a codeword starting with 0 using codebook T0 in Figure 1, it is possible that either codeword λ or codeword 0 is correct for decoding. Because all codebooks in multiple codebooks satisfy the unique decodability condition, the mode assigned to a codebook functions as a query for determining which codeword was actually encoded and which next codebook is set as the current codebook during decoding. In other words, it is possible to determine which codeword from multiple codeword candidates is correct for decoding by comparing the codewords following these codeword candidates with the mode.
[0061] (3) It is also possible to assign a non-integer bit length, such as 1.5 bits per input, such as assigning the code word 000 to the pattern sequence aa. In this way, in order to assign the length of a code word per input with an accuracy of less than 1 bit, a mode including two or more code words must be assigned to at least one codebook among the multiple codebooks. The codebooks in the embodiments of the present invention can be of this type.
[0062] (4) From the decoding side, any codebook included in a plurality of codebooks can be said to have a data structure including the following data:
[0063] (1) A codeword that can be input; (2) A pattern that corresponds to the codeword and is to be output; (3) A codebook that corresponds to the codeword and is to be used for the next decoding; and (4) A mode that is a set of codewords assigned to the codebook in order to confirm whether the codebook is correct as the codebook to be used for the next decoding. <First embodiment> The encoding device 100 in this embodiment generates a pattern sequence x0x1...x of length L (where L is an integer equal to or greater than 2). L-1 (However, x i (i=0, 1,…, L-1) is a pattern) and the pattern sequence x0x1…x L-1Furthermore, decoding device 200 in this embodiment receives as input a codeword to be decoded (hereinafter referred to as an input codeword) and a pattern sequence of length L to be output, and outputs a pattern sequence of length L corresponding to the input codeword (hereinafter referred to as an output pattern sequence).
[0064] Here, a code word is a string made up of two codes {0, 1} lined up in a row. As explained in the Technical Background section, a code string of length 0 is represented as λ. A pattern is an element of a set consisting of a finite number of elements, and can be, for example, an alphabet or a word such as a, b, and c, which are elements of the alphabet set {a, b, c}. A pattern string is a string made up of patterns lined up in a row; for example, abbaa is a pattern string of length 5 for two patterns {a, b}. Examples of pattern strings include the following series, which are quantized to have finite precision.
[0065] (1) Time series signals obtained from various sensors such as audio signals, image signals, brightness sensors, acceleration sensors, and seismometers. (2) A series of spectral values obtained by performing discrete Fourier transform, discrete cosine transform, modified discrete cosine transform, etc. on the signal in (1). (3) A series of linear prediction coefficients, line spectral pairs (LSP), immittance spectral pairs (ISP), and partial autocorrelation coefficients (PARCOR coefficients) obtained by linear prediction analysis of the signal in (1). (4) A series of features obtained by inputting the signal in (1) into a neural network. In other words, a pattern sequence is a series of finite-precision digital signals or digital data.
[0066] The encoding device 100 and the decoding device 200 use a plurality of codebooks or code trees {T k} k=0 K-1 (where K is an integer greater than or equal to 2) is a data structure with the following characteristics:
[0067] (1) Codebook or code tree T k(k=0, 1, . . . , K-1) is composed of a triplet of a pattern, a codeword, and a codebook or code tree to be used next, and is assigned a mode, which is a set of codewords.
[0068] (2) Codebook or code tree T k The set of all expanded codewords (k=0, 1,…, K-1) satisfies the prefix condition, and the codebook or code tree T k The expanded codewords (k=0, 1, . . . , K-1) satisfy the condition that they start with any codeword included in the mode assigned to the codebook or code tree.
[0069] <<Encoding Device 100>> The encoding device 100 will be described below with reference to Figs. 3 and 4. Fig. 3 is a block diagram showing the configuration of the encoding device 100. Fig. 4 is a flowchart showing the operation of the encoding device 100. As shown in Fig. 3, the encoding device 100 includes an encoding unit 110 and a recording unit 190. The recording unit 190 is a component that appropriately records information necessary for the processing of the encoding device 100. The recording unit 190 stores, for example, a plurality of codebooks or code trees {T k} k=0 K-1 Keep a record of the following.
[0070] The operation of the encoding device 100 will be described with reference to FIG.
[0071] In S110, the encoding unit 110 generates a plurality of codebooks or code trees {T k} k=0 K-1 Using pattern x i The codeword w corresponding to i and obtain the codewords w0, w1, …, w L-1 The codeword w0w1...w obtained by concatenating L (However, w L is a termination codeword) as an output codeword. Encoding section 110 executes encoding processing consisting of the following three processes.
[0072] (1) Codebook or code tree T k(where k is an integer between 0 and K-1) is set as the current codebook or code tree. (2) For i=0, 1, ..., L-1, use the current codebook or code tree to find pattern x i The codeword w corresponding to i Obtain the pattern x i (3) After the process of (2) for i=L-1 is completed, select one element of the mode assigned to the current codebook or code tree, and set the element as the terminal codeword w L and obtain the codeword w0w1...w L as an output codeword, and terminate the encoding process. Here, the mode can be said to be a set assigned to obtain a terminal codeword in the encoding process.
[0073] <<Decoding Device 200>> The decoding device 200 will be described below with reference to Figs. 5 and 6. Fig. 5 is a block diagram showing the configuration of the decoding device 200. Fig. 6 is a flowchart showing the operation of the decoding device 200. As shown in Fig. 5, the decoding device 200 includes a decoding unit 210 and a recording unit 290. The recording unit 290 is a component that appropriately records information necessary for the processing of the decoding device 200. The recording unit 290 stores, for example, a plurality of codebooks or code trees {T k} k=0 K-1 (However, {T k} k=0 K-1 is a record of the codebooks or code trees used in the encoding process of the input codeword.
[0074] The operation of the decoding device 200 will be described with reference to FIG.
[0075] In S210, the decoding unit 210 generates a plurality of codebooks or code trees {T k} k=0 K-1 The decoding unit 210 obtains patterns corresponding to the code words that make up the input code word using the above, and outputs a pattern sequence of length L obtained by concatenating the obtained patterns as an output pattern sequence. The decoding unit 210 executes a decoding process consisting of the following three processes.
[0076] (1) Codebook or code tree Tk (where k is the number of the codebook or code tree used when the encoding process of the input codeword started) as the current codebook or code tree, and the input codeword as the current codeword. (2) Using the current codebook or code tree, compare the current codeword with the codewords contained in the codebook or code tree, and if there is a codeword (hereinafter referred to as codeword w) contained in the current codebook or code tree that matches the prefix of the current codeword, and if there is a codeword contained in the mode assigned to the codebook or code tree to be used next that matches the prefix of the codeword obtained by deleting the prefix that matches the codeword w from the current codeword, obtain a pattern corresponding to the codeword w, set the codebook or code tree to be used next that corresponds to the codeword w as the current codebook or code tree, and set the codeword obtained by deleting the prefix that matches the codeword w from the current codeword as the current codeword. (3) If the length of the pattern sequence obtained by concatenating the patterns obtained by the process in (2) is L, output the pattern sequence of length L as an output pattern sequence and end the decoding process, but otherwise return to the process in (2). Here, the mode can be said to be a set assigned in the decoding process to check whether it is correct to use the next codebook or code tree corresponding to a codeword included in the codebook or code tree as the current codebook or code tree to be used in decoding the next current codeword.
[0077] According to the embodiments of the present invention, by using multiple codebooks or code trees having a predetermined structure, it is possible to express any coding rule that satisfies the condition that it can be uniquely decoded. Therefore, it is possible to flexibly design codes by using multiple codebooks or code trees that are relatively small in size.
[0078] <Additional Note> The processing of each unit of each of the above-described devices may be realized by a computer, in which case the processing content of the functions to be possessed by each device is described by a program. Then, by loading this program into the recording unit 2020 of the computer 2000 shown in Fig. 7 and operating the arithmetic processing unit 2010, the input unit 2030, the output unit 2040, the auxiliary recording unit 2025, etc., the processing functions of each of the above-described devices are realized on the computer.
[0079] The device of the present invention may, for example, be a single hardware entity that includes an input unit capable of inputting signals from outside the hardware entity, an output unit capable of outputting signals to outside the hardware entity, a communication unit to which a communication device (e.g., a communication cable) can be connected for communication with outside the hardware entity, a CPU (Central Processing Unit) that serves as an arithmetic processing unit, which may also include cache memory and registers, RAM and ROM that serve as memory, an external storage device such as a hard disk, and buses that connect the input unit, output unit, communication unit, CPU, RAM, ROM, and external storage device so that data can be exchanged between them. If necessary, the hardware entity may also be provided with a device (drive) that can read and write recording media such as a CD-ROM. An example of a physical entity equipped with such hardware resources is a general-purpose computer.
[0080] The external storage device of the hardware entity stores the programs required to realize the above-mentioned functions and the data required for processing these programs (the programs may be stored in a ROM, which is a read-only storage device, for example, instead of an external storage device). Data obtained by processing these programs is stored in RAM, the external storage device, etc. as appropriate.
[0081] In the hardware entity, each program stored in an external storage device (or ROM, etc.) and the data required to process each program are loaded into memory as needed, and interpreted, executed, and processed by the CPU as appropriate. As a result, the CPU realizes predetermined functions (each component represented as a "... unit," "... means," etc.). In other words, each component of the embodiments of the present invention may be configured by a processing circuitry.
[0082] As described above, when the processing functions of the hardware entities (apparatuses of the present invention) described in the above embodiments are realized by a computer, the processing contents of the functions that the hardware entities should have are described by a program. Then, by executing this program on a computer, the processing functions of the hardware entities are realized on the computer.
[0083] The program describing the processing contents can be recorded on a computer-readable recording medium, such as a non-transitory recording medium, specifically a magnetic recording device, an optical disk, or the like.
[0084] The program may be distributed, for example, by selling, transferring, lending, etc. a portable recording medium such as a DVD or CD-ROM on which the program is recorded. Furthermore, the program may be stored in a storage device of a server computer, and then transferred from the server computer to another computer via a network, thereby distributing the program.
[0085] A computer that executes such a program, for example, first stores the program recorded on a portable recording medium or transferred from a server computer in its own non-transitory storage device, the auxiliary storage unit 2025. Then, when executing a process, the computer loads the program stored in its own non-transitory storage device, the auxiliary storage unit 2025, into the storage unit 2020 and executes processing in accordance with the loaded program. Alternatively, as another execution mode of this program, the computer may load the program directly from a portable recording medium into the storage unit 2020 and execute processing in accordance with the program. Furthermore, the computer may execute processing in accordance with the received program each time a program is transferred from the server computer to the computer. Alternatively, the server computer may not transfer the program to the computer, but may instead execute the processing function by issuing an execution instruction and obtaining the results, thereby executing the above-described processing through a so-called ASP (Application Service Provider) type service. Note that the program in this embodiment includes information used for processing by a computer that is equivalent to a program (such as data that is not a direct instruction to the computer but has properties that define computer processing).
[0086] Furthermore, in this embodiment, the device is configured by executing a predetermined program on a computer, but at least a part of the processing contents may be realized by hardware.
[0087] The present invention is not limited to the above-described embodiment, and various modifications can be made without departing from the spirit of the present invention.
Claims
1. A pattern sequence x0x1…x of length L (where L is an integer greater than or equal to 2). L-1 (However, x i (i=0, 1, …, L-1) is a pattern) and the pattern sequence x0x1…x L-1 A coding apparatus that outputs a codeword (hereinafter referred to as an output codeword) corresponding to a plurality of codebooks or code trees {T k } k=0 K-1 (where K is an integer greater than or equal to 2) to find pattern x i The codeword w corresponding to i We obtain the codewords w0, w1, …, w L-1 The codeword w0w1...w obtained by concatenating L (However, w L a codebook or code tree T k A coding device in which a mode (k=0, 1, …, K-1) is composed of a triplet of a pattern, a codeword, and the next codebook or code tree to be used, and is assigned a mode which is a set of codewords, and satisfies the following conditions: the set of all expanded codewords of the codebook or code tree satisfies a prefix condition, and the expanded codewords of the codebook or code tree begin with any of the codewords included in the mode assigned to the codebook or code tree.
2. The encoding device according to claim 1, wherein the encoding unit: (1) selects a codebook or a code tree T k (where k is an integer between 0 and K-1) as the current codebook or code tree, and (2) for i=0, 1, ..., L-1, use the current codebook or code tree to find pattern x i The codeword w corresponding to i Get pattern x i (3) After the process of (2) for i=L-1 is completed, select one element of the mode assigned to the current codebook or code tree and assign the selected element to the terminal codeword w L Then, we obtain the codeword w0w1...w L as the output codeword and terminate the encoding process.
3. A decoding device that receives a codeword to be decoded (hereinafter referred to as an input codeword) and a pattern sequence of length L to be output, and outputs a pattern sequence of length L corresponding to the input codeword (hereinafter referred to as an output pattern sequence), comprising: k } k=0 K-1 (K is an integer greater than or equal to 2, {T k } k=0 K-1 a decoding unit that obtains a pattern corresponding to a codeword constituting the input codeword using a plurality of codebooks or code trees used in the encoding process of the input codeword, and outputs a pattern sequence of length L obtained by concatenating the obtained patterns as the output pattern sequence, k A decoding device in which a mode (k=0, 1, ..., K-1) is composed of a triplet of a pattern, a codeword, and a codebook or code tree to be used next, and is assigned a mode which is a set of codewords, and satisfies the following conditions: a set of all expanded codewords of the codebook or code tree satisfies a prefix condition, and an expanded codeword of the codebook or code tree begins with any of the codewords included in the mode assigned to the codebook or code tree.
4. A decoding device according to claim 3, wherein the decoding unit: (1) selects a codebook or a code tree T k (where k is the number of the codebook or code tree used when the encoding process of the input codeword was started) as the current codebook or code tree, and the input codeword as the current codeword; (2) using the current codebook or code tree, comparing the current codeword with the codewords contained in the codebook or code tree, and if there is a codeword (hereinafter referred to as codeword w) contained in the current codebook or code tree that matches the prefix of the current codeword, and there is a codeword contained in the mode assigned to the codebook or code tree to be used next that corresponds to the codeword w and matches the prefix of the codeword obtained by deleting the prefix that matches the codeword w from the current codeword, obtaining a pattern corresponding to the codeword w, setting the codebook or code tree to be used next that corresponds to the codeword w as the current codebook or code tree, and setting the codeword obtained by deleting the prefix that matches the codeword w from the current codeword as the current codeword; (3) if the length of the pattern sequence obtained by concatenating the patterns obtained by the process of (2) is L, outputting the pattern sequence of length L as the output pattern sequence and terminating the decoding process, and otherwise returning to the process of (2).
5. The encoder generates a sequence of patterns x0x1...x of length L (where L is an integer greater than or equal to 2). L-1 (However, x i (i=0, 1, …, L-1) is a pattern) and the pattern sequence x0x1…x L-1 A coding method for outputting a codeword (hereinafter referred to as an output codeword) corresponding to a plurality of codebooks or code trees {T k } k=0 K-1 (where K is an integer greater than or equal to 2) to find pattern x i The codeword w corresponding to i We obtain the codewords w0, w1, …, w L-1 The codeword w0w1...w obtained by concatenating L (However, w L a terminal codeword) as the output codeword; k A coding method in which (k=0, 1, …, K-1) is composed of a triplet of a pattern, a codeword, and the next codebook or code tree to be used, and a mode which is a set of codewords is assigned to it, and satisfies the following conditions: the set of all expanded codewords of the codebook or code tree satisfies a prefix condition, and the expanded codewords of the codebook or code tree start with any of the codewords included in the mode assigned to the codebook or code tree.
6. A decoding method in which a decoding device receives a codeword to be decoded (hereinafter referred to as an input codeword) and a pattern sequence of length L to be output, and outputs a pattern sequence of length L corresponding to the input codeword (hereinafter referred to as an output pattern sequence), k } k=0 K-1 (K is an integer greater than or equal to 2, {T k } k=0 K-1 a decoding step of obtaining patterns corresponding to code words constituting the input code word using a plurality of codebooks or code trees used in the encoding process of the input code word, concatenating the obtained patterns to obtain a pattern sequence of length L, and outputting the pattern sequence as the output pattern sequence; k A decoding method in which (k=0, 1, …, K-1) is composed of a triplet of a pattern, a codeword, and the next codebook or code tree to be used, and a mode which is a set of codewords is assigned to it, and satisfies the following conditions: the set of all expanded codewords of the codebook or code tree satisfies a prefix condition, and the expanded codewords of the codebook or code tree start with any of the codewords included in the mode assigned to the codebook or code tree.
7. Multiple codebooks or code trees {T k } k=0 K-1 (where K is an integer equal to or greater than 2), k A data structure in which (k=0, 1, …, K-1) is composed of a triplet of a pattern, a codeword, and a next codebook or code tree to be used, and a mode which is a set of codewords is assigned to it, wherein a set consisting of all expanded codewords of the codebook or code tree satisfies a prefix condition, and an expanded codeword of the codebook or code tree has any codeword included in the mode assigned to the codebook or code tree as a prefix, and the mode is a set assigned to confirm whether it is correct to use the next codebook or code tree corresponding to a codeword included in the codebook or code tree as the current codebook or code tree to be used for decoding the next current codeword.
8. A program for causing a computer to function as either the encoding device according to claim 1 or 2, or the decoding device according to claim 3 or 4.
Citation Information
Patent Citations
Encoding device, decoding device, data structure of code string, encoding method, decoding method, encoding program, decoding program
JP2020077969A
Cited By
Encoding device, decoding device, and program
WO2026094097A1
