Encoding device, decoding device, encoding method, decoding method, data structure, and program
Patent Information
- Application Number
- PCT/JP2024/002278
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-01-25
- Publication Date
- 2025-07-31
Smart Images

Figure JP2024002278_31072025_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 at least two pairs of a pattern and a set of code words (hereinafter referred to as output set) whose prefix is the code word corresponding to the pattern. The predetermined prefix and predetermined suffix of the code word, which is an element of the output set, are respectively the prefix common to all elements of the output set, and the code word minus the predetermined prefix of the code word. A codebook or code tree T k The union of the output sets of satisfies the prefix condition, and the codebook or coding tree T k The codeword included in the output set of the codebook or code tree to be used next corresponding to the pattern (k=0, 1, ..., K-1) satisfies the condition that it has at its beginning a predetermined ending of any of the codewords included in the output set corresponding to that pattern.
[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-1a 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 at least two pairs of a pattern and a set of code words (hereinafter referred to as output set) whose prefix is the code word corresponding to the pattern. The predetermined prefix and predetermined suffix of the code word, which is an element of the output set, are respectively the prefix common to all elements of the output set, and the code word minus the predetermined prefix of the code word. A codebook or code tree T k The union of the output sets of satisfies the prefix condition, and the codebook or coding tree T k The codeword included in the output set of the codebook or code tree to be used next corresponding to the pattern (k=0, 1, ..., K-1) satisfies the condition that it has at its beginning a predetermined ending of any of the codewords included in the output set corresponding to that pattern.
[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] FIG. 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 a 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 a configuration of a decoding device 200. FIG. 6 is a flowchart showing the operation of the decoding device 200. FIG. 7 is a diagram showing an example of a codebook. FIG. 8 is a diagram showing an example of a codebook. FIG. 9 is a diagram showing an example of a codebook. FIG. 10 is a diagram showing an example of a correspondence table. FIG. 11 is a diagram showing an example of a codebook. FIG. 12 is a diagram showing an example of a correspondence table. FIG. 13 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, a concept necessary for explaining the codebook in the first embodiment, will be described. 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 become the prefix of 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 in the first embodiment is composed 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, the conditions required for a codebook so that encoding / decoding in the first embodiment satisfies the unique decodability condition will be described. To this end, the concept of an expanded codeword will be defined. 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 corresponding to the codeword and assigned to the next codebook to be used. Here, the codeword included in the 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 that are elements of mode {1, 011} assigned to the next codebook T1 that corresponds to pattern a, and codewords 00 and 010 obtained by concatenating codeword 0 corresponding to pattern b with codeword 0 and 10 that are elements of mode {0, 10} assigned to the next codebook T2 that corresponds to pattern b.
[0020] The following two conditions are required for a codebook in order for encoding / decoding to satisfy the unique decodability condition: (1) For any codebook included in multiple codebooks, a set consisting of all expanded codewords of the codebook satisfies the prefix condition, and (2) For any codebook included in multiple codebooks, the expanded codeword of the codebook begins with any codeword included in the mode assigned to the codebook.
[0021] 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.
[0022] 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:
[0023] 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.
[0024] A code tree is composed of a triplet of an input pattern, an output code word, and the code tree to be used next.
[0025] 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.
[0026] The following two conditions are required for a code tree in order for encoding / decoding to satisfy the unique decodability condition: (1) For any code tree included in multiple code trees, a set consisting of all expanded codewords of the code tree satisfies the prefix condition, and (2) For any code tree included in multiple code trees, the expanded codeword of the code tree begins with any codeword included in the mode assigned to the code tree.
[0027] <<2: Encoding Procedure / Decoding Procedure>> First, the encoding procedure in the first embodiment will be described. The encoding procedure in the first embodiment is to encode 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) 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-1The 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.
[0028] More specifically, the encoding procedure in the first embodiment comprises the following three steps: (1) A predetermined codebook T k is used as the current codebook to start encoding. Here, k is an arbitrary integer between 0 and K-1, for example, k=0. (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 (3) After the process of (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.
[0029] 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.
[0030] Next, a decoding procedure in the first embodiment will be described. The decoding procedure in the first embodiment 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=0K-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-1 In 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.
[0031] More specifically, the decoding procedure in the first embodiment comprises the following three steps: (1) Decoding a predetermined codebook T kDecoding is started with k as the current codebook. Here, k is the codebook number used when the encoding process of the input codeword started. The input codeword is also set as the current codeword. (2) Using the current codebook, the current codeword is compared with the codewords contained in the 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 matching codeword w from the current codeword, a pattern corresponding to the codeword w is obtained, the codebook to be used next that corresponds to the codeword w is set as the current codebook, and the codeword obtained by deleting the prefix matching codeword w from the current codeword is set as the current codeword. (3) If the length of the pattern sequence obtained by concatenating the patterns obtained in process (2) is L, the pattern sequence of length L is output and the decoding process is terminated; otherwise, the process returns to process (2).
[0032] 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."
[0033] <<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.
[0034] (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.
[0035] (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.
[0036] (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.
[0037] (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 codebook T1 to be used next that corresponds to pattern a is set as the current codebook.
[0038] (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.
[0039] (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.
[0040] It should be noted that in encoding, the modes assigned to the codebook are only used to obtain the terminal codewords.
[0041] 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.
[0042] (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.
[0043] (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.
[0044] (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.
[0045] (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.
[0046] (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.
[0047] <<4: Features of Encoding / Decoding>> Encoding / decoding in the first embodiment uses multiple codebooks. Each codebook included in the multiple codebooks is composed of a triplet of an input pattern, an output codeword, and the next codebook to be used. 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 codewords of a codebook begin with any codeword included in the mode assigned to the codebook.
[0048] As mentioned above, a code tree may be used instead of a codebook.
[0049] From the above, the encoding / decoding in the first embodiment has the following features.
[0050] (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.
[0051] (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.
[0052] (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 a code word length 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 first embodiment can be of this type.
[0053] (4) From the decoding side, any codebook included in multiple codebooks can be said to have a data structure including the following data: (4-1) A codeword that can be input (4-2) A pattern that is an output corresponding to the codeword (4-3) A codebook to be used for the next decoding corresponding to the codeword (4-4) A mode that is a set of codewords assigned to the codebook in order to confirm whether the codebook in question 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-1 Furthermore, 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).
[0054] 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.
[0055] (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.
[0056] 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:
[0057] (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.
[0058] (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.
[0059] <<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=0K-1 Keep a record of the following.
[0060] The operation of the encoding device 100 will be described with reference to FIG.
[0061] 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.
[0062] (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.
[0063] <<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.
[0064] The operation of the decoding device 200 will be described with reference to FIG.
[0065] 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.
[0066] (1) Codebook or code tree T k(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.
[0067] 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.
[0068] In the first embodiment, the concept of a mode was introduced, and encoding / decoding using a plurality of codebooks, each of which is assigned a mode, was described. However, it is possible to configure a codebook equivalent to the codebook in the first embodiment without specifying the modes assigned to the codebooks. Furthermore, it is possible to configure a codebook equivalent to the codebook in the first embodiment not only without specifying the modes assigned to the codebooks, but also without including the codebook to be used next as a component of the codebook. By using a codebook configured in this manner, it is possible in some cases to reduce the memory required for processing and improve the processing speed compared to when the codebook in the first embodiment is used.
[0069] The technical background of encoding / decoding in the second embodiment will be described below.
[0070] <Technical Background> <<1: Codebook>> First, several concepts necessary for explaining the codebook in the second embodiment will be defined.
[0071] A codeword w and a set of codewords S={w0, w1, …, w N-1} (where N is an integer greater than or equal to 1), the set of codewords w+S is the set of codewords obtained by concatenating codeword w with the codewords that are elements of the set of codewords S. Therefore, w+S={ww0, ww1, …, ww N-1}.
[0072] Let P and Q be integers greater than or equal to 0 such that P≦Q, and let w=b0b1…b P-1 (However, b i Extending a P-bit codeword (i=0, 1, …, P-1) to a Q-bit codeword means concatenating any QP-bit codeword to the codeword w. Also, the set of codewords T obtained by extending a P-bit codeword w to a Q-bit codeword is defined as the set of all codewords obtained by extending a P-bit codeword w to Q bits. Therefore, T={b0b1…b P-1 b P b P+1 …b Q-1 | b i(i=P, P+1, …, Q-1) represents either 0 or 1}={b0b1…b P-1 0…00, b0b1…b P-1 0…01, b0b1…b P-1 0…10, b0b1…b P-1 0…11, …, b0b1…b P-1 1…11}. In other words, the set T is 2 Q-P Furthermore, P n (n=0, …, N-1, N is an integer equal to or greater than 1), Q is P n ≦Q, and the set of codewords {w0, …, w N-1} (where w n (n=0, …, N-1) is P n Let T' be the set of codewords obtained by extending the Q-bit codewords (the 1-bit codewords) into Q-bit codewords. n Bit codeword w n The set of codewords T that is extended to Q bits n (n=0, …, N-1). For example, the set of codewords obtained by extending the codeword set {λ} to a 3-bit codeword is {000, 001, 010, 011, 100, 101, 110, 111}. Similarly, the set of codewords obtained by extending the codeword set {0, 10, 110} to a 3-bit codeword is {000, 001, 010, 011, 100, 101, 110}, the union of {000, 001, 010, 011, 100, 101, 110}, {100, 101}, and {110}.
[0073] The codebook in the second embodiment is composed of a triplet of an input pattern, a set of codewords beginning with the output codeword (hereinafter referred to as an output set), and the codebook to be used next. Unlike the codebook in the first embodiment, no mode is assigned to the codebook.
[0074] The codebooks in the second embodiment will be described below using examples. Figures 7 and 8 are diagrams showing examples of codebooks. Figure 7 shows a codebook in the first embodiment, and modes are assigned to the codebook. On the other hand, Figure 8 shows a codebook in the second embodiment, and this codebook is equivalent to the codebook in Figure 7, i.e., it shows the same encoding rules. The codebooks in Figures 7 and 8 are used to encode a pattern sequence, which is a sequence of patterns {a, b, c}, into a codeword, which is a sequence of codes {0, 1}, and consist of five codebooks: T0, T1, T2, T3, and T4.
[0075] In the second embodiment, an output set, which is a component of a codebook, is generated using the codewords, which are the component of the codebook in the first embodiment, and the modes assigned to the next codebook to be used. An example will be described using codebook T0. In FIG. 7, the codeword corresponding to pattern a is λ, and the mode assigned to the next codebook T1 to be used, which corresponds to pattern a, is {011, 10}. Here, the length of the longest codeword among the modes assigned to codebooks T0, T1, T2, T3, and T4, is 3. Furthermore, the set of codewords obtained by extending the codeword set {011, 10} to a 3-bit codeword is {011, 100, 101}. Therefore, the output set corresponding to pattern a is set to λ + {011, 100, 101} = {011, 100, 101} (see FIG. 8). Similarly, in FIG. 7 , the codeword corresponding to pattern b is 0, the mode assigned to the next codebook T2 to be used that corresponds to pattern b is {0, 10}, and the set of codewords obtained by extending the codeword set {0, 10} to 3-bit codewords is {000, 001, 010, 011, 100, 101}. Therefore, the output set corresponding to pattern b is 0 + {000, 001, 010, 011, 100, 101} = {0000, 0001, 0010, 0011, 0100, 0101} (see FIG. 8 ). In addition, in FIG. 7 , the codeword corresponding to pattern c is 11, the mode assigned to the codebook T0 to be used next that corresponds to pattern c is {λ}, and the set of codewords obtained by extending the codeword set {λ} to 3-bit codewords is {000, 001, 010, 011, 100, 101, 110, 111}. Therefore, the output set corresponding to pattern c is 11 + {000, 001, 010, 011, 100, 101, 110, 111} = {11000, 11001, 11010, 11011, 11100, 11101, 11110, 11111} (see FIG. 8 ).
[0076] The codewords that are elements of the output set are treated differently depending on their prefix and suffix during encoding / decoding. In the following, to distinguish them from the general terms prefix and suffix, the prefix and suffix of the codewords that are elements of the output set are referred to as the predetermined prefix and predetermined suffix, respectively, and are defined as follows:
[0077] For a code word that is an element of the output set, the predetermined prefix and predetermined suffix are respectively the longest prefix common to all elements of the output set and the code word minus the predetermined prefix of the code word.
[0078] The predetermined prefix of the codeword that is an element of the output set does not have to be the longest prefix common to all elements of the output set, but can be any length among prefixes common to all elements of the output set. In this case, the predetermined prefix and predetermined suffix of the codeword that is an element of the output set are defined as follows:
[0079] For a code word that is an element of the output set, the predetermined prefix and predetermined suffix are respectively a prefix common to all elements of the output set and the code word minus the predetermined prefix of the code word.
[0080] As can be seen from the above definition, the predetermined prefixes of the code words that are elements of a given output set are the same, so one predetermined prefix is determined for each output set. On the other hand, the predetermined endings of the code words that are elements of a given output set are not necessarily the same, so one or more predetermined endings are determined for each output set. Therefore, the predetermined prefixes of the code words that are elements of the output set are referred to as the predetermined prefix of the output set, and the set of predetermined endings of the code words that are elements of the output set is referred to as the set of predetermined endings for the output set.
[0081] In the following examples in the Technical Background, a given prefix of a codeword that is an element of an output set is described as the longest prefix common to all elements of the output set.
[0082] Let us take codebook T0 as an example. In Figure 8, the longest prefix common to all elements of output set {011, 100, 101} corresponding to pattern a is λ. Therefore, the predetermined prefix of output set {011, 100, 101} corresponding to pattern a is λ, and the predetermined set of suffixes is {011, 100, 101}. Similarly, in Figure 8, the longest prefix common to all elements of output set {0000, 0001, 0010, 0011, 0100, 0101} corresponding to pattern b is 0, so the predetermined prefix of output set {0000, 0001, 0010, 0011, 0100, 0101} corresponding to pattern b is 0, and the predetermined set of suffixes is {000, 001, 010, 011, 100, 101}. In addition, in FIG. 8, the longest prefix common to all elements in the output set {11000, 11001, 11010, 11011, 11100, 11101, 11110, 11111, 11111} corresponding to pattern c is 11, so the predetermined prefix of the output set {11000, 11001, 11010, 11011, 11100, 11101, 11110, 11111} corresponding to pattern c is 11, and the predetermined suffix set is {000, 001, 010, 011, 100, 101, 110, 111}.
[0083] As can be seen from the above explanation, in the example of Fig. 8, the last three bits of the codeword that is an element of the output set become the predetermined suffix of the codeword. Therefore, the predetermined suffix set of the output set corresponding to a certain pattern corresponds to the mode of the codebook to be used next that corresponds to the pattern in the first embodiment. In other words, it can be seen that by using the output set, it is not necessary to specify the mode.
[0084] The method for determining the predetermined prefixes and suffixes for the code words that are elements of the output set is shared between the encoding side and the decoding side.
[0085] Furthermore, the following two conditions are required for a codebook in order for encoding / decoding to satisfy the unique decodability condition: (1) For any codebook included in multiple codebooks, the union of the output sets of the codebooks satisfies the prefix condition, and (2) For any codebook included in multiple codebooks, the codeword included in the output set of the next codebook to be used, which corresponds to a pattern of the codebook, has as its prefix the predetermined suffix of any of the codewords included in the output set corresponding to the pattern.
[0086] Here, the output set of a codebook refers to all output sets included in the codebook. For example, the output set of codebook T0 refers to {011, 100, 101}, {0000, 0001, 0010, 0011, 0100, 0101}, and {11000, 11001, 11010, 11011, 11100, 11101, 11110, 11111}. Furthermore, the codebook to be used after a codebook refers to all codebooks to be used next included in the codebook. For example, the codebook to be used after codebook T0 refers to T1, T2, and T0.
[0087] (Modification 1) The codebook in the second embodiment can be expressed more simply, as will be explained below.
[0088] The codebook in the first modification of the second embodiment is also composed of a triplet of an input pattern, a set of codewords beginning with the output codeword (hereinafter referred to as an output set), and the codebook to be used next. However, the codebook in the first modification of the second embodiment differs from the codebook in the second embodiment in the way the output set is expressed.
[0089] The codebooks in Modification 1 of the second embodiment will be described below using examples. Fig. 9 is a diagram showing an example of a codebook. Fig. 9 shows a codebook in Modification 1 of the second embodiment, and this codebook is equivalent to the codebooks in Figs. 7 and 8, i.e., it shows the same encoding rules. The codebook in Fig. 9 is used to encode a pattern sequence that is a sequence of patterns {a, b, c} into a codeword that is a sequence of codes {0, 1}, and consists of five codebooks: T0, T1, T2, T3, and T4.
[0090] The output set, which is a component of the codebook in Variation 1 of the second embodiment, is generated using the codewords, which are component of the codebook in the first embodiment, and the modes assigned to the codebook to be used next. An example will be described using codebook T0. In FIG. 7, the codeword corresponding to pattern a is λ, and the mode assigned to the codebook T1 to be used next and corresponding to pattern a is {011, 10}. Therefore, the output set corresponding to pattern a is set to λ+{011, 10}={011, 10} (see FIG. 9). Similarly, in FIG. 7, the codeword corresponding to pattern b is 0, and the mode assigned to the codebook T2 to be used next and corresponding to pattern b is {0, 10}, so the output set corresponding to pattern b is set to 0+{0, 10}={00, 010} (see FIG. 9). In addition, in FIG. 7, the codeword corresponding to pattern c is 11, and the mode assigned to the codebook T0 to be used next that corresponds to pattern c is {λ}, so the output set corresponding to pattern c is set to 11+{λ}={11} (see FIG. 9).
[0091] The definitions of the predetermined prefixes and suffixes for the code words that are elements of the output set are the same as above.
[0092] An example will be given using codebook T0. In FIG. 9, the longest prefix common to all elements of output set {011, 10} corresponding to pattern a is λ. Therefore, the predetermined prefix of output set {011, 10} corresponding to pattern a is λ, and the predetermined set of suffixes is {011, 10}. Similarly, in FIG. 9, the longest prefix common to all elements of output set {00, 010} corresponding to pattern b is 0, so the predetermined prefix of output set {00, 010} corresponding to pattern b is 0, and the predetermined set of suffixes is {0, 10}. Also, in FIG. 9, the longest prefix common to all elements of output set {11} corresponding to pattern c is 11, so the predetermined prefix of output set {11} corresponding to pattern c is 11, and the predetermined set of suffixes is {λ}.
[0093] As can be seen from the above explanation, the predetermined suffix set of the output set corresponding to a certain pattern coincides with the mode of the codebook to be used next corresponding to that pattern in the first embodiment. In other words, by using the output set, it is not necessary to specify the mode.
[0094] The conditions required for the codebook to satisfy the unique decodability condition for encoding / decoding are the same as those mentioned above.
[0095] (Variation 2) In the second embodiment and its variation 1, the codebooks have been described as being configured as triplets, but the predetermined suffix set of the output set corresponding to a certain pattern corresponds to or coincides with the mode of the next codebook to be used that corresponds to that pattern in the first embodiment. Therefore, when the modes assigned to codebooks differ among multiple codebooks, the codebooks can be configured as pairs by expressing them using a correspondence table consisting of pairs of the predetermined suffix set of the output set and the next codebook to be used. Note that a function can also be used instead of the correspondence table.
[0096] The codebook in the second modification of the second embodiment is composed of two pairs: an input pattern and a set of codewords beginning with the output codeword (hereinafter referred to as an output set). The codebook in the second modification of the second embodiment is used together with a correspondence table (hereinafter referred to as a transition correspondence table) consisting of a set of predetermined suffixes in the output set and the codebook to be used next, or a function (hereinafter referred to as a transition function) that receives the predetermined suffixes in the output set as input and outputs the codebook to be used next.
[0097] The codebook in Modification 2 of the second embodiment will be described below using an example. Fig. 10 and Fig. 11 are diagrams showing an example of a codebook and an example of a correspondence table, respectively. Fig. 10 shows a codebook in Modification 2 of the second embodiment, which is a codebook configured from pairs of patterns and output sets, which are components of the codebook in Fig. 8. Fig. 11 shows a correspondence table used together with the codebook in Fig. 10.
[0098] Fig. 12 and Fig. 13 are diagrams showing an example of a codebook and an example of a correspondence table, respectively. Fig. 12 shows a codebook in Modification 2 of the second embodiment, which is a codebook configured from pairs of patterns and output sets, which are components of the codebook in Fig. 9. Fig. 13 shows a correspondence table used together with the codebook in Fig. 12.
[0099] The coding rules can also be expressed using a code tree. Therefore, the above explanation of the codebook also applies to the code tree, simply by replacing the word "codebook" with "code tree."
[0100] <<2: Encoding Procedure / Decoding Procedure>> First, the encoding procedure in the second embodiment will be described. The encoding procedure in the second embodiment is to encode 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) 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 is a predetermined prefix of the output set 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.
[0101] More specifically, the encoding procedure in the second embodiment comprises the following three steps: (1) A predetermined codebook T kis used as the current codebook to start encoding. Here, k is an arbitrary integer between 0 and K-1, for example, k=0. (2) For i=0, 1, ..., L-1, use the current codebook to find the pattern x i The codeword w is a predetermined prefix of the output set corresponding to i Obtain the pattern x i (3) After the process of (2) for i=L-1 is completed, the next codebook to be used corresponding to the pattern x L-1 Select one codeword included in the output set corresponding to L and obtain the codeword w0w1...w L is output, and the encoding process ends.
[0102] In addition, the terminal codeword w L is pattern x L-1 , for example, the pattern x L-1 It is preferable to use the predetermined ending with the shortest length among the predetermined endings of the code words included in the output set corresponding to the
[0103] In the encoding procedure in the second modification of the second embodiment, the process of (2) is different from the encoding procedure in the second embodiment. Specifically, it is as follows: (2) For i=0, 1, ..., L-1, a pattern x i The codeword w is a predetermined prefix of the output set corresponding to i Obtain the pattern x using the transition table or transition function. i The next codebook to be used corresponding to the predetermined suffix set of the output set corresponding to is obtained, and the codebook is set as the current codebook.
[0104] Next, a decoding procedure in the second embodiment will be described. The decoding procedure in the second embodiment 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-1is 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-1 In 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 output set of the current codebook that matches the prefix of the current codeword, a pattern corresponding to the output set including that codeword w is obtained, the codebook to be used next that corresponds to the output set including that codeword w is set as the current codebook, and the codeword obtained by deleting a predetermined prefix of the output set including that 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 is the codeword currently being decoded, and the current codeword at the start of decoding is the input codeword.
[0105] More specifically, the decoding procedure in the second embodiment comprises the following three steps: (1) Decoding a predetermined codebook T kis used 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 the current codeword. (2) Using the current codebook, the current codeword is compared with the codewords contained in the output set of that codebook. If there is a codeword (hereinafter referred to as codeword w) contained in the output set of the current codebook that matches the prefix of the current codeword, a pattern corresponding to the output set including that codeword w is obtained, and the codebook to be used next that corresponds to the output set including that codeword w is set as the current codebook, and the codeword obtained by deleting the specified prefix of the output set including that codeword w from the current codeword is set as the current codeword. If the length of the current codeword is shorter than the length of the codeword included in the output set of the current codebook and there is no codeword included in the output set of the current codebook that matches the prefix of the current codeword, and there is a codeword included in the output set of the current codebook that matches the prefix of a codeword obtained by concatenating an arbitrary codeword to the current codeword (hereinafter referred to as codeword w), a pattern corresponding to the output set including codeword w is obtained, the codebook to be used next corresponding to the output set including codeword w is set as the current codebook, and the codeword obtained by deleting the predetermined prefix of the output set including codeword w from the current codeword is set 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, the pattern sequence of length L is output and the decoding process is terminated, but otherwise the process returns to the process of (2).
[0106] Note that the decoding procedure in Modification 2 of the second embodiment differs from the decoding procedure in the second embodiment in the process of (2). Specifically, it is as follows: (2) Using a current codebook, a current codeword is compared with a codeword included in the output set of the current codebook. If there is a codeword (hereinafter referred to as codeword w) included in the output set of the current codebook that matches the prefix of the current codeword, a pattern corresponding to the output set including the codeword w is obtained, and a transition correspondence table or a transition function is used to obtain a codebook to be used next that corresponds to a predetermined suffix set of the output set including the codeword w. This codebook is set as the current codebook, and the codeword obtained by deleting the predetermined prefix of the output set including the codeword w from the current codeword is set as the current codeword. Note that, when there is no codeword in the output set of the current codebook that matches the prefix of the current codeword because the length of the current codeword is shorter than the length of the codeword included in the output set of the current codebook, and there is a codeword (hereinafter referred to as codeword w) included in the output set of the current codebook that matches the prefix of a codeword obtained by concatenating an arbitrary codeword to the current codeword, a pattern corresponding to the output set including the codeword w is obtained, and a codebook to be used next that corresponds to a predetermined suffix set of the output set including the codeword w is obtained using a transition correspondence table or a transition function, and the codebook is set as the current codebook, and the codeword obtained by deleting the predetermined prefix of the output set including the codeword w from the current codeword is set as the current codeword.
[0107] In addition, instead of executing the step (2) in the decryption procedure in the second embodiment or its variant 2, the following step (1) may be executed instead of the step (1) above.
[0108] (1) A predetermined codebook T k is used 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 current codeword is the codeword obtained by concatenating an arbitrary codeword of sufficient length to the input codeword so that the length of the current codeword does not become shorter than the length of the codeword included in the output set of the current codebook during the repeated execution of process (2).
[0109] 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."
[0110] <<3: Example of Encoding / Decoding>> Here, as an example of encoding / decoding, encoding / decoding of the pattern sequence acba when using the codebook of Fig. 8 or Fig. 9 will be described. First, the case when the codebook of Fig. 8 is used will be described.
[0111] <<<3-1: Encoding / Decoding Using the Codebook of Fig. 8 >>> First, encoding will be explained. Here, it is assumed that codebook T0 is used as the current codebook at the start of the encoding process. The input is the pattern sequence acba to be encoded.
[0112] (1) For the first pattern a in the pattern sequence acba, the current codebook T0 is used to obtain the codeword λ, which is a predetermined prefix of the output set {011, 100, 101} corresponding to pattern a, and the next codebook T1 to be used corresponding to pattern a is set as the current codebook.
[0113] (2) For the first pattern c in the pattern sequence cba, the current codebook T1 is used to obtain the codeword 101, which is the predetermined prefix of the output set {101010, 101011, 101100, 101101, 101110, 101111} corresponding to pattern c, and the codebook T4 to be used next, which corresponds to pattern c, is set as the current codebook.
[0114] (3) For the first pattern b in the pattern sequence ba, the current codebook T4 is used to obtain the codeword 01, which is the predetermined prefix of the output set {01000, 01001, 01010, 01011, 01100, 01101, 01110, 01111} corresponding to pattern b, and the codebook T0 to be used next, which corresponds to pattern b, is set as the current codebook.
[0115] (4) For the first pattern a in the pattern sequence a, use the current codebook T0 to obtain the codeword λ, which is a predetermined prefix of the output set {011, 100, 101} corresponding to pattern a, and set the next codebook T1 corresponding to pattern a as the current codebook.
[0116] (5) Since the first pattern a in the pattern sequence a is the last pattern to be processed, the predetermined suffix 100 of the code word 100 in the output set {011, 100, 101} corresponding to pattern a is obtained as the terminal code word, and the code word λ10101λ100, i.e., the code word 10101100, is output.
[0117] Next, we will explain decoding. 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 10101100 to be decoded and the length of the pattern sequence to be output is 4.
[0118] (1) Using the current codebook T0, the current codeword 10101100 is compared with the codewords included in the output set of the codebook T0. Since codeword 101 is included in the output set of the current codebook T0 and matches the prefix of the current codeword 10101100, pattern a corresponding to the output set {011, 100, 101} containing codeword 101 is obtained, and the codebook T1 to be used next, corresponding to the output set {011, 100, 101} containing codeword 101, is set as the current codebook. Codeword 10101100 obtained by deleting the predetermined prefix λ of the output set {011, 100, 101} containing codeword 101 from the current codeword 10101100 is set as the current codeword. The currently obtained pattern sequence is a, and its length is 1, so processing continues.
[0119] (2) Using the current codebook T1, compare the current codeword 10101100 with the codewords contained in the output set of the codebook T1. Since the codeword 101011 is included in the output set of the current codebook T1 and matches the prefix of the current codeword 10101100, a pattern c corresponding to the output set {101010, 101011, 101100, 101101, 101110, 101111} containing the codeword 101011 is obtained, and the codebook T4 to be used next, which corresponds to the output set {101010, 101011, 101100, 101101, 101110, 101111} containing the codeword 101011, is set as the current codebook. Then, the codebook T4 to be used next, which corresponds to the output set {101010, 101011, 101100, 101101, 101110, 101111} containing the codeword 101011, is set as the current codebook. The code word 01100 obtained by deleting the predetermined prefix 101 from {101111} is set as the current code word. The currently obtained pattern string is ac, and its length is 2, so processing continues.
[0120] (3) Using the current codebook T4, the current codeword 01100 is compared with the codewords contained in the output set of the codebook T4. Since the codeword 01100 is included in the output set of the current codebook T4 and matches the prefix of the current codeword 01100, pattern b corresponding to the output set {01000, 01001, 01010, 01011, 01100, 01101, 01110, 01111} containing the codeword 01100 is obtained, and the codebook T0 to be used next, corresponding to the output set {01000, 01001, 01010, 01011, 01100, 01101, 01110, 01111} containing the codeword 01100, is set as the current codebook. Then, the output set {01000, 01001, 01010, 01011, 01100, 01101, 01110, 01111} containing the codeword 01100 is set as the current codebook. The code word 100 obtained by deleting the predetermined prefix 01 from {01110, 01111} is set as the current code word. The currently obtained pattern string is acb, and its length is 3, so processing continues.
[0121] (4) Using the current codebook T0, the current codeword 100 is compared with the codewords included in the output set of the codebook T0. Since codeword 100 is included in the output set of the current codebook T0 and matches the prefix of the current codeword 100, pattern a corresponding to the output set {011, 100, 101} including codeword 100 is obtained, and the codebook T1 to be used next, corresponding to the output set {011, 100, 101} including codeword 100, is set as the current codebook. Codeword 100 obtained by deleting the predetermined prefix λ of the output set {011, 100, 101} including codeword 100 from the current codeword 100 is set as the current codeword. The currently obtained pattern sequence is acba, and its length is 4, so processing ends.
[0122] Next, a case where the codebook in FIG. 9 is used will be described.
[0123] <<<3-2: Encoding / Decoding Using the Codebook of Fig. 9 >>> First, encoding will be explained. Here, it is assumed that codebook T0 is used as the current codebook at the start of the encoding process. The input is the pattern sequence acba to be encoded.
[0124] (1) For the first pattern a in the pattern sequence acba, the current codebook T0 is used to obtain the codeword λ, which is a predetermined prefix of the output set {011, 10} corresponding to pattern a, and the next codebook T1 to be used corresponding to pattern a is set as the current codebook.
[0125] (2) For the first pattern c in the pattern sequence cba, the current codebook T1 is used to obtain the codeword 101, which is the predetermined prefix of the output set {10101, 1011} corresponding to pattern c, and the codebook T4 to be used next corresponding to pattern c is set as the current codebook.
[0126] (3) For the first pattern b in the pattern sequence ba, the current codebook T4 is used to obtain the codeword 01, which is the predetermined prefix of the output set {01} corresponding to pattern b, and the next codebook T0 to be used corresponding to pattern b is set as the current codebook.
[0127] (4) For the first pattern a in the pattern sequence a, the current codebook T0 is used to obtain the codeword λ, which is a predetermined prefix of the output set {011, 10} corresponding to pattern a, and the next codebook T1 to be used corresponding to pattern a is set as the current codebook.
[0128] (5) Since the first pattern a in the pattern sequence a is the last pattern to be processed, 10, which is the predetermined suffix of the codeword in the output set {011, 10} corresponding to pattern a, is obtained as the terminal codeword, and the codeword λ10101λ10, i.e., the codeword 1010110, is output.
[0129] 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. Note that the input is the codeword 1010110 to be decoded and the length of the output pattern sequence is 4.
[0130] (1) Using the current codebook T0, the current codeword 1010110 is compared with the codewords included in the output set of the codebook T0. Since codeword 10 is included in the output set of the current codebook T0 and matches the prefix of the current codeword 1010110, pattern a corresponding to the output set {011, 10} including codeword 10 is obtained, and the codebook T1 to be used next, corresponding to the output set {011, 10} including codeword 10, is set as the current codebook. Codeword 1010110 obtained by deleting the predetermined prefix λ of the output set {011, 10} including codeword 10 from the current codeword 1010110 is set as the current codeword. The currently obtained pattern sequence is a, and its length is 1, so processing continues.
[0131] (2) Using the current codebook T1, the current codeword 1010110 is compared with the codewords included in the output set of the codebook T1. Since the codeword 10101 exists as a codeword included in the output set of the current codebook T1 that matches the prefix of the current codeword 1010110, pattern c corresponding to the output set {10101, 1011} including codeword 10101 is obtained, and the codebook T4 to be used next that corresponds to the output set {10101, 1011} including codeword 10101 is set as the current codebook. The codeword 0110 obtained by deleting the predetermined prefix 101 of the output set {10101, 1011} including codeword 10101 from the current codeword 1010110 is set as the current codeword. The currently obtained pattern sequence is ac, and its length is 2, so processing continues.
[0132] (3) Using the current codebook T4, the current codeword 0110 is compared with the codewords included in the output set of the codebook T4. Since codeword 01 is included in the output set of the current codebook T4 and matches the prefix of the current codeword 0110, pattern b corresponding to the output set {01} including codeword 01 is obtained, and the codebook T0 to be used next corresponding to the output set {01} including codeword 01 is set as the current codebook. Codeword 10 obtained by deleting the predetermined prefix 01 of the output set {01} including codeword 01 from the current codeword 0110 is set as the current codeword. The currently obtained pattern sequence is acb, and its length is 3, so processing continues.
[0133] (4) Using the current codebook T0, the current codeword 10 is compared with the codewords included in the output set of the codebook T0. Since codeword 10 is included in the output set of the current codebook T0 and matches the prefix of the current codeword 10, pattern a corresponding to the output set {011, 10} including codeword 10 is obtained, and the codebook T1 to be used next, corresponding to the output set {011, 10} including codeword 10, is set as the current codebook. Codeword 10 obtained by deleting the predetermined prefix λ of the output set {011, 10} including codeword 10 from the current codeword 10 is set as the current codeword. The currently obtained pattern sequence is acba, and its length is 4, so processing ends.
[0134] Second Embodiment The encoding device 100 in this embodiment encodes 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 Furthermore, 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).
[0135] 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:
[0136] (1) Codebook or code tree T k (k=0, 1, . . . , K-1) is composed of at least two pairs: a pattern and a set of code words (hereinafter referred to as output set) beginning with the code word corresponding to the pattern.
[0137] Here, the predetermined prefix and predetermined suffix of a code word that is an element of the output set are respectively a prefix common to all elements of the output set, and the code word minus the predetermined prefix of the code word.
[0138] (2) Codebook or code tree T k The union of the output sets (k=0, 1,…, K-1) satisfies the prefix condition, and the codebook or code tree T k The codeword included in the output set of the next codebook or code tree corresponding to the pattern (k=0, 1, ..., K-1) satisfies the condition that it has at its beginning a predetermined ending of any of the codewords included in the output set corresponding to that pattern.
[0139] Codebook or coding tree T k(k=0, 1, ..., K-1) may be configured as a triplet of a pattern, an output set, and the codebook or code tree to be used next, or as a doublet of a pattern and an output set. In the second configuration, the codebook or code tree T k (k=0, 1,…, K-1) is a codebook or a code tree T k It is used together with a correspondence table (hereinafter referred to as a transition correspondence table) consisting of a set of predetermined suffixes of the output set (k=0, 1, ..., K-1) and the codebook or code tree to be used next. Note that instead of the transition correspondence table, a codebook or code tree T k A function (hereinafter referred to as a transition function) may be used that takes a predetermined set of suffixes of the output set (k=0, 1, . . . , K-1) as input and outputs the codebook or code tree to be used next.
[0140] <<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.
[0141] The operation of the encoding device 100 will be described with reference to FIG.
[0142] 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 the terminal codeword) as the output codeword.
[0143] Codebook or coding tree T kThe processing of the encoding unit 110 will be described in detail according to the differences in the configuration.
[0144] (1) Codebook or code tree T k When (k=0, 1, ..., K-1) consists of three sets of a pattern, an output set, and a codebook or code tree to be used next, the encoding unit 110 executes an encoding process consisting of the following three processes.
[0145] (1-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. (1-2) For i=0, 1, ..., L-1, use the current codebook or code tree to find pattern x i A codeword w is a predetermined prefix of any codeword in the output set corresponding to i Obtain the pattern x i (1-3) After the process of (1-2) for i=L-1 is completed, the next codebook or code tree to be used corresponding to the pattern x L-1 Select one codeword included in the output set corresponding to L and obtain the codeword w0w1...w L as the output codeword and terminate the encoding process. (2) Codebook or code tree T k When (k=0, 1, ..., K-1) consists of two pairs of a pattern and an output set, the encoding unit 110 executes the encoding process consisting of the following three processes. The transition correspondence table and transition functions are recorded in the recording unit 190.
[0146] (2-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-2) For i=0, 1, ..., L-1, use the current codebook or code tree to find pattern x i A codeword w is a predetermined prefix of any codeword in the output set corresponding to i Obtain the pattern x using the transition table or transition function. i(2-3) After the process of (2-2) for i=L-1 is completed, the next codebook or code tree to be used corresponding to the predetermined suffix set of the output set corresponding to the pattern x L-1 Select one codeword included in the output set corresponding to L and obtain the codeword w0w1...w L as an output codeword, and terminates the encoding process. <<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 required 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.
[0147] The operation of the decoding device 200 will be described with reference to FIG.
[0148] In S210, the decoding unit 210 generates a plurality of codebooks or code trees {T k} k=0 K-1 The patterns corresponding to the code words that make up the input code word are obtained using the above, and the obtained patterns are concatenated to obtain a pattern sequence of length L, which is output as an output pattern sequence.
[0149] Codebook or coding tree T k The processing of the decoding unit 210 will be described in detail according to the differences in the configuration.
[0150] (1) Codebook or code tree T k When (k=0, 1, ..., K-1) is composed of three sets of a pattern, an output set, and a codebook or code tree to be used next, the decoding unit 210 executes a decoding process consisting of the following three processes.
[0151] (1-1) Codebook or code tree T k (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. (1-2) Using the current codebook or code tree, compare the current codeword with the codewords contained in the output set of the codebook or code tree. If there is a codeword (hereinafter referred to as codeword w) contained in the output set of the current codebook or code tree that matches the prefix of the current codeword, obtain a pattern corresponding to the output set including codeword w, and set the codebook or code tree to be used next that corresponds to the output set including codeword w as the current codebook or code tree. The codeword obtained by deleting the predetermined prefix of any codeword contained in the output set including codeword w from the current codeword is set as the current codeword (however, if the length of the current codeword is longer than the length of the codeword contained in the output set of the current codebook or code tree, (1-3) If the length of the pattern sequence obtained by concatenating the patterns obtained by the process in (1-2) is L, and the pattern sequence of length L is output as an output pattern sequence, and the decoding process is terminated. Otherwise, the decoding process returns to the process in (1-2). (2) A codebook or code tree T k When (k=0, 1, ..., K-1) consists of two pairs of a pattern and an output set, the decoding unit 210 executes the decoding process consisting of the following three processes. The transition correspondence table and transition functions are recorded in the recording unit 290.
[0152] (2-1) Codebook or code tree T k(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-2) Using the current codebook or code tree, compare the current codeword with the codewords included in the output set of the codebook or code tree, and if there is a codeword (hereinafter referred to as codeword w) included in the output set of the current codebook or code tree that matches the prefix of the current codeword, obtain a pattern corresponding to the output set including codeword w, and use a transition correspondence table or transition function to obtain the codebook or code tree to be used next that corresponds to the predetermined suffix set of the output set including codeword w, and set this codebook or code tree as the current codebook or code tree, and set the codeword obtained by deleting the predetermined prefix of any codeword included in the output set including codeword w from the current codeword as the current codeword (where the length of the current codeword is equal to or greater than the length of the codeword included in the output set of the current codebook or code tree). (2-3) If the length of the pattern sequence obtained by concatenating the patterns obtained by the process in (2-2) is L, output the pattern sequence of length L as an output pattern sequence, and terminate the decoding process. Otherwise, return to the process in (2-2). Note that encoding / decoding may be performed by combining the encoding device / decoding device of the first embodiment and the encoding device / decoding device of the second embodiment. For example, encoding can be performed by the encoding device of the first embodiment, and decoding can be performed by the decoding device of the second embodiment.During decoding, the current codeword may be shorter than the codeword to be compared. In this case, decoding can be performed using a codeword obtained by concatenating an arbitrary codeword to the current codeword.
[0153] 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.
[0154] <Additional Notes> The functions performed by the components described herein may be implemented in circuitry or processing circuitry, including general-purpose processors, application-specific processors, integrated circuits, ASICs (Application Specific Integrated Circuits), CPUs (Central Processing Units), conventional circuits, and / or combinations thereof, programmed to perform the described functions. A processor includes transistors and other circuits and is considered to be circuitry or processing circuitry. A processor may also be a programmed processor that executes a program stored in a memory.
[0155] In this specification, a circuitry, unit, or means is hardware that is programmed to realize or performs the described functions, which may be any hardware disclosed herein or any hardware known to be programmed to realize or perform the described functions.
[0156] If the hardware is a processor considered to be a type of circuitry, the circuitry, means, or unit is a combination of the hardware and software used to configure the hardware and / or processor.
[0157] The various processes described above can be implemented by loading a program that executes each step of the above method into the recording unit 2020 of the computer 2000 shown in Figure 14, and operating the control unit 2010, input unit 2030, output unit 2040, display unit 2050, etc.
[0158] The program describing the processing contents can be recorded on a computer-readable recording medium, which may be, for example, a magnetic recording device, an optical disk, a magneto-optical recording medium, a semiconductor memory, or any other suitable recording medium.
[0159] The program may be distributed by, for example, selling, transferring, lending, etc. portable recording media such as DVDs and CD-ROMs 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 other computers via a network, thereby distributing the program.
[0160] A computer that executes such a program may first temporarily store the program recorded on a portable recording medium or transferred from a server computer in its own storage device. Then, when executing a process, the computer reads the program stored in its storage device and executes the process in accordance with the read program. Alternatively, the computer may read the program directly from a portable recording medium and execute the process in accordance with the program. Furthermore, the computer may execute the process in accordance with the program each time a program is transferred from a server computer to the computer. Alternatively, the server computer may not transfer the program to the computer, but may instead execute the process through a so-called ASP (Application Service Provider) service, which realizes the processing function by issuing an execution instruction and obtaining the results. Furthermore, the server computer may execute the process at the terminal using a so-called SaaS (Software as a Service) service, which allows users to use part of the server computer along with the program. In this embodiment, the program includes information used for processing by an electronic computer that is equivalent to a program (such as data that is not a direct instruction to a computer but has properties that dictate computer processing).
[0161] 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.
[0162] The present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the spirit of the present invention. Furthermore, the processes described in the above embodiments may not only be executed in chronological order according to the order described, but may also be executed in parallel or individually depending on the processing capacity of the device that executes the processes or as needed.
Claims
1. A pattern sequence \(x_0x_1\cdots x_{L}\) (where \(L\) is an integer of 2 or more) is input, and an encoding device that outputs a codeword corresponding to the pattern sequence (hereinafter referred to as an output codeword), which uses a plurality of codebooks or code trees \(\{T\}\) (where \(K\) is an integer of 2 or more) to obtain a codeword \(w\) corresponding to the pattern \(x\), and concatenates the codewords \(w_0, w_1,\cdots, w_{L - 1}\) to obtain a codeword \(w_0w_1\cdots w_{L - 1}\) (where \(w_{L - 1}\) is an end codeword) as the output codeword, and includes an encoding unit. The codebook or code tree \(T_k\) (\(k = 0, 1,\cdots, K - 1\)) is composed of at least two pairs of a pattern and a set of codewords starting with the codeword corresponding to the pattern (hereinafter referred to as an output set). The predetermined prefix and the predetermined suffix of the codeword that is an element of the output set are the prefix common to all elements of the output set and the part obtained by removing the predetermined prefix of the codeword from the codeword, respectively. The union of the output sets of the codebook or code tree \(T_k\) (\(k = 0, 1,\cdots, K - 1\)) satisfies the prefix condition, and the codeword included in the output set of the next codebook or code tree to be used corresponding to the pattern of the codebook or code tree \(T_k\) (\(k = 0, 1,\cdots, K - 1\)) has the predetermined suffix of any codeword included in the output set corresponding to the pattern as its prefix. Encoding device. L-1 (where \(x\) i (\(i = 0, 1,\cdots, L - 1\)) is a pattern) is input, and the codeword corresponding to the pattern sequence \(x_0x_1\cdots x_{L}\) L-1 is obtained using a plurality of codebooks or code trees \(\{T\}\) k \} k=0 K-1 (where \(K\) is an integer of 2 or more) to obtain a codeword \(w\) i corresponding to the pattern \(x\), and the codewords \(w_0, w_1,\cdots, w_{L - 1}\) i are concatenated to obtain a codeword \(w_0w_1\cdots w_{L - 1}\) L-1 (where \(w_{L - 1}\) L is an end codeword) is output as the output codeword, and includes an encoding unit. The codebook or code tree \(T_k\) L (\(k = 0, 1,\cdots, K - 1\)) is composed of at least two pairs of a pattern and a set of codewords starting with the codeword corresponding to the pattern (hereinafter referred to as an output set). The predetermined prefix and the predetermined suffix of the codeword that is an element of the output set are the prefix common to all elements of the output set and the part obtained by removing the predetermined prefix of the codeword from the codeword, respectively. The union of the output sets of the codebook or code tree \(T_k\) k (\(k = 0, 1,\cdots, K - 1\)) satisfies the condition that it satisfies the prefix condition, and the codeword included in the output set of the next codebook or code tree to be used corresponding to the pattern of the codebook or code tree \(T_k\) k (\(k = 0, 1,\cdots, K - 1\)) has the predetermined suffix of any codeword included in the output set corresponding to the pattern as its prefix. The codebook or code tree \(T_k\) k (\(k = 0, 1,\cdots, K - 1\)) satisfies the condition that the codeword included in the output set of the next codebook or code tree to be used corresponding to the pattern has the predetermined suffix of any codeword included in the output set corresponding to the pattern as its prefix. Encoding device.
2. The encoding device according to claim 1, wherein the code book or code tree T k (k = 0, 1,..., K - 1) is composed of three sets: a pattern, an output set, and the code book or code tree to be used next. The encoding unit performs the following operations: (1) a process of setting the code book or code tree T k (where k is an integer from 0 to K - 1) as the current code book or code tree; (2) for i = 0, 1,..., L - 1, using the current code book or code tree, obtaining a code word w i which is the predetermined prefix of any code word included in the output set corresponding to the pattern x i , and a process of setting the code book or code tree to be used next corresponding to the pattern x i as the current code book or code tree; (3) after the process of (2) for i = L - 1 is completed, selecting one code word included in the output set corresponding to the pattern x L-1 , obtaining the predetermined suffix of the selected code word as the end code word w L , outputting the code word w0w1...w L as the output code word, and ending the encoding process. The encoding device is characterized by performing the above operations.
3. A decoding device that takes as input the length L of a codeword to be decoded (hereinafter referred to as the input codeword) and the pattern sequence to be output, and outputs a pattern sequence of length L corresponding to the input codeword (hereinafter referred to as the output pattern sequence), the decoding device including a decoding unit that obtains patterns corresponding to the codewords constituting the input codeword using a plurality of codebooks or code trees {T k} k=0 K-1 (where K is an integer of 2 or more, and {T k} k=0 K-1 are the plurality of codebooks or code trees used in the encoding process of the input codeword), concatenates the obtained patterns, and outputs the pattern sequence of length L obtained as the output pattern sequence, and the codebook or code tree T k (k = 0, 1,..., K - 1) is composed of at least two pairs of a pattern and a set of codewords having the codeword corresponding to the pattern as a prefix (hereinafter referred to as the output set), the predetermined prefix and the predetermined suffix of the codeword that is an element of the output set are respectively the prefix common to all the elements of the output set and the part obtained by removing the predetermined prefix of the codeword from the codeword, and the union of the output sets of the codebooks or code trees T k (k = 0, 1,..., K - 1) satisfies the condition of satisfying the prefix condition, and the codeword included in the output set of the next codebook or code tree to be used corresponding to the pattern of the codebook or code tree T k (k = 0, 1,..., K - 1) has the predetermined suffix of any codeword included in the output set corresponding to the pattern as a prefix. The decoding device.
4. The decoding device according to claim 3, wherein the code book or the code tree T k (k = 0, 1,..., K - 1) consists of three sets: a pattern, an output set, and the next code book or code tree to be used. The decoding unit performs the following operations: (1) sets the code book or code tree T k (where k is the number of the code book or code tree used when starting the encoding process of the input codeword) as the current code book or code tree, and sets the input codeword as the current codeword. (2) Using the current code book or code tree, compares the current codeword with the codewords included in the output set of the code book or code tree. If there exists a codeword (hereinafter referred to as codeword w) included in the output set of the current code book or code tree that matches the head of the current codeword, obtains the pattern corresponding to the output set including the codeword w, sets the next code book or code tree to be used corresponding to the output set including the codeword w as the current code book or code tree, and sets the codeword obtained by deleting a predetermined head of an arbitrary codeword included in the output set including the codeword w from the current codeword as the current codeword (however, in the case where the length of the current codeword is shorter than the length of the codeword included in the output set of the current code book or code tree and there is no codeword included in the output set of the current code book or code tree that matches the head of the current codeword, but there exists a codeword (hereinafter referred to as codeword w) included in the output set of the current code book or code tree that matches the head of the codeword obtained by concatenating an arbitrary codeword to the current codeword, obtains the pattern corresponding to the output set including the codeword w, sets the next code book or code tree to be used corresponding to the output set including the codeword w as the current code book or code tree, and sets the codeword obtained by deleting a predetermined head of an arbitrary codeword included in the output set including the codeword w from the current codeword as the current codeword). (3) When the length of the pattern sequence obtained by concatenating the patterns obtained by the process in (2) is L, outputs the pattern sequence of length L as the output pattern sequence and terminates the decoding process; otherwise, returns to the process in (2). A decoding device characterized by performing the above operations.
5. The encoder generates 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 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 and 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 (k=0, 1, ..., K-1) is composed of at least two pairs of a pattern and a set of code words (hereinafter referred to as output set) whose prefix is the code word corresponding to the pattern, and the predetermined prefix and predetermined suffix of the code word that is an element of the output set are respectively a prefix common to all elements of the output set and the code word obtained by removing the predetermined prefix of the code word, and the codebook or code tree T k The union of the output sets (k=0, 1,…, K-1) satisfies the prefix condition, and the codebook or code tree T k A coding method in which the codeword included in the output set of the next codebook or code tree corresponding to a pattern (k=0, 1, ..., K-1) satisfies the condition that the codeword has a predetermined ending at the beginning of any of the codewords included in the output set corresponding to the pattern.
6. A decoding method in which a decoding device takes as input a codeword to be decoded (hereinafter referred to as an input codeword) and the length L of a pattern sequence to be output, and outputs a pattern sequence of length L corresponding to the input codeword (hereinafter referred to as an output pattern sequence), wherein the decoding device uses a plurality of codebooks or code trees {T k} k=0 K-1 (where K is an integer of 2 or more, and {T k} k=0 K-1 are the plurality of codebooks or code trees used in the encoding process of the input codeword) to obtain a pattern corresponding to the codeword constituting the input codeword, and includes a decoding step of outputting, as the output pattern sequence, a pattern sequence of length L obtained by concatenating the obtained patterns. The codebook or code tree T k (k = 0, 1,..., K - 1) is composed of at least two pairs of a pattern and a set of codewords having the codeword corresponding to the pattern as a prefix (hereinafter referred to as an output set). The predetermined prefix and the predetermined suffix of the codeword that is an element of the output set are respectively the prefix common to all elements of the output set and the part obtained by removing the predetermined prefix of the codeword from the codeword. The sum set of the output sets of the codebook or code tree T k (k = 0, 1,..., K - 1) satisfies the condition of satisfying a prefix condition, and the codeword included in the output set of the codebook or code tree to be used next corresponding to the pattern of the codebook or code tree T k (k = 0, 1,..., K - 1) has, as a prefix, the predetermined suffix of any codeword included in the output set corresponding to the pattern. Decoding method.
7. A data structure for a plurality of codebooks or code trees {T k} k=0 K-1 (where K is an integer of 2 or more), wherein the codebook or code tree T k (k = 0, 1,..., K - 1) is composed of at least two pairs of a pattern and a set of codewords starting with the codeword corresponding to the pattern (hereinafter referred to as an output set). The predetermined prefix and the predetermined suffix of the codewords that are elements of the output set are respectively the prefix common to all elements of the output set and the codeword obtained by removing the predetermined prefix of the codeword from the codeword. The codebook or code tree T k (k = 0, 1,..., K - 1) satisfies the condition that the union of the output sets satisfies the prefix condition, and the codewords included in the output set of the next codebook or code tree to be used corresponding to the pattern of the codebook or code tree T k (k = 0, 1,..., K - 1) have, as a prefix, the predetermined suffix of any of the codewords included in the output set corresponding to the pattern. Data structure.
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
Data compression device and data restoring device
WO2008078390A1