Encoding device, decoding device, encoding method, decoding method, and program

By employing multiple codebooks with a predetermined switching mechanism, the method addresses inefficiencies in existing lossless compression coding, enhancing compression efficiency and enabling seamless decoding from any point in the codeword sequence.

WO2025169479A1PCT designated stage Publication Date: 2025-08-14NT T INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2024/004597
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-02-09
Publication Date
2025-08-14

AI Technical Summary

Technical Problem

Existing lossless compression coding technologies face challenges in improving compression efficiency due to strict constraints on codeword lengths, leading to inefficient use of codewords and difficulty in decoding from intermediate codewords.

Method used

The use of multiple codebooks or parse trees, comprising basic and termination codebooks or parse trees, with a predetermined codebook switching mechanism that allows decoding from the middle of a codeword by ensuring a self-evident starting codebook is used periodically.

Benefits of technology

This approach enhances compression efficiency by optimizing codeword assignment and enables decoding from any point in the codeword sequence without requiring knowledge of previous encoding trees, thus improving data handling and compression performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2024004597_14082025_PF_FP_ABST
    Figure JP2024004597_14082025_PF_FP_ABST
Patent Text Reader

Abstract

Provided is an encoding device that receives an input symbol string as input and outputs an output codeword corresponding to the input symbol string, wherein: a plurality of basic codebooks or basic parse trees and at least one terminal codebook or terminal parse tree are each constituted by a set including at least a symbol string and a codeword; all codewords included in the plurality of basic codebooks or basic parse trees have the same length; all codewords included in the at least one terminal codebook or terminal parse tree have the same length; every prescribed number of times an encoding unit executes a process for obtaining a codeword corresponding to a symbol string that constitutes an input symbol string, the encoding unit repeatedly executes a repeating unit of encoding while using a start codebook or start parse tree as a codebook or parse tree to be used next, and thereby obtains output codewords.
Need to check novelty before this filing date? Find Prior Art

Description

Encoding device, decoding device, encoding method, decoding method, and 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 that perform lossless compression coding of finite-precision digital signals and digital data, such as audio signals, image signals, time series signals obtained from various sensors such as brightness sensors, acceleration sensors, and seismometers, character strings, and word strings. Some lossless compression coding technologies output codewords of a constant length corresponding to an input symbol string. The advantage of outputting codewords of a constant length is that it is easy to grasp the boundaries of codewords, making data handling easier.

[0003] When designing lossless compression coding technology, the rules that determine which codewords are output for which symbol strings (hereafter referred to as encoding rules) are expressed using parse trees or codebooks. For example, in the case of an encoding rule that outputs a 3-bit codeword for a symbol string consisting of a combination of three symbols a, b, and c, it is desirable to assign a symbol string to each of the eight codewords that can be expressed with 3 bits and maximize the expected length of the symbol string encoded with 3 bits for a randomly given symbol string. To achieve this, it is effective to design an encoding rule that assigns 3-bit codewords to symbol strings that contain as many symbols as possible that have a high occurrence probability among the symbols a, b, and c. Figure 1 shows examples of parse trees and codebooks. Figure 1(A) is a parse tree that represents an encoding rule that is effective when the occurrence probability of symbol a is high, and the codebook in Figure 1(B) is equivalent to the parse tree in Figure 1(A). In the parse tree in Figure 1(A), the 3-bit codewords are assigned to the terminal nodes, or leaves, and the individual symbols that make up the symbol string are assigned to the edges. A code with good compression efficiency can be constructed by ensuring that any symbol string can be uniquely encoded. To construct such a code, each node, as in the parse tree in Figure 1(A), must either have no child nodes (i.e., be a leaf), or have as many child nodes as there are symbol types (in this example, three: a, b, and c).

[0004] However, the above-mentioned constraints on nodes are strict, and codes with constant codeword lengths tend to have difficulty improving compression efficiency. For example, in the example of Figure 1, assume that the occurrence probability of symbol a is much higher than that of symbols b and c. In this case, to increase the expected value of the length of the symbol string that can be encoded, it is efficient to assign a codeword to the symbol string aaa, which is a string of symbols a, but in order to satisfy the above constraints, it is necessary to assign a codeword to the symbol string aab and aac even if the occurrence probability of the symbol strings aab and aac is not very high. If the occurrence probability of the symbol strings ba and ca is higher than the occurrence probability of the symbol strings aab and aac, the word length relative to the occurrence probability may be shorter. As a result, the limited codewords are wasted, and compression efficiency decreases.

[0005] Therefore, the technology in Non-Patent Document 1 relaxes the above constraints by using multiple analytic trees. Figure 2 shows examples of analytic trees and codebooks. Figure 2(A) is an analytic tree equivalent to Figure 1(A), and the codebook in Figure 2(B) is equivalent to the analytic tree in Figure 2(A). The analytic tree in Figure 2(A) represents one encoding rule with two analytic trees T0 and T1. In analytic trees T0 and T1, codewords are assigned to nodes other than leaves. By defining an analytic tree switching rule such that when a codeword assigned to a node other than a leaf is output, the next symbol string is encoded using analytic tree T1, and when a codeword assigned to a leaf is output, the next symbol string is encoded using analytic tree T0, compression efficiency is improved while ensuring that any input symbol string can be uniquely encoded. In the analytic tree in Figure 2(A), codewords are assigned to nodes other than leaves, so the node does not need to have child nodes equal to the number of symbol types. Therefore, as can be seen from FIG. 2, it is not necessary to assign code words to the symbol strings aab and aac, and instead it is possible to assign code words to the symbol strings ba and ca.

[0006] H. Yamamoto, H. Yokoo, “Average-Sense Optimality and Competitive Optimality for Almost Instantaneous VF Codes,” in IEEE Transactions on Information Theory, vol.47, no.6, pp.2174-2184, Sep. 2001.

[0007] A code represented by a single analytic tree with constant codeword length has the important property that not only is it obvious how to separate codewords, but it can also be decoded even if decoding is started from an intermediate codeword in the codeword to be decoded. On the other hand, the technology of Non-Patent Document 1 can construct a code with higher compression efficiency than a code represented by a single analytic tree with constant codeword length, but it cannot start decoding from an intermediate codeword in the codeword to be decoded. This is because, in order to start decoding from an intermediate codeword in the codeword to be decoded, it is necessary to know which analytic tree was used to encode the codeword, and the technology of Non-Patent Document 1 requires tracing the analytic trees used for encoding in order.

[0008] Therefore, an object of the present invention is to provide an encoding / decoding technique that uses a plurality of codebooks or parse trees, which allows decoding of a codeword to be decoded from the middle of the codeword.

[0009] One aspect of the present invention is a coding device that receives as input a symbol string to be coded (hereinafter referred to as an input symbol string) and outputs a codeword (hereinafter referred to as an output codeword) corresponding to the input symbol string, the device including a coding unit that uses a plurality of codebooks or analytic trees to obtain a codeword corresponding to a symbol string that constitutes the input symbol string, and outputs a codeword obtained by concatenating the obtained codewords as the output codeword, the plurality of codebooks or analytic trees being composed of a plurality of basic codebooks or basic analytic trees and one or more termination codebooks or termination analytic trees, the plurality of basic codebooks or basic analytic trees and the one or more termination codebooks or termination analytic trees being composed of pairs including at least a symbol string and a codeword, the codewords included in the plurality of basic codebooks or basic analytic trees all having the same length, all of the codewords included in the termination codebook or termination analytic tree have the same length, and the encoding unit obtains a codeword corresponding to a symbol string constituting the input symbol string using any of the plurality of basic codebooks or basic analytic trees or the one or more termination codebooks or termination analytic trees, and obtains the output codeword by repeating a process of setting any of the plurality of basic codebooks or basic analytic trees or the one or more termination codebooks or termination analytic trees as the codebook or analytic tree to be used next, and when a termination codebook or termination analytic tree is used, the codebook or analytic tree to be used next is a predetermined basic codebook or basic analytic tree (hereinafter referred to as a starting codebook or starting analytic tree), and the codebook or analytic tree to be used next becomes the starting codebook or starting analytic tree at a predetermined cycle.

[0010] One aspect of the present invention is a decoding device that receives as input a codeword to be decoded (hereinafter referred to as input codeword) and outputs a symbol string corresponding to the input codeword (hereinafter referred to as output symbol string), the decoding device including a decoding unit that obtains symbol strings corresponding to codewords that constitute the input codeword using a plurality of codebooks or analytic trees (where the plurality of codebooks or analytic trees are the same as the plurality of codebooks or analytic trees used in the encoding process to obtain the input codeword), and outputs a symbol string obtained by concatenating the obtained symbol strings as the output symbol string, the plurality of codebooks or analytic trees being composed of a plurality of basic codebooks or basic analytic trees and one or more termination codebooks or termination analytic trees, the plurality of basic codebooks or basic analytic trees and the one or more termination codebooks or termination analytic trees being composed of pairs including at least a symbol string and a codeword, the codewords included in the plurality of basic codebooks or basic analytic trees all have the same length, all of the codewords included in the termination codebook or termination analytic tree have the same length, and the decoding unit obtains a symbol string corresponding to the codeword that constitutes the input codeword using any of the plurality of basic codebooks or basic analytic trees or the one or more termination codebooks or termination analytic trees, and obtains the output symbol string by repeating a process of setting any of the plurality of basic codebooks or basic analytic trees or the one or more termination codebooks or termination analytic trees as the codebook or analytic tree to be used next, and when a termination codebook or termination analytic tree is used, the codebook or analytic tree to be used next is a predetermined basic codebook or basic analytic tree (however, this basic codebook or basic analytic tree is the same as the basic codebook or basic analytic tree that was initially used in the encoding process to obtain the input codeword, and will hereinafter be referred to as a starting codebook or starting analytic tree), and the codebook or analytic tree to be used next becomes the starting codebook or starting analytic tree in a predetermined cycle.

[0011] According to the present invention, it is possible to realize a code that uses multiple codebooks or parse trees, which allows decoding of a codeword to be decoded from the middle of the codeword.

[0012] 1 is a diagram showing an example of an analytic tree and a codebook. 2 is a diagram showing an example of an analytic tree and a codebook. 3 is a diagram showing an example of a basic codebook. 4 is a diagram showing an example of a termination codebook. 5 is a diagram showing an example of an analytic tree for a termination. 6 is a block diagram showing a configuration of an encoding device 100. 7 is a flowchart showing the operation of an encoding device 100. 8 is a block diagram showing a configuration of a decoding device 200. 9 is a flowchart showing the operation of a decoding device 200. 10 is a diagram showing an example of a basic codebook. 11 is a diagram showing an example of a basic analytic tree. 12 is a diagram showing an example of a termination codebook. 13 is a diagram showing an example of an analytic tree for a termination. 14 is a diagram showing an example of a basic codebook. 15 is a diagram showing an example of a termination codebook. 16 is a diagram showing an example of a basic codebook. 17 is a diagram showing an example of a termination codebook. 18 is a diagram showing an example of a basic codebook. 19 is a diagram showing an example of a termination codebook. 20 is a diagram showing an example of a functional configuration of a computer that realizes each device in an embodiment of the present invention.

[0013] 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.

[0014] Before describing each embodiment, the notation used in this specification will be explained.

[0015] ^ (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.

[0016] 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.

[0017] In the following, ε denotes a symbol string of length 0, and λ denotes a codeword of length 0. Note that the symbol string ε can be the prefix of any symbol string, and the codeword λ can be the prefix of any codeword.

[0018] <Technical Background> The encoding / decoding in the first embodiment uses multiple codebooks based on the technology of Non-Patent Document 1 that can express encoding rules that satisfy the condition that unique encoding is possible (hereinafter referred to as the unique encoding possibility condition), and multiple codebooks that have roles different from those of the multiple codebooks. Note that analytic trees may be used instead of codebooks, and this does not result in any difference in the encoding procedure / decoding procedure.

[0019] <<1: Codebooks and Switching Rules Thereof>> The codebooks in the first embodiment include two types of codebooks: a plurality of codebooks (hereinafter referred to as base codebooks) that satisfy the unique coding possibility condition, and a plurality of codebooks (hereinafter referred to as terminating codebooks) that have roles different from those of the plurality of codebooks. Both the base codebook and the terminating codebook are composed of pairs of an input symbol string and an output codeword of a predetermined length (hereinafter referred to as L). The number of base codebooks and the number of terminating codebooks are the same.

[0020] Figures 3 and 4 are diagrams showing examples of codebooks. Figure 5 is a diagram showing an example of an analytic tree. The codebook in Figure 3 is a base codebook based on the technology of Non-Patent Document 1 and is equivalent to the analytic tree in Figure 2(A). The codebook in Figure 4 is a termination codebook used together with the base codebook in Figure 3 and is equivalent to the analytic tree in Figure 5. The base codebook in Figure 3 and the termination codebook in Figure 4 are used to encode a symbol string that is a string of symbols {a, b, c} into a codeword that is a string of codes {0, 1}, and consist of two base codebooks, T0 and T1, and two termination codebooks, ~T0 and ~T1. Note that the length L of the codeword output in the codebooks T0, T1, ~T0, and ~T1 is 3.

[0021] Next, a codebook switching rule when encoding / decoding is performed in the first embodiment will be described. In the encoding / decoding in the first embodiment, a predetermined number of times (hereinafter, N CW The codebook is switched so that encoding / decoding is performed using a predetermined base codebook (hereinafter referred to as a starting codebook) every time encoding / decoding is performed a predetermined number of times (N CWEach time the encoding / decoding process is repeated, the codebook to be used next returns to the codebook that was used when the encoding / decoding process started. Therefore, the codebook has a predetermined length L and a predetermined number of times N, which are the components of a codebook pair. CW The product of LN CW Therefore, it is possible to decode each codeword of length .times. ...

[0022] As mentioned above, the coding rules can also be expressed using parse trees. Therefore, the above explanation of the codebook also applies to parse trees, simply by replacing the word "codebook" with "parse tree." For example, base parse trees, termination parse trees, and start parse trees can also be defined in the same way.

[0023] <<2: Encoding Procedure / Decoding Procedure>> The encoding procedure in the first embodiment takes as input a symbol string to be encoded (hereinafter referred to as an input symbol string), obtains codewords corresponding to the symbol strings constituting the input symbol string using two base codebooks T0, T1 and two termination codebooks ~T0, ~T1, and outputs a codeword obtained by concatenating all the obtained codewords (hereinafter referred to as an output codeword). Meanwhile, the decoding procedure in the first embodiment takes as input a codeword to be decoded (hereinafter referred to as an input codeword), obtains symbol strings corresponding to the codewords constituting the input codeword using two base codebooks T0, T1 and two termination codebooks ~T0, ~T1 (where the base codebooks T0, T1 and the termination codebooks ~T0, ~T1 are the codebooks used in the encoding procedure), and outputs a symbol string obtained by concatenating all the obtained symbol strings (hereinafter referred to as an output symbol string).

[0024] The encoding procedure / decoding procedure will be explained below using the basic codebook in Figure 3 and the termination codebook in Figure 4 as examples. The starting codebook is shared between the encoding procedure and the decoding procedure, and here the starting codebook is the basic codebook T0. Also, after a predetermined number of times N CW is also shared between the encoding and decoding procedures.

[0025] (Encoding Procedure) The current symbol string is the symbol string currently being encoded, and the current codebook is the codebook currently being used for encoding. Therefore, the current symbol string and the current codebook at the start of encoding are the input symbol string and the starting codebook, respectively.

[0026] The encoding procedure in the first embodiment comprises the following three processes.

[0027] (1) Initialize the counter N for counting the number of times encoding is executed. That is, set N=0. Also, set T0, which is the starting codebook, as the current codebook. Set the input symbol string as the current symbol string.

[0028] (2) Using the current codebook, the current symbol string is compared with the symbol string contained in the codebook. The codeword corresponding to the symbol string σ contained in the current codebook that has the longest match with the prefix of the current symbol string is obtained, and the symbol string obtained by excluding the prefix that matches the symbol string σ from the current symbol string is set as the current symbol string. Also, the counter N is incremented by 1. That is, N = N + 1. Furthermore, the current codebook is obtained according to the following case distinction:

[0029] (α)N <N CW If the result is -1, if a symbol string beginning with the symbol string σ (however, the symbol string is different from the symbol string σ) is not included in the set of symbol strings included in the current codebook, T0 is obtained as the codebook to be used next, and if it is included in the set, T1 is obtained as the codebook to be used next, and the codebook to be used next becomes the current codebook.

[0030] (β)N=N CW If the case is -1, if a symbol string beginning with the symbol string σ (however, the symbol string is different from the symbol string σ) is not included in the set of symbol strings included in the current codebook, then ~T0 is obtained as the codebook to be used next, and if it is included in the set, ~T1 is obtained as the codebook to be used next, and the codebook to be used next becomes the current codebook.

[0031] (γ)N=N CW If T0 is the starting codebook, T0 is set as the current codebook. Also, the counter N is initialized.

[0032] (3) If the length of the current symbol string obtained by process (2) is 0, the code word obtained by concatenating all the code words obtained by process (2) is output as the output code word, and the encoding process ends; otherwise, return to process (2).

[0033] (Decoding Procedure) The current codeword is the codeword currently being decoded, and the current codebook is the codebook currently being used for the decoding. Therefore, the current codeword and current codebook at the start of decoding are the input codeword and the starting codebook, respectively.

[0034] The decoding procedure in the first embodiment comprises the following three steps.

[0035] (1) Initialize the counter N for counting the number of decoding executions. That is, set N=0. Also, set T0, which is the starting codebook, as the current codebook. Set the input codeword as the current codeword.

[0036] (2) Using the current codebook, the current codeword is compared with the codewords contained in the codebook. A symbol string corresponding to the codeword w contained in the current codebook that matches the prefix of the current codeword is obtained, and the codeword obtained by removing the prefix that matches the codeword w from the current codeword is set as the current codeword. Also, the counter N is incremented by 1. That is, N = N + 1. Furthermore, the current codebook is obtained according to the following case distinction:

[0037] (α)N <N CW If the value is -1, if a symbol string beginning with the symbol string corresponding to codeword w (however, this symbol string is different from the symbol string corresponding to codeword w) is not included in the set of symbol strings included in the current codebook, T0 is selected as the codebook to be used next, and if it is included in the set, T1 is selected as the codebook to be used next, and this codebook to be used next becomes the current codebook.

[0038] (β)N=N CWIf the value is -1, if a symbol string beginning with the symbol string corresponding to codeword w (however, this symbol string is different from the symbol string corresponding to codeword w) is not included in the set of symbol strings included in the current codebook, then ~T0 is taken as the codebook to be used next; if it is included in the set, then ~T1 is taken as the codebook to be used next, and this codebook to be used next becomes the current codebook.

[0039] (γ)N=N CW If T0 is the starting codebook, T0 is set as the current codebook. Also, the counter N is initialized.

[0040] (3) If the length of the current codeword obtained by process (2) is 0, the symbol string obtained by concatenating all symbol strings obtained by process (2) is output as the output symbol string, and the decoding process ends; otherwise, return to process (2).

[0041] The encoding procedure / decoding procedure using the codebook can also be changed to an encoding procedure / decoding procedure using an analytic tree by simply replacing the word "codebook" with "analytic tree."

[0042] <<3: Example of Encoding / Decoding>> Here, as an example of encoding / decoding, encoding / decoding for the symbol string aaabbbccaaab when using the basic codebook of FIG. 3 and the termination codebook of FIG. 4 will be described. First, encoding will be described. Here, CW = 3. The starting codebook is the basic codebook T0. The input symbol string is the symbol string aaabbbccaaab to be coded, and the symbol string aaabbbccaaab is set as the current symbol string. A counter N is initialized.

[0043] (1) Using the current codebook T0, the current symbol string aaabbbccaaab is compared with the symbol strings contained in the codebook T0. Since the symbol string aaa is the symbol string contained in the current codebook T0 that matches the prefix of the current symbol string aaabbbccaaab for the longest period, the symbol string aaa is encoded into the codeword 000, and the symbol string bbbccaaab obtained by removing the prefix that matches the symbol string aaa from the current symbol string aaabbbccaaab is set as the current symbol string, and the counter N is incremented by 1 (i.e., N=1). <N CWSince -1 (= 2) is satisfied and the current codebook T0 contains only the symbol string aaa that begins with the symbol string aaa, the current codebook is set to T0. Since the length of the current symbol string bbbccaaab is not 0, the encoding process continues.

[0044] (2) Using the current codebook T0, the current symbol string bbbccaaab is compared with the symbol strings contained in the codebook T0. Since the symbol string b contained in the current codebook T0 has the longest match with the prefix of the current symbol string bbbccaaab, the symbol string b is encoded into codeword 101, the symbol string bbccaaab obtained by removing the prefix that matches the symbol string b from the current symbol string bbbccaaab is set as the current symbol string, and the counter N is incremented by 1 (i.e., N=2). N=N CW Since the condition -1 (= 2) is satisfied and the current codebook T0 contains a symbol string ba that starts with symbol string b (different from symbol string b), the current codebook is designated as ~T1. Since the length of the current symbol string bbccaaab is not 0, continue encoding.

[0045] (3) Using the current codebook ~T1, the current symbol string bbccaaab is compared with the symbol strings contained in the codebook ~T1. Since the symbol string bb is the symbol string contained in the current codebook ~T1 that matches the prefix of the current symbol string bbccaaab for the longest period, the symbol string bb is encoded into codeword 101, the symbol string ccaaab obtained by removing the prefix that matches the symbol string bb from the current symbol string bbccaaab is set as the current symbol string, and the counter N is incremented by 1 (i.e., N=3). N=N CW Since (=3) is satisfied, the counter N is initialized and the current codebook is set to T0. Since the length of the current symbol string ccaaab is not 0, the encoding process continues.

[0046] (4) Using the current codebook T0, the current symbol string ccaaab is compared with the symbol strings contained in the codebook T0. Since the symbol string c contained in the current codebook T0 has the longest match with the prefix of the current symbol string ccaaab, the symbol string c is encoded into the codeword 110, the symbol string caaab obtained by removing the prefix that matches the symbol string c from the current symbol string ccaaab is set as the current symbol string, and the counter N is incremented by 1 (i.e., N=1). <N CW Since the condition -1 (= 2) is satisfied and the current codebook T0 contains a symbol string ca that starts with symbol string c (different from symbol string c), the current codebook is designated as T1. Since the length of the current symbol string caaab is not 0, continue the encoding process.

[0047] (5) Using the current codebook T1, the current symbol string caaab is compared with the symbol strings contained in the codebook T1. Since the symbol string ca is the symbol string contained in the current codebook T1 that matches the prefix of the current symbol string caaab for the longest period, the symbol string ca is encoded into the codeword 111, the symbol string aab obtained by removing the prefix that matches the symbol string ca from the current symbol string caaab is set as the current symbol string, and the counter N is incremented by 1 (i.e., N=2). N=N CW Since -1 (= 2) is satisfied and the current codebook T1 only has the symbol string ca as its prefix, the current codebook is set to ~T0. Since the length of the current symbol string aab is not 0, the encoding process continues.

[0048] (6) Using the current codebook ~T0, the current symbol string aab is compared with the symbol strings contained in the codebook ~T0. Since the symbol string aab is the symbol string contained in the current codebook ~T0 that matches the prefix of the current symbol string aab for the longest period, the symbol string aab is encoded into the codeword 001, the symbol string ε obtained by removing the prefix that matches the symbol string aab from the current symbol string aab is set as the current symbol string, and the counter N is incremented by 1 (i.e., N=3). N=N CW Since (=3) is satisfied, the counter N is initialized and the current codebook is set to T0. Since the current symbol string ε is a symbol string of length 0, the codeword 000101101110111001 is output and the encoding process ends.

[0049] Next, the decoding will be explained. CW The starting codebook is shared between the encoding and decoding procedures. CW = 3. The starting codebook is set to basic codebook T0. The input codeword is the codeword to be decoded, 000101101110111001, and the codeword 000101101110111001 is set to the current codeword. A counter N is initialized.

[0050] (1) Using the current codebook T0, the current codeword 000101101110111001 is compared with the codewords contained in the codebook T0. The symbol string aaa is obtained as the symbol string corresponding to the first 3-bit codeword 000 of the current codeword 000101101110111001, and the codeword 101101110111001 obtained by removing the prefix that matches the codeword 000 from the current codeword 000101101110111001 is set as the current codeword, and the counter N is incremented by 1 (i.e., N=1). <N CW Since the condition -1 (= 2) is satisfied and the current codebook T0 contains only the symbol string aaa that begins with the symbol string aaa corresponding to the codeword 000, the current codebook is set to T0. Since the length of the current codeword 101101110111001 is not 0, the decoding process continues.

[0051] (2) Using the current codebook T0, the current codeword 101101110111001 is compared with the codewords contained in the codebook T0. A symbol string b is obtained as a symbol string corresponding to the first 3-bit codeword 101 of the current codeword 101101110111001, and the codeword 101110111001 obtained by removing the prefix that matches the codeword 101 from the current codeword 101101110111001 is set as the current codeword, and the counter N is incremented by 1 (i.e., N=2). N=N CW Since the condition -1 (= 2) is satisfied and the current codebook T0 contains a symbol string ba (different from the symbol string b) that begins with the symbol string b corresponding to the codeword 101, the current codebook is set to ~T1. Since the length of the current codeword 101110111001 is not 0, the decoding process continues.

[0052] (3) Using the current codebook ~T1, the current codeword 101110111001 is compared with the codewords contained in the codebook ~T1. A symbol string bb is obtained as a symbol string corresponding to the first 3-bit codeword 101 of the current codeword 101110111001, and the codeword 110111001 obtained by removing the prefix that matches the codeword 101 from the current codeword 101110111001 is set as the current codeword, and the counter N is incremented by 1 (i.e., N=3). N=N CW Since (=3) is satisfied, the counter N is initialized and the current codebook is set to T0. Since the length of the current codeword 110111001 is not 0, the decoding process continues.

[0053] (4) Using the current codebook T0, the current codeword 110111001 is compared with the codewords contained in the codebook T0. A symbol string c is obtained as a symbol string corresponding to the first 3-bit codeword 110 of the current codeword 110111001, and the codeword 111001 obtained by removing the first bit that matches the codeword 110 from the current codeword 110111001 is set as the current codeword, and the counter N is incremented by 1 (i.e., N=1). <N CW Since the condition -1 (= 2) is satisfied and the current codebook T0 contains a symbol string ca (different from the symbol string c) that begins with the symbol string c corresponding to the codeword 110, the current codebook is set to T1. Since the length of the current codeword 111001 is not 0, the decoding process continues.

[0054] (5) Using the current codebook T1, the current codeword 111001 is compared with the codewords contained in the codebook T1. A symbol string ca is obtained as a symbol string corresponding to the first 3-bit codeword 111 of the current codeword 111001, and the codeword 001 obtained by removing the prefix that matches the codeword 111 from the current codeword 111001 is set as the current codeword, and the counter N is incremented by 1 (i.e., N=2). N=N CW Since the condition -1 (= 2) is satisfied and the current codebook T0 contains only the symbol string ca that begins with the symbol string ca corresponding to the codeword 111, the current codebook is set to ~T0. Since the length of the current codeword 001 is not 0, the decoding process continues.

[0055] (6) Using the current codebook ~T0, the current codeword 001 is compared with the codewords contained in the codebook ~T0. The symbol string aab is obtained as the symbol string corresponding to the first 3-bit codeword 001 of the current codeword 001, and the codeword λ obtained by removing the prefix that matches the codeword 001 from the current codeword 001 is set as the current codeword, and the counter N is incremented by 1 (i.e., N=3). N=N CW Since (=3) is satisfied, the counter N is initialized and the current codebook is set to T0. Since the current codeword λ is a codeword of length 0, the symbol string aaabbbccaaab is output and the decoding process ends.

[0056] In the above example, N CW = 3, the current codebook becomes T0 every time three codewords are obtained. Therefore, among the codewords obtained according to the encoding procedure of the first embodiment, codewords to be decoded using the basic codebook T0 periodically appear. In other words, by starting decoding from a codeword for which the codebook to be used for decoding is obvious, it becomes possible to start decoding even from the middle of an input codeword without decoding any previous codewords.

[0057] <<4: Summary>> As explained in <<1: Codebook and Switching Rules>>, encoding is performed by defining a codebook switching rule so that a codeword of a predetermined length can be decoded using a self-evident codebook (i.e., a starting codebook). This makes it possible to decode even from the middle of the codeword.

[0058] In order to enable decoding even from the middle of a codeword, a codebook switching rule may be defined so that a predetermined codebook is used after encoding using a termination codebook. However, from the viewpoint of compression efficiency, it is preferable that the codebook satisfies the following two conditions, as in the examples of the basic codebook in Figure 3 and the termination codebook in Figure 4:

[0059] (1) The number of basic codebooks and the number of termination codebooks are the same.

[0060] (2) There exists a termination codebook in which the prefix of the symbol string restricted by the basic codebook is similarly restricted.

[0061] For example, while basic codebook T0 has no restrictions on the prefixes of symbol strings included in the basic codebook (i.e., for all symbols a, b, and c, a symbol string beginning with the symbol is included), basic codebook T1 has a restriction that it does not include symbol strings beginning with the symbol a. This is because codebook T0 switches to codebook T1 only when the prefix of the current symbol string does not match symbol string aaa but does match symbol string aa, does not match symbol string ba but matches symbol string b, or does not match symbol string ca but matches symbol string c. This takes into account the fact that when encoding is performed using codebook T1, the prefix of the current symbol string never starts with a. Therefore, the termination codebook ~T1 corresponding to basic codebook T1 is a codebook that does not include symbol strings beginning with the symbol a, just like basic codebook T1, and switching from codebook T0 to codebook ~T1 occurs under the same conditions as switching from codebook T0 to codebook T1, thereby improving compression efficiency.

[0062] Therefore, if compression efficiency is not a consideration, a single codebook with no restrictions on the prefixes of the symbol strings included in the codebook may be used as the termination codebook, as in the codebook shown in Figure 1(B). In this case, the encoding procedure / decoding procedure is basically the same as that explained in <<2: Encoding Procedure / Decoding Procedure>>, but N = N CW If the value is -1, the termination codebook is always set as the current codebook.

[0063] 3 may be used as termination codebooks (i.e., the two termination codebooks ∼T0 and ∼T1 may be set as T0 and T1, respectively). In this case, the encoding procedure / decoding procedure is the same as that described in <<2: Encoding Procedure / Decoding Procedure>>.

[0064] In order to enable decoding even from the middle of a codeword, it is sufficient to determine a codebook switching rule so that decoding can be performed using a self-evident codebook (i.e., a starting codebook) for each predetermined length of the codeword. Therefore, although in <<1: Codebooks and Their Switching Rules>> the lengths of the codewords included in the basic codebook and the codewords included in the termination codebook are the same, it is also possible to simply ensure that the lengths of the codewords included in multiple termination codebooks are the same.

[0065] First Embodiment An encoding device 100 according to this embodiment receives as input a symbol string to be encoded (hereinafter referred to as an input symbol string) and outputs a codeword corresponding to the input symbol string (hereinafter referred to as an output codeword). A decoding device 200 according to this embodiment receives as input a codeword to be decoded (hereinafter referred to as an input codeword) and outputs a symbol string corresponding to the input codeword (hereinafter referred to as an output symbol string).

[0066] Here, a codeword is a string formed by lining up two codes {0, 1}. A symbol is an element of a set consisting of a finite number of elements, such as alphabets a, b, and c, which are elements of the alphabet set {a, b, c}, or text consisting of words. A symbol string is a string formed by lining up symbols, such as abbaa, which is a symbol string of length 5 for two symbols {a, b}.

[0067] As a symbol string, for example, the following sequence, which is converted into a numerical value with finite precision by quantization or the like, can be exemplified.

[0068] (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 (LSPs), immittance spectral pairs (ISPs), 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 symbol string is a series of finite-precision digital signals or digital data.

[0069] The multiple codebooks or analytic trees used by the encoding device 100 and the decoding device 200 in the encoding process and the decoding process are composed of two basic codebooks or basic analytic trees T0 and T1 and two termination codebooks or termination analytic trees ~T0 and ~T1.

[0070] The two basic codebooks or basic analytic trees T0 and T1 and the two terminating codebooks or analytic trees ~T0 and ~T1 have the following data structures:

[0071] (1) Two basic codebooks or basic analytic trees T0 and T1 are codebooks or analytic trees constructed in accordance with the technique of Non-Patent Document 1, and are composed of pairs of a symbol string and a codeword of a predetermined length.

[0072] (2) The two termination codebooks or termination analytic trees ∼T0 and ∼T1 are each composed of a pair of a symbol string and a codeword of a predetermined length.

[0073] Therefore, all the codewords contained in the two basic codebooks or basic analytic trees T0 and T1 have the same length, and all the codewords contained in the two termination codebooks or termination analytic trees ~T0 and ~T1 also have the same length.

[0074] As described above, the codebook in Fig. 3 is an example of basic codebooks T0 and T1, and the codebook in Fig. 4 is an example of termination codebooks ~T0 and ~T1. Also, the analytic tree in Fig. 2(A) is an example of basic analytic trees T0 and T1, and the analytic tree in Fig. 5 is an example of termination analytic trees ~T0 and ~T1.

[0075] <<Encoding Apparatus 100>> The encoding apparatus 100 will be described below with reference to Figs. 6 and 7. Fig. 6 is a block diagram showing the configuration of the encoding apparatus 100. Fig. 7 is a flowchart showing the operation of the encoding apparatus 100. As shown in Fig. 6, the encoding apparatus 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 apparatus 100. The recording unit 190 records, for example, two basic codebooks or basic analytic trees T0 and T1 and two termination codebooks or termination analytic trees ∼T0 and ∼T1.

[0076] The operation of encoding apparatus 100 will be described with reference to Fig. 7. Here, T0 is set as the starting codebook or starting parse tree.

[0077] In S110, encoding section 110 obtains codewords corresponding to the symbol strings that make up the input symbol string using two basic codebooks or basic analytic trees T0, T1 and two termination codebooks or termination analytic trees ∼T0, ∼T1, and outputs the codeword obtained by concatenating the obtained codewords as the output codeword.

[0078] N CW is a predetermined number representing the repetition unit of encoding, N is a counter for counting the number of times encoding is executed, and the starting codebook or starting analytic tree is the basic codebook or basic analytic tree used in the first encoding in the repetition unit. Encoding unit 110 performs an encoding process consisting of the following three processes.

[0079] (1) A process of initializing a counter N, setting the starting codebook or starting parse tree T0 as the current codebook or parse tree, and setting the input symbol string as the current symbol string. (2) Using the current codebook or parse tree, the current symbol string is compared with the symbol strings contained in the codebook or parse tree, and a codeword corresponding to the symbol string σ contained in the current codebook or parse tree that has the longest match with the prefix of the current symbol string is obtained, and the symbol string obtained by removing the prefix that matches the symbol string σ from the current symbol string is set as the current symbol string, and the counter N is incremented by 1. (α)N <N CWIf the value is -1, if the symbol string beginning with the symbol string σ (however, the symbol string is different from the symbol string σ) is not included in the set of symbol strings included in the current codebook or analytic tree, T0 is taken as the codebook or analytic tree to be used next, and if it is included in the set, T1 is taken as the codebook or analytic tree to be used next, and the codebook or analytic tree to be used next is taken as the current codebook or analytic tree, and (β)N=N CW If the value is -1, if the symbol string beginning with the symbol string σ (however, the symbol string is different from the symbol string σ) is not included in the set of symbol strings included in the current codebook or analytic tree, then ~T0 is taken as the codebook or analytic tree to be used next, and if it is included in the set, ~T1 is taken as the codebook or analytic tree to be used next, and the codebook or analytic tree to be used next is taken as the current codebook or analytic tree, and (γ)N=N CW (3) If the length of the current symbol string obtained by the process (2) is 0, the codeword obtained by concatenating all the codewords obtained by the process (2) is output as the output codeword, and the encoding process is terminated; otherwise, the process returns to the process (2). The processes (2) and (3) above are the processes of the encoding repetition unit, and the encoding unit 110 obtains and outputs the output codeword by repeatedly executing the encoding repetition unit consisting of the following three processes:

[0080] (α) N from the first time CW - In the first two encoding rounds, a codeword corresponding to the symbol string that constitutes the input symbol string is obtained using one of multiple basic codebooks or basic analytic trees, and one of the multiple basic codebooks or basic analytic trees is used as the codebook or analytic tree to be used next (β) N CW In the first encoding, a codeword corresponding to the symbol string constituting the input symbol string is obtained using one of multiple basic codebooks or basic analytic trees, and one of multiple terminal codebooks or terminal analytic trees is used as the codebook or analytic tree to be used next (γ)N CWIn the encoding step, a codeword corresponding to a symbol string constituting the input symbol string is obtained using one of a plurality of termination codebooks or termination analytic trees, and the starting codebook or starting analytic tree is used as the codebook or analytic tree to be used next. In other words, the encoding unit 110 repeats the process of obtaining a codeword corresponding to a symbol string constituting the input symbol string a predetermined number of times. CW Each time it is executed, the starting codebook or starting analytic tree is used as the codebook or analytic tree to be used next, and the encoding repetition unit is repeatedly executed to obtain an output codeword.

[0081] Furthermore, encoding section 110 obtains a codeword corresponding to the symbol string that constitutes the input symbol string using either a plurality of basic codebooks or basic analytic trees, or one or more termination codebooks or termination analytic trees, and obtains an output codeword by repeating the process of selecting either a plurality of basic codebooks or basic analytic trees, or one or more termination codebooks or termination analytic trees as the codebook or analytic tree to be used next; when a termination codebook or termination analytic tree is used, the codebook or analytic tree to be used next is a predetermined basic codebook or basic analytic tree (i.e., a starting codebook or starting analytic tree), and it can be said that the codebook or analytic tree to be used next becomes the starting codebook or starting analytic tree in a predetermined cycle.

[0082] <<Decoding Apparatus 200>> Hereinafter, decoding apparatus 200 will be described with reference to FIGS. 8 and 9. FIG. 8 is a block diagram showing the configuration of decoding apparatus 200. FIG. 9 is a flowchart showing the operation of decoding apparatus 200. As shown in FIG. 8, decoding apparatus 200 includes a decoding unit 210 and a recording unit 290. Recording unit 290 is a component that appropriately records information necessary for the processing of decoding apparatus 200. Recording unit 290 records, for example, two basic codebooks or basic analytic trees T0, T1 and two terminating codebooks or terminating analytic trees ∼T0, ∼T1 (where the basic codebooks or basic analytic trees T0, T1 and the terminating codebooks or terminating analytic trees ∼T0, ∼T1 are the same as the basic codebooks or basic analytic trees and the terminating codebooks or terminating analytic trees, respectively, used in the encoding process to obtain the input codeword).

[0083] The operation of the decoding device 200 will be described with reference to FIG.

[0084] In S210, decoding section 210 obtains symbol strings corresponding to the codewords that make up the input codeword using two basic codebooks or basic analytic trees T0, T1 and two termination codebooks or termination analytic trees ∼T0, ∼T1, and outputs the symbol string obtained by concatenating the obtained symbol strings as an output symbol string.

[0085] N CW is a predetermined number of times representing the repetition unit of decoding (where the predetermined number of times is equal to the predetermined number of times representing the repetition unit of encoding used in the encoding process to obtain the input codeword), N is a counter for counting the number of times decoding is performed, and the starting codebook or starting analytic tree is the basic codebook or basic analytic tree used in the first decoding in that repetition unit (where the basic codebook or basic analytic tree is the same as the starting codebook or starting analytic tree used in the encoding process to obtain the input codeword), and decoding unit 210 performs a decoding process consisting of the following three processes.

[0086] (1) A process of initializing the counter N, setting the starting codebook or starting parse tree T0 as the current codebook or parse tree, and setting the input codeword as the current codeword. (2) Using the current codebook or parse tree, the current codeword is compared with the codeword contained in the codebook or parse tree, and a symbol string corresponding to the codeword w contained in the current codebook or parse tree that matches the prefix of the current codeword is obtained. The codeword obtained by removing the prefix that matches the codeword w from the current codeword is set as the current codeword, and the counter N is incremented by 1. (α)N <N CW If the value is -1, if the symbol string beginning with the symbol string corresponding to codeword w (however, this symbol string is different from the symbol string corresponding to codeword w) is not included in the set of symbol strings included in the current codebook, T0 is selected as the codebook to be used next, and if it is included in the set, T1 is selected as the codebook to be used next, and the codebook to be used next is set as the current codebook, and (β)N=N CWIf the value is -1, if the symbol string beginning with the symbol string corresponding to the codeword w (however, the symbol string is different from the symbol string corresponding to the codeword w) is not included in the set of symbol strings included in the current codebook, then ~T0 is taken as the codebook to be used next, and if it is included in the set, ~T1 is taken as the codebook to be used next, and the codebook to be used next is taken as the current codebook, and (γ)N=N CW (3) If the length of the current codeword obtained by the process (2) is 0, output the symbol string obtained by concatenating all the symbol strings obtained by the process (2) as the output symbol string and terminate the decoding process, while otherwise returning to the process (2). The processes (2) and (3) above are processes of a decoding iteration unit, and the decoding unit 210 obtains and outputs an output symbol string by repeatedly executing a decoding iteration unit consisting of the following three processes:

[0087] (α) N from the first time CW - In the first two decoding iterations, a process of obtaining a symbol string corresponding to a codeword that constitutes an input codeword using one of multiple basic codebooks or basic analytic trees, and using one of multiple basic codebooks or basic analytic trees as the codebook or analytic tree to be used next (β) N CW In the first decoding, a symbol string corresponding to the codeword constituting the input codeword is obtained using one of multiple basic codebooks or basic analytic trees, and one of multiple terminal codebooks or terminal analytic trees is used as the codebook or analytic tree to be used next (γ)N CW In the decoding, a symbol string corresponding to a codeword constituting an input codeword is obtained using one of a plurality of termination codebooks or termination analytic trees, and the starting codebook or starting analytic tree is used as the codebook or analytic tree to be used next. In other words, the decoding unit 210 repeats the process of obtaining a symbol string corresponding to a codeword constituting an input codeword a predetermined number of times. CW Each time it is executed, the starting codebook or starting parse tree is used as the codebook or parse tree to be used next, and the decoding repeat unit is repeatedly executed to obtain an output symbol string.

[0088] Furthermore, decoding section 210 obtains a symbol string corresponding to the codeword that constitutes the input codeword using either a plurality of basic codebooks or basic analytic trees, or one or more termination codebooks or termination analytic trees, and obtains an output symbol string by repeating the process of selecting either a plurality of basic codebooks or basic analytic trees, or one or more termination codebooks or termination analytic trees as the codebook or analytic tree to be used next; when a termination codebook or termination analytic tree is used, the codebook or analytic tree to be used next is a predetermined basic codebook or basic analytic tree (i.e., a starting codebook or starting analytic tree), and it can be said that the codebook or analytic tree to be used next becomes the starting codebook or starting analytic tree in a predetermined cycle.

[0089] According to an embodiment of the present invention, it is possible to realize a code that uses multiple codebooks or parse trees and that can decode a codeword from the middle of its length. More specifically, by performing encoding under a codebook switching rule that allows decoding using a self-evident codebook for each predetermined length of the codeword, it is possible to decode the codeword from the middle of its length.

[0090] <Technical Background> In the encoding / decoding in the first embodiment, a codebook based on the technology of Non-Patent Document 1, which can express a coding rule that satisfies the unique codability condition, is used as a basic codebook. Here, an embodiment different from the first embodiment will be described, in which a plurality of codebooks that can express a coding rule that satisfies the unique codability condition are used as basic codebooks. Note that an analytic tree may be used instead of a codebook, and this does not result in any difference in the encoding procedure / decoding procedure.

[0091] <<1: Basic Codebook>> Here, a codebook used as a basic codebook in the second embodiment will be described.

[0092] First, we will explain the symbol string mode, which is a concept necessary for explaining the codebook used as the basic codebook in the second embodiment. A set of symbol strings for a codebook is defined as a symbol string mode. A symbol string mode is assigned to each of the multiple codebooks used for encoding / decoding. Since the symbol string mode assigned to a codebook is defined as a set of symbol strings, it is assumed that there is no duplication of symbol strings included in the symbol string mode. It is preferable that the symbol string mode satisfy a prefix condition. Here, the prefix condition is a condition that, for any symbol string included in a set whose elements are symbol strings, the symbol string does not become the prefix of any other symbol string included in the set.

[0093] In the second embodiment, the codebook used as the basic codebook is composed of a triplet consisting of an input symbol string, an output codeword of a predetermined length, and the next codebook to be used (hereinafter referred to as a link destination). FIG. 10 shows an example of a codebook. The codebook in FIG. 10 is used to encode a symbol string of {a, b, c} into a codeword of {0, 1}, and consists of five codebooks: T0, T1, T2, T3, and T4. Note that the length of the output codeword in each of the codebooks T0, T1, T2, T3, and T4 is two. For example, the symbol string mode {ε} is assigned to codebook T0, and the symbol string mode {a, b} is assigned to codebook T1. Furthermore, codebook T0 outputs codeword 00 for symbol string a, and the next codebook to be used is T1. Similarly, codebook T0 outputs codeword 01 for symbol string ε, and the next codebook to be used is T2.

[0094] Next, the conditions required for a codebook so that encoding / decoding in the second embodiment satisfies the unique codability condition will be described. To this end, the concept of an expansion symbol string will be defined. A symbol string is an expansion symbol string of a codebook when it is obtained by concatenating a symbol string included in the codebook with a symbol string that is an element of a symbol string mode assigned to the next codebook to be used and that corresponds to the symbol string. Here, a symbol string included in a codebook refers to a symbol string that is an element of a triplet that constitutes the codebook. For example, the expanded symbol strings of codebook T2 in FIG. 10 are the symbol string aca obtained by concatenating the symbol string aca with the symbol string ε, which is an element of the symbol string mode {ε} assigned to the codebook T0 to be used next and corresponds to the symbol string aca; the symbol string baa obtained by concatenating the symbol string baa with the symbol string ε, which is an element of the symbol string mode {ε} assigned to the codebook T0 to be used next and corresponds to the symbol string baa; the symbol strings acb and acc obtained by concatenating the symbol string ac with the symbol strings b and c, which are elements of the symbol string mode {b, c} assigned to the codebook T3 to be used next and corresponds to the symbol string ac; and the symbol strings bab and bac obtained by concatenating the symbol string ba with the symbol strings b and c, which are elements of the symbol string mode {b, c} assigned to the codebook T3 to be used next and corresponds to the symbol string ba.

[0095] The following two conditions are required for the codebook in order for encoding / decoding to satisfy the unique codability condition.

[0096] (1) For any codebook included in a plurality of codebooks, a set consisting of all expansion symbol strings of the codebook satisfies the prefix condition.

[0097] (2) For any codebook included in a plurality of codebooks, the expanded symbol string of the codebook starts with any symbol string included in the symbol string mode assigned to the codebook.

[0098] Even if the multiple codebooks used for encoding / decoding do not satisfy the unique codability condition, a codeword encoded using the multiple codebooks can be decoded into a unique symbol string. However, from the viewpoint of compression efficiency, it is preferable that the multiple codebooks used for encoding / decoding satisfy the unique codability condition.

[0099] As mentioned above, the coding rules can also be expressed using an analytic tree. Figure 11 is a diagram showing an example of an analytic tree, and the analytic tree in Figure 11 is equivalent to the codebook in Figure 10. The above explanation of the codebook also applies to analytic trees, simply by replacing the word "codebook" with "analytic tree." By replacing the word "codebook," the following explanation of the analytic tree can be obtained.

[0100] A set of symbol strings for a parse tree is defined as a symbol string mode. A symbol string mode is assigned to each of the multiple parse trees used for encoding / decoding.

[0101] The analytic tree is composed of a triplet of an input symbol string, an output codeword of a predetermined length, and the next analytic tree to be used (hereinafter referred to as a link destination).

[0102] A symbol string is an expansion symbol string of an analytic tree if it is obtained by concatenating a symbol string included in the analytic tree with a symbol string that is an element of the symbol string mode assigned to the corresponding analytic tree to be used next. Here, the symbol string included in the analytic tree refers to a symbol string that is an element of a triplet that constitutes the analytic tree.

[0103] The following two conditions are required for the parse tree in order for encoding / decoding to satisfy the unique codability condition.

[0104] (1) For any analytic tree included in a plurality of analytic trees, the set consisting of all the expansion symbol strings of the analytic tree satisfies the prefix condition.

[0105] (2) For any analytic tree included in a plurality of analytic trees, the expanded symbol string of the analytic tree starts with any symbol string included in the symbol string mode assigned to the analytic tree.

[0106] <<2: Codebooks and Switching Rules Thereof>> As in the first embodiment, the codebooks in the second embodiment include two types of codebooks: multiple codebooks (hereinafter referred to as base codebooks) that satisfy the unique coding possibility condition, and multiple codebooks (hereinafter referred to as termination codebooks) that have roles different from those of the multiple codebooks. Both the base codebooks and the termination codebooks are composed of triplet pairs: an input symbol string, an output codeword of a predetermined length (hereinafter referred to as L), and the next codebook to be used (hereinafter referred to as link destination). The number of base codebooks and the number of termination codebooks are the same and correspond one-to-one. A symbol string mode is assigned to each of the base codebooks and the termination codebooks, and the symbol string mode assigned to the termination codebook is the same as the symbol string mode assigned to the corresponding base codebook. Furthermore, the link destinations included in the termination codebooks are the same base codebook. The link destinations correspond to the starting codebook described in the first embodiment.

[0107] From the viewpoint of compression efficiency, in addition to the above-mentioned two conditions that the number of basic codebooks is the same as the number of termination codebooks and that the symbol string modes assigned to the termination codebooks are the same as the symbol string modes assigned to the corresponding basic codebooks, it is preferable to satisfy the following condition.

[0108] (1) The termination codebook satisfies condition (2) of the two conditions required of the basic codebook in order for encoding / decoding to satisfy the unique codability condition.

[0109] Figures 10 and 12 are diagrams showing examples of codebooks. Figures 11 and 13 are diagrams showing examples of analytic trees. The codebook in Figure 10 is the basic codebook described above and is equivalent to the analytic tree in Figure 11. The codebook in Figure 12 is a termination codebook used together with the basic codebook in Figure 10 and is equivalent to the analytic tree in Figure 13. The basic codebook in Figure 10 and the termination codebook in Figure 12 are used to encode a symbol string that is a string of symbols {a, b, c} into a codeword that is a string of codes {0, 1}, and consist of five basic codebooks T0, T1, T2, T3, and T4 and five termination codebooks ~T0, ~T1, ~T2, ~T3, and ~T4. Note that the length L of the codeword output in the codebooks T0, T1, T2, T3, T4, ~T0, ~T1 ~T2, ~T3, and ~T4 is 2.

[0110] Next, a codebook switching rule when encoding / decoding is performed in the second embodiment will be described. In the encoding / decoding in the second embodiment, a predetermined number of times (hereinafter, N CW Each time encoding / decoding is performed a predetermined number of times (N), the codebook is switched so that encoding / decoding is performed using the start codebook that is a link destination included in the termination codebook. CW Each time the encoding / decoding process is repeated, the codebook to be used next returns to the codebook that was used when the encoding / decoding process started. Therefore, the codebook triplet of the codewords, which is a predetermined length L and a predetermined number of times N, CW The product of LN CW Therefore, it is possible to decode each codeword of length .times. ...

[0111] As mentioned above, the coding rules can also be expressed using parse trees. Therefore, the above explanation of the codebook also applies to parse trees, simply by replacing the word "codebook" with "parse tree." For example, base parse trees, termination parse trees, and start parse trees can also be defined in the same way.

[0112] Furthermore, as can be seen from the examples of FIGS. 3 and 4 in the first embodiment and the examples of FIGS. 10 and 12 in the second embodiment, the second embodiment uses more codebooks than the first embodiment, and by using more codebooks in the second embodiment, compression efficiency can be improved.

[0113] In order to enable decoding even from the middle of a codeword, it is only necessary to determine a codebook switching rule so that decoding can be performed using a clear codebook (i.e., a starting codebook) for each predetermined length of the codeword. Therefore, although the above explanation has been given assuming that the lengths of the codewords included in the basic codebook and the codewords included in the termination codebook are the same, it is also possible to simply make the lengths of the codewords included in multiple termination codebooks the same.

[0114] <<3: Encoding Procedure / Decoding Procedure>> The encoding procedure in the second embodiment uses a symbol string to be coded (hereinafter referred to as an input symbol string) as input, and k} k=0 K-1 (where K is an integer greater than or equal to 2) and multiple termination codebooks {~T k} k=0 K-1 The decoding procedure in the second embodiment uses a codeword to be decoded (hereinafter referred to as an input codeword) as an input, and performs decoding using a plurality of basic codebooks {T k} k=0 K-1 and multiple termination codebooks {~T k} k=0 K-1 (However, the basic codebook {T k} k=0 K-1 and the termination codebook {~T k} k=0 K-1 is the codebook used in the encoding procedure) to obtain symbol strings corresponding to the code words that make up the input code word, and then output a symbol string (hereinafter referred to as the output symbol string) obtained by concatenating all the obtained symbol strings.

[0115] The same termination codebook {~T k} k=0 K-1 Note that the starting codebook is shared between the encoding procedure and the decoding procedure because the starting codebook is used. CW Note that the sigma sigma is also shared between the encoding and decoding procedures.

[0116] (Encoding Procedure) The current symbol string is the symbol string currently being encoded, and the current codebook is the codebook currently being used for encoding. Therefore, the current symbol string and the current codebook at the start of encoding are the input symbol string and the starting codebook, respectively.

[0117] The encoding procedure in the second embodiment consists of the following three processes.

[0118] (1) Initialize a counter N for counting the number of times encoding is executed. That is, set N=0. Also, set the starting codebook as the current codebook. Set the input symbol string as the current symbol string.

[0119] (2) Using the current codebook, the current symbol string is compared with the symbol string contained in the codebook. If there is a symbol string σ contained in the current codebook that matches the prefix of the current symbol string, and if there is a symbol string contained in the symbol string mode assigned to the next codebook to be used that matches the prefix of the symbol string obtained by excluding the prefix that matches the symbol string σ from the current symbol string, the codeword corresponding to the symbol string σ is obtained, and the symbol string obtained by excluding the prefix that matches the symbol string σ from the current symbol string is set as the current symbol string. In addition, the counter N is incremented by 1. That is, N=N+1. Furthermore, the current codebook is obtained according to the following case distinction:

[0120] (α)N <N CW If the value is -1, the next codebook to be used corresponding to the symbol string σ is set as the current codebook.

[0121] (β)N=N CW If the value is -1, the next codebook to be used corresponding to the symbol string σ is obtained, and the termination codebook corresponding to the next codebook to be used, that is, the basic codebook, is set as the current codebook.

[0122] (γ)N=N CW If , the starting codebook is set as the current codebook, and the counter N is initialized.

[0123] (3) If the length of the current symbol string obtained by process (2) is 0, the code word obtained by concatenating all the code words obtained by process (2) is output as the output code word, and the encoding process ends; otherwise, return to process (2).

[0124] (Decoding Procedure) The current codeword is the codeword currently being decoded, and the current codebook is the codebook currently being used for the decoding. Therefore, the current codeword and current codebook at the start of decoding are the input codeword and the starting codebook, respectively.

[0125] The decoding procedure in the second embodiment comprises the following three steps.

[0126] (1) Initialize a counter N for counting the number of decoding executions. That is, set N=0. Also, set the starting codebook as the current codebook. Set the input codeword as the current codeword.

[0127] (2) Using the current codebook, the current codeword is compared with the codewords contained in the codebook. A symbol string corresponding to the codeword w contained in the current codebook that matches the prefix of the current codeword is obtained, and the codeword obtained by removing the prefix that matches the codeword w from the current codeword is set as the current codeword. Also, the counter N is incremented by 1. That is, N = N + 1. Furthermore, the current codebook is obtained according to the following case distinction:

[0128] (α)N <N CW If it is -1, the next codebook to be used corresponding to codeword w is set as the current codebook.

[0129] (β)N=N CW If the value is -1, the next codebook to be used corresponding to the codeword w is obtained, and the termination codebook corresponding to the next codebook to be used, that is, the basic codebook, is set as the current codebook.

[0130] (γ)N=N CWIf , the starting codebook is set as the current codebook, and the counter N is initialized.

[0131] (3) If the length of the current codeword obtained by process (2) is 0, the symbol string obtained by concatenating all symbol strings obtained by process (2) is output as the output symbol string, and the decoding process ends; otherwise, return to process (2).

[0132] The encoding procedure / decoding procedure using the codebook can also be changed to an encoding procedure / decoding procedure using an analytic tree by simply replacing the word "codebook" with "analytic tree."

[0133] Second Embodiment An encoding device 100 according to this embodiment receives as input a symbol string to be encoded (hereinafter referred to as an input symbol string) and outputs a codeword corresponding to the input symbol string (hereinafter referred to as an output codeword). A decoding device 200 according to this embodiment receives as input a codeword to be decoded (hereinafter referred to as an input codeword) and outputs a symbol string corresponding to the input codeword (hereinafter referred to as an output symbol string).

[0134] The multiple codebooks or analytic trees used by the encoding device 100 and the decoding device 200 in the encoding process and the decoding process are multiple basic codebooks or basic analytic trees {T k} k=0 K-1 (where K is an integer equal to or greater than 2) and multiple termination codebooks or termination parse trees {~T k} k=0 K-1 It consists of:

[0135] Multiple basic codebooks or basic parse trees {T k} k=0 K-1 is a data structure with the following characteristics:

[0136] (1) Basic codebook or basic parse tree T k (k=0, 1, ..., K-1) consists of a triplet of a symbol string, a codeword of a predetermined length, and a codebook or parse tree to be used next, and is assigned a symbol string mode, which is a set of symbol strings. Therefore, the basic codebook or basic parse tree T kAll code words in (k=0, 1,..., K-1) have the same length.

[0137] (2) Basic codebook or basic parse tree T k The set of all expanded symbol sequences (k=0, 1,…, K-1) satisfies the prefix condition, and the basic codebook or basic parse tree T k The expansion symbol sequence of (k=0, 1, ..., K-1) is the basic codebook or basic parse tree T k The condition is met that the prefix of a word is one of the symbol strings included in the symbol string mode assigned to the word.

[0138] As mentioned above, multiple basic codebooks or basic parse trees {T k} k=0 K-1 satisfies the conditions (1) and (2), multiple basic codebooks or basic parse trees {T k} k=0 K-1 satisfies the unique codability condition. However, if there are multiple basic codebooks or basic parse trees {T k} k=0 K-1 is sufficient as a code if it satisfies condition (2).

[0139] In addition, multiple termination codebooks or termination parse trees {~T k} k=0 K-1 is a data structure with the following characteristics:

[0140] (1) Termination codebook or termination analytic tree ~T k (k=0, 1, ..., K-1) consists of a triplet of a symbol string, a codeword of a predetermined length, and a codebook or parse tree to be used next, and is assigned a symbol string mode, which is a set of symbol strings. Therefore, the terminal codebook or terminal parse tree ~T k All code words in (k=0, 1,..., K-1) have the same length.

[0141] (2) Termination codebook or termination analytic tree ~T k The symbol string modes assigned to (k=0, 1,…, K-1) are represented by the corresponding basic codebook or basic parse tree T kis the same as the string mode assigned to

[0142] (3) Termination codebook or termination analytic tree ~T k The next codebooks or analytic trees included in (k=0, 1, . . . , K-1) to be used are all the same basic codebooks or basic analytic trees.

[0143] (4) Termination codebook or termination analytic tree ~T k The expansion symbol string (k=0, 1, ..., K-1) is the codebook for the terminal or the analytic tree for the terminal ~T k The condition is met that the prefix of a word is one of the symbol strings included in the symbol string mode assigned to the word.

[0144] As described above, condition (4) is required from the viewpoint of compression efficiency, and does not necessarily have to be satisfied.

[0145] As described above, the termination codebook or termination analytic tree ∼T k The next codebook or parse tree to be used, included in (k=0, 1, . . . , K-1), is the starting codebook or starting parse tree.

[0146] <<Encoding Apparatus 100>> The encoding apparatus 100 will be described below with reference to Figs. 6 and 7. Fig. 6 is a block diagram showing the configuration of the encoding apparatus 100. Fig. 7 is a flowchart showing the operation of the encoding apparatus 100. As shown in Fig. 6, the encoding apparatus 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 apparatus 100. The recording unit 190 stores, for example, a plurality of basic codebooks or basic analytic trees {T k} k=0 K-1 and multiple terminating codebooks or terminating parse trees {~T k} k=0 K-1 Keep a record of the following.

[0147] The operation of the encoding device 100 will be described with reference to FIG.

[0148] In S110, the encoding unit 110 generates a plurality of basic codebooks or basic parse trees {T k} k=0 K-1and multiple terminating codebooks or terminating parse trees {~T k} k=0 K-1 The codeword corresponding to the symbol string that constitutes the input symbol string is obtained using the above, and the codeword obtained by concatenating the codewords is output as the output codeword.

[0149] N CW is a predetermined number representing the repetition unit of encoding, N is a counter for counting the number of times encoding is executed, and the starting codebook or starting analytic tree is the basic codebook or basic analytic tree used in the first encoding in the repetition unit. Encoding unit 110 performs an encoding process consisting of the following three processes.

[0150] (1) A process of initializing a counter N, setting the starting codebook or starting parse tree as the current codebook or parse tree, and setting the input symbol string as the current symbol string. (2) Using the current codebook or parse tree, the current symbol string is compared with the symbol strings contained in the codebook or parse tree. If there is a symbol string σ contained in the current codebook or parse tree that matches the prefix of the current symbol string, and if there is a symbol string contained in the symbol string mode assigned to the codebook or parse tree to be used next that matches the prefix of the symbol string obtained by excluding the prefix that matches the symbol string σ from the current symbol string, obtain a codeword corresponding to the symbol string σ, set the symbol string obtained by excluding the prefix that matches the symbol string σ from the current symbol string as the current symbol string, and increment the counter N by 1. (α)N <N CW If it is -1, the next codebook or parse tree corresponding to the symbol string σ is set as the current codebook or parse tree, and (β)N=N CW If the value is -1, the next codebook or parse tree T corresponding to the symbol string σ is used. k and obtain the codebook or parse tree T k The corresponding termination codebook or termination parse tree ~T k Let be the current codebook or parse tree, and (γ)N=N CW(3) If the length of the current symbol string obtained by the process (2) is 0, the codeword obtained by concatenating all the codewords obtained by the process (2) is output as the output codeword, and the encoding process is terminated; otherwise, the process returns to the process (2). In the process of the encoding unit 110, the processes (2) and (3) above are the processes for the repetition unit of encoding, as in the encoding unit 110 of the first embodiment.

[0151] <<Decoding Apparatus 200>> The decoding apparatus 200 will be described below with reference to Figs. 8 and 9. Fig. 8 is a block diagram showing the configuration of the decoding apparatus 200. Fig. 9 is a flowchart showing the operation of the decoding apparatus 200. As shown in Fig. 8, the decoding apparatus 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 apparatus 200. The recording unit 290 stores, for example, a plurality of basic codebooks or basic analytic trees {T k} k=0 K-1 and multiple terminating codebooks or terminating parse trees {~T k} k=0 K-1 (However, the basic codebook {T k} k=0 K-1 , terminating codebook {~T k} k=0 K-1 are the same as the basic codebook or basic analytic tree, and the terminating codebook or analytic tree used in the encoding process to obtain the input codeword, respectively).

[0152] The operation of the decoding device 200 will be described with reference to FIG.

[0153] In S210, the decoding unit 210 generates a plurality of basic codebooks or basic parse trees {T k} k=0 K-1 and multiple terminating codebooks or terminating parse trees {~T k} k=0 K-1The symbol strings corresponding to the code words that make up the input code word are obtained using the above, and the symbol strings obtained by concatenating the obtained symbol strings are output as the output symbol string.

[0154] N CW is a predetermined number of times representing a decoding repetition unit (where the predetermined number of times is equal to the predetermined number of times representing the encoding repetition unit used in the encoding process to obtain the input codeword), N is a counter for counting the number of times decoding is performed, and the starting codebook or starting analytic tree is the basic codebook or basic analytic tree used in the first decoding in the repetition unit. Decoding unit 210 performs a decoding process consisting of the following three processes.

[0155] (1) A process of initializing a counter N, setting the starting codebook or starting parse tree as the current codebook or parse tree, and setting the input codeword as the current codeword. (2) Using the current codebook or parse tree, a comparison is made between the current codeword and the codewords contained in the codebook or parse tree, obtaining a symbol string corresponding to a codeword w contained in the current codebook or parse tree that matches the prefix of the current codeword, and setting the codeword obtained by removing the prefix that matches the codeword w from the current codeword as the current codeword, and incrementing the counter N by 1. (α)N <N CW If it is -1, the next codebook or parse tree corresponding to the codeword w to be used is set as the current codebook or parse tree, and (β)N=N CW If the value is -1, the next codebook or parse tree T corresponding to the codeword w is used. k and obtain the codebook or parse tree T k The terminal codebook or terminal analytic tree ~T corresponding to the current codebook or analytic tree is set as the current codebook or analytic tree, and (γ)N=N CW (3) If the length of the current codeword obtained by the process (2) is 0, the process outputs the symbol string obtained by concatenating all the symbol strings obtained by the process (2) as the output symbol string and terminates the decoding process, while otherwise returning to the process (2). In the process of the decoding unit 210, the processes (2) and (3) above are the processes of the decoding repetition unit, as in the decoding unit 210 of the first embodiment.

[0156] According to an embodiment of the present invention, it is possible to realize a code that uses multiple codebooks or parse trees and that can decode a codeword from the middle of its length. More specifically, by performing encoding under a codebook switching rule that allows decoding using a self-evident codebook for each predetermined length of the codeword, it is possible to decode the codeword from the middle of its length.

[0157] <Technical Background> The encoding / decoding in the third embodiment uses multiple codebooks that can express encoding rules that satisfy the condition that they can be uniquely decoded (hereinafter referred to as the unique decodability condition), and multiple codebooks that have roles different from those of the multiple codebooks. Note that code trees may be used instead of codebooks, and this does not result in any difference in the encoding procedure / decoding procedure.

[0158] <<1: Codebooks and Switching Rules There are two types of codebooks in the third embodiment: a plurality of codebooks (hereinafter referred to as base codebooks) that satisfy the unique decodability condition, and a plurality of codebooks (hereinafter referred to as terminating codebooks) that have roles different from those of the plurality of codebooks. Both the base codebook and the terminating codebook are composed of pairs of an input symbol string and an output codeword. The symbol strings included in the base codebook have a fixed length of 1 or more, and the codewords included in the base codebook have a variable length. A plurality of terminating codebooks correspond to one basic codebook. The terminating codebook corresponding to the base codebook contains fixed-length codewords, and the lengths of these codewords differ among the plurality of terminating codebooks. {T k} k=0 K-1 (where K is an integer greater than or equal to 2) are multiple basic codebooks, the basic codebook T k The multiple termination codebooks corresponding to k (L) (L represents the length of the codeword contained in the termination codebook, L = L min , …, L max (L min , L max is L min <L maxThe codewords included in the termination codebook are configured to have any codeword included in the base codebook corresponding to the termination codebook as a prefix, or to be the prefix of any codeword included in the base codebook corresponding to the termination codebook.

[0159] Figures 14 and 15 are diagrams showing examples of codebooks. The codebook in Figure 14 is a base codebook, and the codebook in Figure 15 is a termination codebook used together with the base codebook in Figure 14. The base codebook in Figure 14 and the termination codebook in Figure 15 are used to encode a symbol string that is a string of symbols {a, b, c, d} into a codeword that is a string of codes {0, 1}, and consist of two base codebooks, T0 and T1, and six termination codebooks, ~T0(1), ~T0(2), ~T0(3), ~T1(1), ~T1(2), and ~T1(3). As can be seen from Figure 15, the lengths of the codewords included in the base codebooks T0 and T1 are not constant. On the other hand, the length of the codewords contained in the termination codebooks ~T0(1) and ~T1(1) is 1, the length of the codewords contained in the termination codebooks ~T0(2) and ~T1(2) is 2, and the length of the codewords contained in the termination codebooks ~T0(3) and ~T1(3) is 3, and the length of the codewords contained in each termination codebook is constant. min =1, L max =3.

[0160] 14 and 15, the codewords included in the termination codebook ~T1(1) are prefixes of any codeword included in the corresponding basic codebook T1, the codewords included in the termination codebook ~T1(2) are prefixed with any codeword included in the corresponding basic codebook T1, and the codewords included in the termination codebook ~T1(3) are prefixed with any codeword included in the corresponding basic codebook T1. Note that the codewords included in the termination codebook ~T1(2) and the termination codebook ~T1(3) cannot be prefixed with the codeword 00.

[0161] In the example of the basic codebook in FIG. 14 , the symbol strings are symbol strings of length 1, such as a, b, and c. However, as described above, it is sufficient that the lengths of the symbol strings included in the basic codebook are constant. For example, the basic codebook may include symbol strings of length 2, such as aa, ab, ac, ba, bb, bc, ca, cb, and cc.

[0162] Next, a codebook switching rule when encoding / decoding is performed in the third embodiment will be described. In the encoding / decoding in the third embodiment, encoding / decoding is repeatedly performed to generate a codeword of a predetermined length (hereinafter, B CW The codebook is switched so that encoding / decoding is performed using a predetermined base codebook (hereinafter referred to as a start codebook) every time a predetermined codeword length B CW Each time a length B is obtained / decoded, the codebook to be used next returns to the codebook that was used when the encoding / decoding process started. CW It is then possible to decode each codeword using the starting codebook.

[0163] Here, the given codeword length B CW The value of can be determined arbitrarily. Therefore, the encoding / decoding using a codebook in the third embodiment is an encoding that outputs codewords of an arbitrary fixed codeword length using a codebook including variable-length codewords, without significantly reducing compression efficiency.

[0164] As mentioned above, the coding rule can also be expressed using a code tree. Therefore, the above explanation of the codebook also applies to the code tree by simply replacing the word "codebook" with "code tree." For example, a base code tree, a termination code tree, and a start code tree can also be defined in the same way.

[0165] <<2: Encoding Procedure / Decoding Procedure>> The encoding procedure in the third embodiment takes as input a symbol string to be encoded (hereinafter referred to as an input symbol string), obtains codewords corresponding to symbol strings constituting the input symbol string using two basic codebooks T0, T1 and six termination codebooks ∼T0(1), ∼T0(2), ∼T0(3), ∼T1(1), ∼T1(2), ∼T1(3), and outputs a codeword obtained by concatenating all the obtained codewords (hereinafter referred to as an output codeword). Furthermore, the decoding procedure in the third embodiment takes as input a codeword to be decoded (hereinafter referred to as the input codeword), obtains symbol strings corresponding to the codewords that make up the input codeword using two basic codebooks T0, T1 and six termination codebooks ~T0(1), ~T0(2), ~T0(3), ~T1(1), ~T1(2), ~T1(3) (where the basic codebooks T0, T1 and the termination codebooks ~T0(1), ~T0(2), ~T0(3), ~T1(1), ~T1(2), ~T1(3) are codebooks used in the encoding procedure), and outputs a symbol string (hereinafter referred to as the output symbol string) obtained by concatenating all of the obtained symbol strings.

[0166] The encoding procedure / decoding procedure will be explained below using the basic codebook in FIG. 14 and the termination codebook in FIG. 15 as examples. The starting codebook is shared between the encoding procedure and the decoding procedure, and here the starting codebook is the basic codebook T0. Also, for a given codeword length B CW is also shared between the encoding and decoding procedures.

[0167] (Encoding Procedure) The current symbol string is the symbol string currently being encoded, and the current codebook is the codebook currently being used for encoding. Therefore, the current symbol string and the current codebook at the start of encoding are the input symbol string and the starting codebook, respectively.

[0168] The encoding procedure in the third embodiment comprises the following three processes.

[0169] (1) Initialize counter B, which counts the length of the codeword obtained by encoding. In other words, set B=0. Also, set T0, which is the starting codebook, as the current codebook. Set the input symbol string as the current symbol string.

[0170] (2) Using the current codebook, the current symbol string is compared with the symbol string contained in the codebook. The codeword corresponding to the symbol string σ contained in the current codebook that has the longest match with the prefix of the current symbol string is obtained, and the symbol string obtained by excluding the symbol string that matches the symbol string σ from the current symbol string is set as the current symbol string. In addition, the counter B is incremented by the length of the codeword corresponding to the symbol string σ. In other words, B = B + (the length of the codeword corresponding to the symbol string σ). Furthermore, the current codebook is obtained according to the following case distinction:

[0171] (α)B CW -L max If the codeword beginning with the codeword corresponding to the symbol string σ (however, this codeword is different from the codeword corresponding to the symbol string σ) is not included in the set of codewords included in the current codebook, T0 is obtained as the codebook to be used next, and if it is included in the set, T1 is obtained as the codebook to be used next, and this codebook to be used next becomes the current codebook.

[0172] (β) B CW >B≧B CW -L max If the codeword beginning with the codeword corresponding to the symbol string σ (however, this codeword is different from the codeword corresponding to the symbol string σ) is not included in the set of codewords included in the current codebook, T0 is selected as the codebook to be used next. If this codeword is included in the set, T1 is selected as the codebook to be used next, and the basic codebook T k (k represents either 0 or 1) k (B CW -B) is the current codebook.

[0173] (γ)B=B CW If T0 is the starting codebook, T0 is set as the current codebook. Also, counter B is initialized.

[0174] (3) If the length of the current symbol string obtained by process (2) is 0, the code word obtained by concatenating all the code words obtained by process (2) is output as the output code word, and the encoding process ends; otherwise, return to process (2).

[0175] ​In the case of (β), the codebook actually used in the next encoding process is the basic codebook T k Instead, the termination codebook ~T k (B CW -B), and finally the termination codebook ~T k (B CW -B) is the next codebook to be used.

[0176] (Decoding Procedure) The current codeword is the codeword currently being decoded, and the current codebook is the codebook currently being used for the decoding. Therefore, the current codeword and current codebook at the start of decoding are the input codeword and the starting codebook, respectively.

[0177] The decoding procedure in the third embodiment comprises the following three processes.

[0178] (1) Initialize counter B for counting the length of the decoded codeword. That is, set B=0. Also, set T0, which is the starting codebook, as the current codebook. Set the input codeword as the current codeword.

[0179] (2) Using the current codebook, the current codeword is compared with the codewords contained in the codebook. The codeword w contained in the current codebook that matches the prefix of the current codeword longest is found (where the codeword w is a codeword of a predetermined length B, where the value obtained by incrementing the counter B by the length of the codeword w is a codeword of a predetermined length B). CW The codeword obtained by removing the prefix that matches the codeword w from the current codeword is set as the current codeword. Also, the counter B is incremented by the length of the codeword w. In other words, B = B + (length of codeword w). Then, the current codebook is obtained according to the following case distinction:

[0180] (α)B CW -L max If the codeword beginning with codeword w (however, this codeword is different from codeword w) is not included in the set of codewords included in the current codebook, T0 is taken as the codebook to be used next, and if it is included in the set, T1 is taken as the codebook to be used next, and this codebook to be used next becomes the current codebook.

[0181] ​(β) B CW >B≧B CW -L max If the codeword beginning with codeword w (however, the codeword is different from codeword w) is not included in the set of codewords included in the current codebook, T0 is selected as the codebook to be used next. If the codeword is included in the set, T1 is selected as the codebook to be used next. k (k represents either 0 or 1) k (B CW -B) is the current codebook.

[0182] (γ)B=B CW If T0 is the starting codebook, T0 is set as the current codebook. Also, counter B is initialized.

[0183] (3) If the length of the current codeword obtained by process (2) is 0, the symbol string obtained by concatenating all symbol strings obtained by process (2) is output as the output symbol string, and the decoding process ends; otherwise, return to process (2).

[0184] In the case of (β), the codebook actually used in the next decoding process is the basic codebook T k Instead, the termination codebook ~T k (B CW -B), and finally the termination codebook ~T k (B CW -B) is the next codebook to be used.

[0185] 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."

[0186] <<3: Example of Encoding / Decoding>> Here, as an example of encoding / decoding, encoding / decoding for the symbol string accaadaaa when using the base codebook of FIG. 14 and the termination codebook of FIG. 15 will be described. First, encoding will be described. Here, CW = 7. As can be seen from Figure 15, L max= 3. The starting codebook is set to the basic codebook T0. The input symbol string is the symbol string accaadaaa to be coded, and the symbol string accaadaaa is set to the current symbol string. A counter B is initialized.

[0187] (1) Using the current codebook T0, the current symbol string accaadaaa is compared with the symbol strings contained in the codebook T0. Since the symbol string a is the symbol string contained in the current codebook T0 that has the longest match with the prefix of the current symbol string accaadaaa, codeword 0 corresponding to symbol string a is obtained, and the symbol string ccaadaaa obtained by removing the prefix that matches the symbol string a from the current symbol string accaadaaa is set as the current symbol string, and counter B is incremented by the length of the obtained codeword 0 (i.e., B=1). CW -L max Since the condition (=4) is satisfied and the current codebook T0 contains only codeword 0 that starts with codeword 0 corresponding to symbol string a, the current codebook is set to T0. Since the length of the current symbol string ccaadaaa is not 0, the encoding process continues.

[0188] (2) Using the current codebook T0, the current symbol string ccaadaaa is compared with the symbol strings contained in the codebook T0. Since the symbol string c contained in the current codebook T0 has the longest match with the prefix of the current symbol string ccaadaaa, a codeword 11 corresponding to the symbol string c is obtained, and the symbol string caadaaa obtained by removing the prefix that matches the symbol string c from the current symbol string ccaadaaa is set as the current symbol string, and the counter B is incremented by the length of the obtained codeword 11 (i.e., B=3). CW -L max Since the condition (=4) is satisfied and the current codebook T0 contains a codeword 1100 (different from codeword 11) that starts with codeword 11 corresponding to symbol string c, the current codebook is designated as T1. Since the length of the current symbol string caadaaa is not 0, the encoding process continues.

[0189] ​​(3) Using the current codebook T1, the current symbol string caadaaa is compared with the symbol strings contained in the codebook T1. Since the symbol string c is the symbol string contained in the current codebook T1 that has the longest match with the prefix of the current symbol string caadaaa, a codeword 11 corresponding to the symbol string c is obtained, and the symbol string aadaaa obtained by removing the prefix that matches the symbol string c from the current symbol string caadaaa is set as the current symbol string, and the counter B is incremented by the length of the obtained codeword 11 (i.e., B=5). CW >B≧B CW -L max (=4), and the current codebook T1 contains a codeword 1100 (different from the codeword 11) that starts with the codeword 11 corresponding to the symbol string c, and B CW Since -B=2, the current codebook is set to ~T1(2). Since the length of the current symbol string aadaaa is not 0, the encoding process continues.

[0190] (4) Using the current codebook ~T1(2), the current symbol string aadaaa is compared with the symbol strings contained in the codebook ~T1(2). Since the symbol string aa is the symbol string contained in the current codebook ~T1(2) that has the longest match with the prefix of the current symbol string aadaaa, the codeword 01 corresponding to the symbol string aa is obtained, and the symbol string daaa obtained by removing the prefix that matches the symbol string aa from the current symbol string aadaaa is set as the current symbol string, and the counter B is incremented by the length of the obtained codeword 01 (i.e., B=7). B=B CW Since the above equation is satisfied, the counter B is initialized and the current codebook is set to T0. Since the length of the current symbol string daaa is not 0, the encoding process continues.

[0191] (5) Using the current codebook T0, the current symbol string daaa is compared with the symbol strings contained in the codebook T0. Since the symbol string d is the symbol string contained in the current codebook T0 that has the longest match with the prefix of the current symbol string daaa, a codeword 1100 corresponding to the symbol string d is obtained, and the symbol string aaa obtained by removing the prefix that matches the symbol string d from the current symbol string daaa is set as the current symbol string, and the counter B is incremented by the length of the obtained codeword 1100 (i.e., B=4). CW >B≧B CW-L max (=4), and the current codebook T0 contains only the codeword 1100 that starts with the codeword 1100 corresponding to the symbol string d, and B CW Since -B=3, the current codebook is set to ~T0(3). Since the length of the current symbol string aaa is not 0, the encoding process continues.

[0192] (6) Using the current codebook ~T0(3), the current symbol string aaa is compared with the symbol strings contained in the codebook ~T0(3). Since the symbol string aaa is the symbol string contained in the current codebook ~T1(2) that has the longest match with the prefix of the current symbol string aaa, the codeword 000 corresponding to the symbol string aaa is obtained, and the symbol string ε obtained by removing the prefix that matches the symbol string aaa from the current symbol string aaa is set as the current symbol string, and the counter B is incremented by the length of the obtained codeword 000 (i.e., B=7). B=B CW Since the above equation is satisfied, counter B is initialized and the current codebook is set to T0. Since the current symbol string ε is a symbol string of length 0, the codeword 01111011100000 is output and the encoding process ends.

[0193] Next, the decoding will be explained. CW The starting codebook and the starting codebook are shared between the encoding and decoding procedures. CW = 7. The starting codebook is the basic codebook T0. The input codeword is the codeword 01111011100000 to be decoded, and the codeword 01111011100000 is the current codeword. Counter B is initialized.

[0194] (1) Using the current codebook T0, the current codeword 01111011100000 is compared with the codewords contained in the codebook T0. The codeword 0 in the current codebook T0 is the codeword that has the longest match with the prefix of the current codeword 01111011100000. (The codeword 0 is the codeword with a predetermined codeword length B.) CWSince there is a codeword 0 that satisfies the condition that the codeword 0 is equal to or less than (=7), obtain the symbol a corresponding to codeword 0, and use the codeword 1111011100000 obtained by removing the prefix that matches codeword 0 from the current codeword 01111011100000 as the current symbol string. Increment counter B by the length of codeword 0 corresponding to the obtained symbol (i.e., set B=1). CW -L max Since (=4) is satisfied and the current codebook T0 only has codeword 0 as its prefix, the current codebook is set to T0. Since the length of the current codeword 1111011100000 is not 0, the decoding process continues.

[0195] (2) Using the current codebook T0, the current codeword 1111011100000 is compared with the codewords contained in the codebook T0. The codeword 11 (the codeword 11 is the codeword of the predetermined codeword length B) is determined as the codeword contained in the current codebook T0 that has the longest match with the prefix of the current codeword 1111011100000. CW Since there is a codeword 11 that satisfies the condition that the codeword 11 is equal to or less than (=7), the codeword 11011100000 is obtained by removing the prefix that matches the codeword 11 from the current codeword 1111011100000, and the codeword 11011100000 is set as the current symbol string. The counter B is incremented by the length of the codeword 11 that corresponds to the obtained symbol (i.e., B=3). CW -L max Since the condition (=4) is satisfied and the current codebook T0 contains the codeword 1100 (different from codeword 11) as a codeword beginning with codeword 11, the current codebook is designated as T1. Since the length of the current codeword 11011100000 is not 0, the decoding process continues.

[0196] (3) Using the current codebook T1, the current codeword 11011100000 is compared with the codewords contained in the codebook T1. The codeword 11 (the codeword 11 is the codeword of the predetermined codeword length B) is found to be the codeword contained in the current codebook T1 that has the longest match with the prefix of the current codeword 11011100000. CW ​​Since there is a codeword 11 that satisfies the condition that the codeword 11 is equal to or less than (=7), the codeword 011100000, which is the current codeword 11011100000 minus the prefix that matches the codeword 11, is obtained, and the counter B is incremented by the length of the codeword 11 that corresponds to the obtained symbol (i.e., B=5). CW >B≧B CW -L max (=4), and the current codebook T1 contains a codeword 1100 (different from the codeword 11) as a codeword beginning with the codeword 11, and B CW Since -B=2, the current codebook is set to ~T1(2). The length of the current codeword 011100000 is not 0, so the decoding process continues.

[0197] (4) Using the current codebook ~T1(2), the current codeword 011100000 is compared with the codewords contained in the codebook ~T1(2). The codeword 01 (codeword 01 is the codeword of the predetermined codeword length B) is found to be the codeword contained in the current codebook ~T1(2) that matches the prefix of the current codeword 011100000. CW Since there is a codeword 01 that satisfies the condition that the codeword 01 is equal to or less than (=7), the symbol aa corresponding to the codeword 01 is obtained, and the codeword 1100000 obtained by removing the prefix that matches the codeword 01 from the current codeword 011100000 is set as the current symbol string, and the counter B is incremented by the length of the codeword 01 that corresponds to the symbol (i.e., B=7). B=B CW Since this satisfies the above, B is initialized and the current codebook is set to T0. Since the length of the current codeword 1100000 is not 0, the decoding process continues.

[0198] (5) Using the current codebook T0, the current codeword 1100000 is compared with the codewords contained in the codebook T0. The codeword 1100 is the codeword contained in the current codebook T0 that has the longest match with the prefix of the current codeword 1100000 (the codeword 1100 is the codeword with a predetermined codeword length B, where the value (=4) obtained by incrementing the counter B by the length of the codeword 1100 is the codeword length B). CWSince there is a codeword 1100 that satisfies the condition that the codeword 1100 is equal to or less than (=7), the codeword 000 obtained by removing the prefix that matches the codeword 1100 from the current codeword 1100000 is taken as the current symbol string, and the counter B is incremented by the length of the codeword 1100 that corresponds to the symbol (i.e., B=4). CW >B≧B CW -L max (=4), and the current codebook T0 contains only the codeword 1100 as the prefix, and B CW Since -B=3, the current codebook is set to ~T0(3). The length of the current codeword 000 is not 0, so the decoding process continues.

[0199] (6) Using the current codebook ~T0(3), the current codeword 000 is compared with the codewords contained in the codebook ~T0(3). The codeword 000 is the codeword contained in the current codebook ~T0(3) that has the longest match with the prefix of the current codeword 000. (The codeword 000 is the codeword with a predetermined codeword length B.) CW Since there is a codeword 000 that satisfies the condition that the codeword 000 is equal to or less than (=7), the codeword λ obtained by removing the prefix that matches the codeword 000 from the current codeword 000 is taken as the current codeword, and the counter B is incremented by the length of the codeword 000 that corresponds to the symbol (i.e., B=7). B=B CW Since the above equation is satisfied, B is initialized and the current codebook is set to T0. Since the current codeword λ is a codeword of length 0, the symbol string accaadaaa is output and the decoding process ends.

[0200] In the above example, B CW = 7, the current codebook becomes T0 every time the length of the codeword obtained by encoding becomes 7. Therefore, among the codewords obtained according to the encoding procedure of the third embodiment, codewords to be decoded using the basic codebook T0 periodically appear. In other words, by starting decoding from a codeword for which the codebook to be used for decoding is obvious, it becomes possible to start decoding even from the middle of the input codeword without decoding any previous codewords.

[0201] <<4: Summary>> Even when compression is performed using variable-length codes, decoding can be performed using a trivial codebook (i.e., a starting codebook) for each predetermined length of codeword without significantly reducing compression efficiency. This makes it possible to transmit a larger number of symbol strings by utilizing the remaining bits at the end, even when the upper limit of the number of bits that can be transmitted on the decoding side is strictly limited.

[0202] <Third Embodiment> An encoding device 100 in this embodiment receives as input a symbol string to be encoded (hereinafter referred to as an input symbol string) and outputs a codeword corresponding to the input symbol string (hereinafter referred to as an output codeword). Also, a decoding device 200 in this embodiment receives as input a codeword to be decoded (hereinafter referred to as an input codeword) and outputs a symbol string corresponding to the input codeword (hereinafter referred to as an output symbol string).

[0203] The multiple codebooks or code trees used by the encoding device 100 and the decoding device 200 in the encoding process and the decoding process are configured from two basic codebooks or basic code trees T0 and T1 and six termination codebooks or termination code trees ~T0(1), ~T0(2), ~T0(3), ~T1(1), ~T1(2), and ~T1(3).

[0204] The two basic codebooks or basic code trees T0 and T1 and the six termination codebooks or termination code trees ~T0(1), ~T0(2), ~T0(3), ~T1(1), ~T1(2), ~T1(3) have a data structure with the following characteristics:

[0205] (1) Two basic codebooks or basic code trees T0 and T1 are composed of pairs of a symbol string and a codeword. All symbol strings included in the basic codebooks or basic code trees T0 and T1 have the same length.

[0206] (2) The six termination codebooks or termination code trees ~T0(1), ~T0(2), ~T0(3), ~T1(1), ~T1(2), ~T1(3) are composed of pairs of symbol strings and codewords. k (k represents either 0 or 1) for which three terminating codebooks or terminating code trees ∼T k (1), ~Tk (2), ~T k (3) corresponds to the terminating codebook or terminating code tree ~T k All code words in (1) have length 1, and the terminating codebook or terminating code tree ~T k All code words in (2) have length 2, and the terminating codebook or terminating code tree ~T k All code words in (3) have length 3, i.e., the basic codebook or basic code tree T k The corresponding termination codebook or termination code tree ~T k (1), ~T k (2), ~T k (3) All the code words contained in each are of the same length, and the termination codebook or termination code tree ∼T k (1), ~T k (2), ~T k (3) The length varies.

[0207] (3) Termination codebook or termination code tree ~T k The code words included in (L) (k represents either 0 or 1, and L represents either 1, 2, or 3) are stored in the termination codebook or termination code tree ∼T k The basic codebook or basic code tree T corresponding to (L) k or the codebook or the code tree for termination ~T k The basic codebook or basic code tree T corresponding to (L) k It is the prefix of any code word included in

[0208] In addition, L max can be said to be the maximum length of the codewords contained in the termination codebook or termination code trees ~T0(1), ~T0(2), ~T0(3), ~T1(1), ~T1(2), ~T1(3).

[0209] As described above, the codebook in FIG. 14 is an example of the basic codebooks T0 and T1, and the codebook in FIG. 15 is an example of the termination codebooks ∼T0(1), ∼T0(2), ∼T0(3), ∼T1(1), ∼T1(2), and ∼T1(3).

[0210] <<Encoding Apparatus 100>> The encoding apparatus 100 will be described below with reference to Figs. 6 and 7. Fig. 6 is a block diagram showing the configuration of the encoding apparatus 100. Fig. 7 is a flowchart showing the operation of the encoding apparatus 100. As shown in Fig. 6, the encoding apparatus 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 apparatus 100. The recording unit 190 records, for example, two basic codebooks or basic code trees T0 and T1 and six termination codebooks or termination code trees ∼T0(1), ∼T0(2), ∼T0(3), ∼T1(1), ∼T1(2), and ∼T1(3).

[0211] The operation of the encoding device 100 will be described with reference to Fig. 7. Here, T0 is set as the starting codebook or starting code tree.

[0212] In S110, encoding section 110 obtains codewords corresponding to the symbol strings that make up the input symbol string using two basic codebooks or basic code trees T0 and T1 and six termination codebooks or termination code trees ~T0(1), ~T0(2), ~T0(3), ~T1(1), ~T1(2), ~T1(3), and outputs the codeword obtained by concatenating the obtained codewords as the output codeword.

[0213] B CW is a predetermined codeword length representing a repetition unit of encoding, B is a counter for counting the codeword length obtained by encoding in the repetition unit, and the start codebook or start code tree is a basic codebook or basic code tree used in the first encoding in the repetition unit. Encoding section 110 performs an encoding process consisting of the following three steps:

[0214] (1) A process of initializing counter B, setting the starting codebook or starting code tree T0 as the current codebook or code tree, and setting the input symbol string as the current symbol string. (2) Using the current codebook or code tree, the current symbol string is compared with the symbol string contained in the codebook or code tree, and a code word corresponding to the symbol string σ contained in the current codebook or code tree that matches the prefix of the current symbol string for the longest period is obtained, and the symbol string obtained by excluding the symbol string that matches the symbol string σ from the current symbol string is set as the current symbol string, and counter B is incremented by the length of the code word corresponding to the symbol string σ. (α) B CW -L max If the codeword beginning with the codeword corresponding to the symbol string σ (however, the codeword is different from the codeword corresponding to the symbol string σ) is not included in the set of codewords included in the current codebook or code tree, T0 is taken as the codebook or code tree to be used next, and if it is included in the set, T1 is taken as the codebook or code tree to be used next, and the codebook or code tree to be used next is taken as the current codebook or code tree, and (β)B CW >B≧B CW -L max If the codeword beginning with the codeword corresponding to the symbol string σ (however, the codeword is different from the codeword corresponding to the symbol string σ) is not included in the set of codewords included in the current codebook, T0 is selected as the codebook to be used next, and if it is included in the set, T1 is selected as the codebook to be used next, and the basic codebook T k (k represents either 0 or 1) k (B CW -B) is the current codebook or code tree, and (γ)B=B CW ​(3) If the length of the current symbol string obtained by the process (2) is 0, the codeword obtained by concatenating all the codewords obtained by the process (2) is output as the output codeword, and the encoding process is terminated; otherwise, the process returns to the process (2). The processes (2) and (3) above are the processes of the encoding repetition unit, and the encoding unit 110 obtains and outputs the output codeword by repeatedly executing the encoding repetition unit consisting of the following three processes:

[0215] (α)B CW -L max In the case of encoding, a codeword corresponding to a symbol string that constitutes an input symbol string is obtained using one of multiple basic codebooks or basic code trees, and one of the multiple basic codebooks or basic code trees is used as the codebook or code tree to be used next. (β) B CW >B≧B CW -L max In the case of encoding, a codeword corresponding to the symbol string that constitutes the input symbol string is obtained using one of multiple base codebooks or base code trees, and one of multiple termination codebooks or termination code trees is used as the codebook or code tree to be used next. (γ)B=B CW In the encoding when CW Each time a starting codebook or a starting code tree is obtained, the encoding repetition unit is repeatedly executed with the starting codebook or the starting code tree as the codebook or the code tree to be used next, thereby obtaining an output codeword.

[0216] ​Furthermore, encoding section 110 obtains a codeword corresponding to a symbol string constituting an input symbol string, using any of a plurality of basic codebooks or basic code trees, or a plurality of termination codebooks or termination code trees, and obtains an output codeword by repeating a process of selecting any of the plurality of basic codebooks or basic analysis trees, or a plurality of termination codebooks or termination code trees as the codebook or code tree to be used next; when a termination codebook or termination code tree is used, the codebook or code tree to be used next is a predetermined basic codebook or basic code tree (i.e., a starting codebook or starting code tree), and it can be said that the codebook or code tree to be used next becomes the starting codebook or starting code tree in a predetermined cycle.

[0217] <<Decoding Device 200>> Hereinafter, the decoding device 200 will be described with reference to Fig. 8 and Fig. 9. Fig. 8 is a block diagram showing the configuration of the decoding device 200. Fig. 9 is a flowchart showing the operation of the decoding device 200. As shown in Fig. 8, 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. Recording unit 290 records, for example, two basic codebooks or basic code trees T0 and T1 and six terminating codebooks or terminating code trees ~T0(1), ~T0(2), ~T0(3), ~T1(1), ~T1(2), ~T1(3) (where the basic codebooks or basic code trees T0 and T1, and the terminating codebooks or terminating code trees ~T0(1), ~T0(2), ~T0(3), ~T1(1), ~T1(2), ~T1(3) are the same as the basic codebooks or basic code trees and the terminating codebooks or terminating code trees used in the encoding process to obtain the input codeword).

[0218] The operation of the decoding device 200 will be described with reference to FIG.

[0219] In S210, decoding section 210 obtains symbol strings corresponding to the codewords that make up the input codeword using two basic codebooks or basic code trees T0 and T1 and six termination codebooks or termination code trees ∼T0(1), ∼T0(2), ∼T0(3), ∼T1(1), ∼T1(2), ∼T1(3), and outputs the symbol string obtained by concatenating the obtained symbol strings as an output symbol string.

[0220] B CW is a predetermined codeword length representing a repetition unit of decoding (where the predetermined codeword length is equal to the predetermined codeword length representing the repetition unit of encoding used in the encoding process to obtain the input codeword), B is a counter for counting the codeword length processed in decoding in the repetition unit, and the starting codebook or starting code tree is a basic codebook or basic code tree used in the first decoding in the repetition unit, and decoding unit 210 executes a decoding process consisting of the following three processes.

[0221] (1) Initialize counter B, set the start codebook or start code tree T0 as the current codebook or code tree, and set 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 find the codeword w contained in the current codebook or code tree that has the longest match with the prefix of the current codeword (where the codeword w is the codeword length B, where the value obtained by incrementing counter B by the length of codeword w is the codeword length B). CW (α)B CW -L max If the codeword beginning with the codeword w (however, the codeword is different from the codeword w) is not included in the set of codewords included in the current codebook or code tree, T0 is taken as the codebook or code tree to be used next, and if it is included in the set, T1 is taken as the codebook or code tree to be used next, and the codebook or code tree to be used next is taken as the current codebook or code tree, and (β)B CW >B≧B CW -L max If the codeword beginning with the codeword w (however, the codeword is different from the codeword w) is not included in the set of codewords included in the current codebook, T0 is selected as the codebook to be used next. If the codeword is included in the set, T1 is selected as the codebook to be used next. k (k represents either 0 or 1) k (B​CW -B) is the current codebook or code tree, and (γ)B=B CW (3) If the length of the current codeword obtained by the process (2) is 0, output the symbol string obtained by concatenating all the symbol strings obtained by the process (2) as the output symbol string and terminate the decoding process, while otherwise returning to the process (2). The processes (2) and (3) above are processes of a decoding iteration unit, and the decoding unit 210 obtains and outputs an output symbol string by repeatedly executing the decoding iteration unit consisting of the following three processes:

[0222] (α)B CW -L max In decoding when , a symbol string corresponding to a codeword constituting an input codeword is obtained using one of multiple basic codebooks or basic code trees, and one of multiple basic codebooks or basic code trees is used as the codebook or code tree to be used next. (β) B CW >B≧B CW -L max In decoding when B = B, a symbol string corresponding to the codeword that constitutes the input codeword is obtained using one of multiple base codebooks or base code trees, and one of multiple termination codebooks or termination code trees is used as the codebook or code tree to be used next. CW In decoding when the input codeword is a predetermined codeword length B, the decoding unit 210 performs a process of obtaining a symbol string corresponding to the codeword that constitutes the input codeword using one of a plurality of termination codebooks or termination code trees, and then using the start codebook or start code tree as the codebook or code tree to be used next. CW Each time decoding is performed, the starting codebook or starting code tree is used as the codebook or code tree to be used next, and the decoding repetition unit is repeatedly executed to obtain an output symbol string.

[0223] ​Furthermore, decoding section 210 obtains a symbol string corresponding to the codeword that constitutes the input codeword, using any of a plurality of basic codebooks or basic code trees, or a plurality of termination codebooks or termination code trees, and obtains an output symbol string by repeating a process of selecting any of the plurality of basic codebooks or basic analysis trees, or a plurality of termination codebooks or termination code trees as the codebook or code tree to be used next. When a termination codebook or termination code tree is used, the codebook or code tree to be used next is a predetermined basic codebook or basic code tree (i.e., a starting codebook or starting code tree), and it can be said that the codebook or code tree to be used next becomes the starting codebook or starting code tree in a predetermined cycle.

[0224] According to an embodiment of the present invention, it is possible to realize a code using multiple codebooks or code trees that can decode a codeword to be decoded from the middle. More specifically, by performing encoding using a codebook switching rule that allows decoding using a clear codebook for each predetermined length of the codeword, it is possible to decode even from the middle of the codeword. Furthermore, according to an embodiment of the present invention, it is possible to encode a codeword of any fixed codeword length using a codebook including variable-length codewords without significantly reducing compression efficiency.

[0225] <Technical Background> In the encoding / decoding in the third embodiment, a codebook based on a technology capable of expressing a coding rule that satisfies the unique decodability condition is used as a basic codebook. Here, an embodiment different from the third embodiment will be described, in which a plurality of codebooks that can express a coding rule that satisfies the unique decodability condition are used as basic codebooks. Note that a code tree may be used instead of a codebook, and this does not result in any difference in the encoding procedure / decoding procedure.

[0226] <<1: Basic Codebook>> Here, a codebook used as a basic codebook in the fourth embodiment will be described.

[0227] First, we will explain the codeword mode, which is a concept necessary for explaining the codebook used as the basic codebook in the fourth embodiment. A set of codewords for a codebook is defined as a codeword mode. A codeword mode is assigned to each of the multiple codebooks used for encoding / decoding. Since the codeword mode assigned to a codebook is defined as a set of codewords, it is assumed that there is no duplication of codewords included in a codeword mode. It is preferable that the codeword mode satisfies 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.

[0228] The codebook used as the basic codebook in the fourth embodiment is composed of a triplet of an input symbol string, an output codeword, and a next codebook to be used (hereinafter referred to as a link destination). Fig. 16 is a diagram showing an example of a codebook. The codebook in Fig. 16 is used to encode a symbol string that is a string of symbols {a, b, c} into a codeword that is a string of codes {0, 1}, and is composed of five codebooks: T0, T1, T2, T3, and T4. Codebook T0 is assigned the codeword mode {λ}, and codebook T1 is assigned the codeword mode {011, 10}. Codebook T0 outputs codeword λ for symbol a, and the next codebook to be used is T1, and codebook T0 outputs codeword 0 for symbol b, and the next codebook to be used is T2.

[0229] Next, the conditions required for a codebook so that encoding / decoding in the fourth 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 when it is obtained by concatenating a codeword included in the codebook with a codeword that is an element of a codeword mode corresponding to the codeword and assigned to the next codebook to be used. Here, a codeword included in a codebook refers to a codeword that is an element of a triplet constituting the codebook. For example, the expanded codewords of codebook T0 in FIG. 16 are codewords 011 and 10 obtained by concatenating codeword λ corresponding to symbol a with codewords 011 and 10 that are elements of a codeword mode {011, 10} corresponding to symbol a and assigned to the next codebook T1 to be used, and codewords 00 and 010 obtained by concatenating codeword 0 corresponding to symbol b with codewords 0 and 10 that are elements of a codeword mode {0, 10} corresponding to symbol b and assigned to the next codebook T2 to be used.

[0230] The following two conditions are required for the codebook in order for encoding / decoding to satisfy the unique decodability condition.

[0231] (1) For any codebook included in a plurality of codebooks, a set consisting of all expanded codewords in the codebook satisfies the prefix condition.

[0232] (2) For any codebook included in a plurality of codebooks, the expanded codeword of the codebook has as its prefix any codeword included in the codeword mode assigned to the codebook.

[0233] When encoding / decoding using multiple codebooks is uniquely decodable, multiple codebooks including a codebook to which a codeword mode that does not satisfy the prefix condition is assigned can be expressed as multiple codebooks to which only codeword 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 codeword modes that satisfy the prefix condition are assigned provide a simpler expression, as described above, it is preferable that the codeword mode satisfies the prefix condition.

[0234] As mentioned above, the coding rules can also be expressed using code trees. The above explanation of codebooks also applies to code trees, simply by replacing the word "codebook" with "code tree." By doing so, we can obtain the following explanation of code trees:

[0235] A set of code words for a code tree is defined as a code word mode. A code word mode is assigned to each of the multiple code trees used for encoding / decoding.

[0236] A code tree is composed of a triplet of an input symbol string, an output code word, and the code tree to be used next.

[0237] 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 code word 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.

[0238] The following two conditions are required for the code tree in order for encoding / decoding to satisfy the unique decodability condition.

[0239] (1) For any code tree included in a plurality of code trees, a set consisting of all expanded code words of the code tree satisfies the prefix condition.

[0240] (2) For any code tree included in a plurality of code trees, the expanded code word of the code tree has as its prefix any code word included in the code word mode assigned to the code tree.

[0241] <<2: Codebooks and Switching Rules Thereof>> As in the third embodiment, the codebooks in the fourth embodiment include two types of codebooks: a plurality of codebooks (hereinafter referred to as base codebooks) that satisfy the unique decodability condition, and a plurality of codebooks (hereinafter referred to as terminating codebooks) that have roles different from those of the plurality of codebooks. Both the base codebook and the terminating codebook are composed of a triplet of an input symbol string, an output codeword, and the next codebook to be used (hereinafter referred to as a link destination). The symbol strings included in the base codebook have a fixed length of 1 or more, and the codewords included in the base codebook have a variable length. A plurality of terminating codebooks correspond to one basic codebook. The terminating codebook corresponding to the base codebook contains fixed-length codewords, the lengths of which vary. {T k} k=0 K-1 (where K is an integer greater than or equal to 2) are multiple basic codebooks, the basic codebook T k The multiple termination codebooks corresponding to k (L) (L represents the length of the codeword contained in the termination codebook, L = L min , …, L max (L min , L max is L min <L max The codewords included in the terminating codebook are configured to have any codeword included in the base codebook corresponding to the terminating codebook as a prefix, or to be the prefix of any codeword included in the base codebook corresponding to the terminating codebook. A codeword mode is assigned to each of the base codebook and the terminating codebook, and the codeword mode assigned to the terminating codebook is the same as the codeword mode assigned to the corresponding base codebook. Furthermore, the link destinations included in the terminating codebook are the same basic codebook. The link destinations correspond to the start codebook explained in the third embodiment. Furthermore, the terminating codebook satisfies the following conditions:

[0242] (1) The codewords included in the termination codebook start with any codeword of the codeword modes assigned to the termination codebook.

[0243] 16 and 17 are diagrams showing examples of codebooks. The codebook in Fig. 16 is a basic codebook, and the codebooks in Fig. 17 are termination codebooks ~T1(3), ~T1(4), and ~T1(5) corresponding to the basic codebook T1 in Fig. 16. The basic codebook in FIG. 16 and the termination codebook in FIG. 17 are used to encode a symbol string that is a string of symbols {a, b, c} into a codeword that is a string of codes {0, 1}, and consist of five basic codebooks T0, T1, T2, T3, and T4, and termination codebooks corresponding to the basic codebooks T0, T1, T2, T3, and T4 (FIG. 17 only shows the termination codebook ~T1(3), ~T1(4), and ~T1(5) that corresponds to the basic codebook T1. In other words, although not shown, there are also corresponding termination codebooks ~T0(3), ~T0(4), ~T0(5), ~T2(3), ~T2(4), ~T2(5), ~T3(3), ~T3(4), ~T3(5), ~T4(3), ~T4(4), and ~T4(5) for the basic codebooks T0, T2, T3, and T4). As can be seen from Figure 16, the lengths of the codewords contained in the basic codebooks T0, T1, T2, T3, and T4 are not constant. On the other hand, as can be seen from Figure 17, the length of the codewords contained in the termination codebook ~T1(3) is 3, the length of the codewords contained in the termination codebook ~T1(4) is 4, and the length of the codewords contained in the termination codebook ~T1(5) is 5, and the length of the codewords contained in each termination codebook is constant. Note that L min =3, L max =5.

[0244] Next, a codebook switching rule when encoding / decoding is performed in the fourth embodiment will be described. In the encoding / decoding in the fourth embodiment, encoding / decoding is repeatedly performed to generate a codeword of a predetermined length (hereinafter, B CW Each time a codeword of a predetermined codeword length B is obtained / decoded, the codebook is switched so that encoding / decoding is performed using the start codebook that is a link destination included in the termination codebook. CW Each time a length B is obtained / decoded, the codebook to be used next returns to the codebook that was used when the encoding / decoding process started. CWIt is then possible to decode each codeword using the starting codebook.

[0245] Here, the given codeword length B CW Therefore, the encoding / decoding using the codebook in the fourth embodiment is an encoding that outputs codewords of an arbitrary fixed codeword length using a codebook including variable-length codewords, without significantly reducing the compression efficiency.

[0246] As mentioned above, the coding rule can also be expressed using a code tree. Therefore, the above explanation of the codebook also applies to the code tree by simply replacing the word "codebook" with "code tree." For example, a base code tree, a termination code tree, and a start code tree can also be defined in the same way.

[0247] <<3: Encoding Procedure / Decoding Procedure>> The encoding procedure in the fourth embodiment uses a symbol string to be coded (hereinafter referred to as an input symbol string) as input, and k} k=0 K-1 (where K is an integer greater than or equal to 2) and multiple termination codebooks {~T k (L min ), ..., ~T k (L max )} k=0 K-1 (However, L min , L max is L min <L max (an integer of 1 or more satisfying 1) to obtain a codeword corresponding to the symbol string that constitutes the input symbol string, and output a codeword (hereinafter referred to as an output codeword) obtained by concatenating all the obtained codewords. k} k=0 K-1 and multiple termination codebooks {~T k (L min ), ..., ~T k (L max )} k=0 K-1 (However, the basic codebook {T k} k=0K-1 and the termination codebook {~T k (L min ), ..., ~T k (L max )} k=0 K-1 is the codebook used in the encoding procedure) to obtain a symbol string corresponding to the codewords that make up the input codeword, and then output a symbol string (hereinafter referred to as an output symbol string) obtained by concatenating the obtained symbols.

[0248] The same termination codebook {~T k (L min ), ..., ~T k (L max )} k=0 K-1 Note that the starting codebook is shared between the encoding and decoding procedures because we use a given codeword length B CW Note that the sigma sigma is also shared between the encoding and decoding procedures.

[0249] (Encoding Procedure) The current symbol string is the symbol string currently being encoded, and the current codebook is the codebook currently being used for encoding. Therefore, the current symbol string and the current codebook at the start of encoding are the input symbol string and the starting codebook, respectively.

[0250] The encoding procedure in the fourth embodiment comprises the following three processes.

[0251] (1) Initialize a counter B for counting the length of the codeword obtained by encoding. That is, set B=0. Also, set the starting codebook to the current codebook. Set the input symbol string to the current symbol string.

[0252] (2) Using the current codebook, the current symbol string is compared with the symbol string contained in the codebook. The codeword corresponding to the symbol string σ contained in the current codebook that has the longest match with the prefix of the current symbol string is obtained, and the symbol string obtained by excluding the prefix that matches the symbol string σ from the current symbol string is set as the current symbol string. In addition, the counter B is incremented by the length of the codeword corresponding to the symbol string σ. In other words, B = B + (the length of the codeword corresponding to the symbol string σ). Furthermore, the current codebook is obtained according to the following case distinction:

[0253] (α)B CW -L max If σ is the next codebook to be used, the codebook corresponding to the symbol string σ is set as the current codebook.

[0254] (β) B CW >B≧B CW -L max If so, the next codebook T to be used corresponding to the symbol string σ is k and obtain the codebook T k Termination codebook ~T corresponding to k (B CW -B) is the current codebook.

[0255] (γ)B=B CW If , the starting codebook is set as the current codebook. Also, counter B is initialized.

[0256] (3) If the length of the current symbol string obtained by process (2) is 0, the code word obtained by concatenating all the code words obtained by process (2) is output as the output code word, and the encoding process ends; otherwise, return to process (2).

[0257] In the case of (β), the codebook actually used in the next encoding process is the basic codebook T k Instead, the termination codebook ~T k (B CW -B), and finally the termination codebook ~T k (B CW -B) is the next codebook to be used.

[0258] (Decoding Procedure) The current codeword is the codeword currently being decoded, and the current codebook is the codebook currently being used for the decoding. Therefore, the current codeword and current codebook at the start of decoding are the input codeword and the starting codebook, respectively.

[0259] The decoding procedure in the fourth embodiment comprises the following three processes.

[0260] ​(1) Initialize a counter B for counting the length of the decoded codeword. That is, set B=0. Also, set the starting codebook as the current codebook. Set the input codeword as the current codeword.

[0261] (2) Using the current codebook, the current codeword is compared with the codewords contained in the codebook. The codeword w contained in the current codebook that matches the prefix of the current codeword longest is found (where the codeword w is a codeword of a predetermined length B, where the value obtained by incrementing the counter B by the length of the codeword w is a codeword of a predetermined length B). CW If there exists a codeword that satisfies the condition that: (i.e., the condition that the following holds) and there exists a codeword included in the codeword mode assigned to the codebook to be used next, which corresponds to the codeword w and matches the prefix of the codeword obtained by excluding the prefix that matches the codeword w from the current codeword, obtain a symbol string corresponding to the codeword w, and set the codeword obtained by excluding the prefix that matches the codeword w from the current codeword as the current codeword. Also, increment counter B by the length of codeword w. That is, set B = B + (length of codeword w). Then, obtain the current codebook according to the following case distinction:

[0262] (α)B CW -L max If , the next codebook to be used corresponding to codeword w is set as the current codebook.

[0263] (β) B CW >B≧B CW -L max If so, the next codebook T to be used corresponding to the codeword w is k and obtain the codebook T k Termination codebook ~T corresponding to k (B CW -B) is the current codebook.

[0264] (γ)B=B CW If , the starting codebook is set as the current codebook. Also, counter B is initialized.

[0265] (3) If the length of the current codeword obtained by process (2) is 0, the symbol string obtained by concatenating all symbol strings obtained by process (2) is output as the output symbol string, and the decoding process ends; otherwise, return to process (2).​

[0266] In the case of (β), the codebook actually used in the next decoding process is the basic codebook T k Instead, the termination codebook ~T k (B CW -B), and finally the termination codebook ~T k (B CW -B) is the next codebook to be used.

[0267] 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."

[0268] Fourth Embodiment An encoding device 100 according to this embodiment receives as input a symbol string to be encoded (hereinafter referred to as an input symbol string) and outputs a codeword corresponding to the input symbol string (hereinafter referred to as an output codeword). Also, a decoding device 200 according to this embodiment receives as input a codeword to be decoded (hereinafter referred to as an input codeword) and outputs a symbol string corresponding to the input codeword (hereinafter referred to as an output symbol string).

[0269] The multiple codebooks or code trees used by the encoding device 100 and the decoding device 200 in the encoding process and the decoding process are multiple basic codebooks or basic code trees {T k} k=0 K-1 (where K is an integer equal to or greater than 2), and multiple terminating codebooks or terminating code trees {~T k (L min ), …, ~T k (L max )} k=0 K-1 (L=L min , …, L max (where L represents the length of the codeword contained in the termination codebook or termination code tree, and L min , L max is L min <L max and an integer of 1 or greater that satisfies the above.

[0270] Multiple basic codebooks or basic code trees {T k} k=0 K-1is a data structure with the following characteristics:

[0271] (1) Basic codebook or basic code tree T k (k=0, 1, ..., K-1) is composed of a triplet of a symbol string, a codeword, and the next codebook or code tree to be used, and is assigned a codeword mode, which is a set of codewords. k All symbol strings in (k=0, 1,…, K-1) have the same length.

[0272] (2) Basic codebook or basic code tree T k The set of all expanded codewords (k=0, 1,…, K-1) satisfies the prefix condition, and the basic codebook or basic code tree T k The expanded codeword of the basic codebook or basic code tree T k The condition is met that the prefix of the codeword is any codeword included in the codeword mode assigned to the codeword mode.

[0273] In addition, multiple terminating codebooks or terminating code trees { k (L min ), …, ~T k (L max )} k=0 K-1 is a data structure with the following characteristics:

[0274] (1) Termination codebook or termination code tree ~T k (L)(k=0, …, K-1, L=L min , …, L max ) is composed of a triplet of a symbol string, a codeword, and the codebook or code tree to be used next, and is assigned a codeword mode, which is a set of codewords.

[0275] (2) Termination codebook or termination code tree ~T k (L)(k=0, …, K-1, L=L min , …, L max ) is assigned to the corresponding basic codebook or basic code tree T k is the same as the codeword mode assigned to

[0276] (3) Termination codebook or termination code tree ~T k (L)(k=0, …, K-1, L=L min , …, L max ) are all the same basic codebooks or code trees to be used next.

[0277] (4) Termination codebook or termination code tree ~T k (L)(k=0, …, K-1, L=L min , …, L max ) is a codeword included in the termination codebook or termination code tree T k The prefix is ​​any code word in the code word mode assigned to (L).

[0278] (5) Termination codebook or termination code tree ~T k (L)(k=0, …, K-1, L=L min , …, L max ) is a codeword included in the termination codebook or termination code tree T k The basic codebook or basic code tree T corresponding to (L) k or the codebook or the code tree for termination ~T k The basic codebook or basic code tree T corresponding to (L) k It is the prefix of any code word included in

[0279] As explained in the Technical Background, multiple basic codebooks or basic code trees {T k} k=0 K-1 satisfies the conditions (1) and (2), multiple basic codebooks or basic code trees {T k} k=0 K-1 satisfies the unique decodability condition, but the terminating codebook or terminating code tree {~T k (L min ), …, ~T k (L max )} k=0 K-1 Therefore, when the terminating codebook or the terminating code tree { k (Lmin ), …, ~T k (L max )} k=0 K-1 , the terminating codebook or terminating code tree { k (L min ), …, ~T k (L max )} k=0 K-1 A codeword mode that satisfies the above (4) is also assigned to

[0280] As described above, the termination codebook or termination code tree ∼T k (L)(k=0, …, K-1, L=L min , …, L max ) is the starting codebook or starting code tree.

[0281] <<Encoding Apparatus 100>> The encoding apparatus 100 will be described below with reference to Figs. 6 and 7. Fig. 6 is a block diagram showing the configuration of the encoding apparatus 100. Fig. 7 is a flowchart showing the operation of the encoding apparatus 100. As shown in Fig. 6, the encoding apparatus 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 apparatus 100. The recording unit 190 stores, for example, a plurality of basic codebooks or basic code trees {T k} k=0 K-1 and multiple terminating codebooks or terminating code trees {~T k (L min ), …, ~T k (L max )} k=0 K-1 Keep a record of the following.

[0282] The operation of the encoding device 100 will be described with reference to FIG.

[0283] In S110, the encoding unit 110 generates a plurality of basic codebooks or basic code trees {T k} k=0 K-1 and multiple terminating codebooks or terminating code trees {~T k (L min), …, ~T k (L max )} k=0 K-1 The codeword corresponding to the symbol string that constitutes the input symbol string is obtained using the above, and the codeword obtained by concatenating the codewords is output as the output codeword.

[0284] B CW is a predetermined codeword length representing a repetition unit of encoding, B is a counter for counting the codeword length obtained by encoding in the repetition unit, and the start codebook or start code tree is a basic codebook or basic code tree used in the first encoding in the repetition unit. Encoding section 110 performs an encoding process consisting of the following three steps:

[0285] (1) A process of initializing counter B, setting the starting codebook or starting code tree as the current codebook or code tree, and setting the input symbol string as the current symbol string. (2) Using the current codebook or code tree, the current symbol string is compared with the symbol string contained in the codebook or code tree, and a code word corresponding to the symbol string σ contained in the current codebook or code tree that has the longest match with the prefix of the current symbol string is obtained, and the symbol string obtained by removing the prefix that matches the symbol string σ from the current symbol string is set as the current symbol string, and counter B is incremented by the length of the code word corresponding to the symbol string σ. (α) B CW -L max If , the next codebook or code tree to be used corresponding to the symbol string σ is set as the current codebook or code tree, and (β)B CW >B≧B CW -L max If so, the next codebook or code tree T k and obtain the codebook or code tree T k The corresponding termination codebook or termination code tree ~T k (B CW -B) is the current codebook or code tree, and (γ)B=B CW ​(3) If the length of the current symbol string obtained by the process (2) is 0, the code word obtained by concatenating all the code words obtained by the process (2) is output as the output code word, and the encoding process is terminated, while otherwise the process returns to the process (2). In the process of the encoding unit 110, the processes (2) and (3) above are the processes of the encoding repetition unit, as in the encoding unit 110 of the third embodiment.

[0286] <<Decoding Device 200>> The decoding device 200 will be described below with reference to Figs. 8 and 9. Fig. 8 is a block diagram showing the configuration of the decoding device 200. Fig. 9 is a flowchart showing the operation of the decoding device 200. As shown in Fig. 8, 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 basic codebooks or basic code trees {T k} k=0 K-1 and multiple terminating codebooks or terminating code trees {~T k (L min ), …, ~T k (L max )} k=0 K-1 (However, the basic codebook {T k} k=0 K-1 , terminating codebook {~T k (L min ), …, ~T k (L max )} k=0 K-1 are the same as the basic codebook or basic code tree, or the terminating codebook or terminating code tree used in the encoding process to obtain the input codeword) are recorded.

[0287] The operation of the decoding device 200 will be described with reference to FIG.

[0288] In S210, the decoding unit 210 decodes a plurality of basic codebooks or basic code trees {T k} k=0 K-1 and multiple terminating codebooks or terminating code trees {~Tk (L min ), …, ~T k (L max )} k=0 K-1 The symbol strings corresponding to the code words that make up the input code word are obtained using the above, and the symbol strings obtained by concatenating the obtained symbol strings are output as the output symbol string.

[0289] B CW is a predetermined codeword length representing a repetition unit of decoding (where the predetermined codeword length is equal to the predetermined codeword length representing the repetition unit of encoding used in the encoding process to obtain the input codeword), B is a counter for counting the codeword length processed in decoding in the repetition unit, and the starting codebook or starting code tree is a basic codebook or basic code tree used in the first decoding in the repetition unit, and decoding unit 210 executes a decoding process consisting of the following three processes.

[0290] (1) Initialize counter B, set the start codebook or start code tree as the current codebook or code tree, and set 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 find the codeword w contained in the current codebook or code tree that has the longest match with the prefix of the current codeword (where the codeword w is the codeword length B). CW If there exists a codeword that satisfies the condition that (α)B is less than or equal to the length of the codeword w, and if there exists a codeword that corresponds to the codeword mode assigned to the codebook or code tree to be used next and that matches the prefix of the codeword obtained by excluding the prefix that matches the codeword w from the current codeword, obtain a symbol string corresponding to the codeword w, set the codeword obtained by excluding the prefix that matches the codeword w from the current codeword as the current codeword, and increment the counter B by the length of the codeword w, CW -L max If so, the next codebook or code tree corresponding to the codeword w is set as the current codebook or code tree, and (β)B CW >B≧B CW -L max ​If so, the next codebook or code tree T k and obtain the codebook or code tree T k The corresponding termination codebook or termination code tree ~T k (B CW -B) is the current codebook or code tree, and (γ)B=B CW (3) If the length of the current codeword obtained by the process (2) is 0, output the symbol string obtained by concatenating all the symbol strings obtained by the process (2) as the output symbol string and terminate the decoding process, while otherwise returning to the process (2). In the process of the decoding unit 210, the processes (2) and (3) above are the processes of a decoding repetition unit, as in the decoding unit 210 of the third embodiment.

[0291] According to an embodiment of the present invention, it is possible to realize a code using multiple codebooks or code trees that can decode a codeword to be decoded from the middle. More specifically, by performing encoding using a codebook switching rule that allows decoding using a clear codebook for each predetermined length of the codeword, it is possible to decode even from the middle of the codeword. Furthermore, according to an embodiment of the present invention, it is possible to encode a codeword of any fixed codeword length using a codebook including variable-length codewords without significantly reducing compression efficiency.

[0292] The encoding / decoding in the third and fourth embodiments can be summarized as follows.

[0293] [1] A coding device that receives as input a symbol string to be coded (hereinafter referred to as an input symbol string) and outputs a codeword corresponding to the input symbol string (hereinafter referred to as an output codeword), comprising: a coding unit that obtains codewords corresponding to symbol strings that constitute the input symbol string using a plurality of codebooks or code trees, and outputs a codeword obtained by concatenating the obtained codewords as the output codeword; the plurality of codebooks or code trees are composed of a plurality of base codebooks or base code trees and a plurality of terminating codebooks or terminating code trees; the plurality of base codebooks or base code trees and the plurality of terminating codebooks or terminating code trees are composed of pairs including at least a symbol string and a codeword; all of the symbol strings included in the plurality of base codebooks or base code trees have the same length; a plurality of terminating codebooks or terminating code trees correspond to one base codebook or base code tree, and all of the codewords included in the terminating codebooks or terminating code trees that correspond to the base codebook or base code tree have the same length, but the lengths are different between the plurality of terminating codebooks or terminating code trees; a codeword included in a termination codebook or termination code tree has as its prefix any of the codewords included in a base codebook or base code tree corresponding to the termination codebook or termination code tree, or is a prefix of any of the codewords included in a base codebook or base code tree corresponding to the termination codebook or termination code tree, and the encoding unit obtains the codeword corresponding to a symbol string constituting the input symbol string by using any of the plurality of base codebooks or base code trees or the plurality of termination codebooks or termination code trees, and obtains the output codeword by repeating a process of setting any of the plurality of basic codebooks or basic analytic trees or the plurality of termination codebooks or termination code trees as the codebook or code tree to be used next, and when a termination codebook or termination code tree is used, the codebook or code tree to be used next is a predetermined base codebook or base code tree (hereinafter referred to as a starting codebook or starting code tree), and the codebook or code tree to be used next becomes the starting codebook or starting code tree at a predetermined cycle.

[0294] [2] The encoding device according to [1], CWis a predetermined codeword length representing a repetition unit of encoding, B is a counter for counting the codeword length obtained by encoding in the repetition unit, and L max is the maximum length of the codewords included in the plurality of termination codebooks or termination code trees, and a start codebook or start code tree is a basic codebook or basic code tree used in the first encoding in the repetition unit, and the encoding unit is CW -L max In the encoding when (β) B, a process of obtaining a codeword corresponding to a symbol string constituting the input symbol string using one of the plurality of basic codebooks or basic code trees, and using one of the plurality of basic codebooks or basic code trees as a codebook or code tree to be used next; CW >B≧B CW -L max In the encoding when (γ)B=B, a codeword corresponding to a symbol string constituting the input symbol string is obtained using one of the plurality of basic codebooks or basic code trees, and one of the plurality of termination codebooks or termination code trees is used as the codebook or code tree to be used next; CW and in the encoding when, the output codeword is obtained by repeatedly executing the repetition unit consisting of a process of obtaining a codeword corresponding to a symbol string constituting the input symbol string using any of the plurality of termination codebooks or termination code trees, and setting the starting codebook or starting code tree as the codebook or code tree to be used next.

[0295] [3] The encoding device according to [2], k} k=0 K-1 (where K is an integer of 2 or more) to the plurality of basic codebooks or basic code trees, k (L)(k=0, …, K-1, L=L min , …, L max (where L represents the length of the codeword contained in the termination codebook or termination code tree, and L min , L max is L min <L max (an integer greater than or equal to 1)) is used as the basic codebook or basic code tree T k ​and a plurality of termination codebooks or termination code trees corresponding to the basic codebook or basic code tree T k (k=0, 1, ..., K-1) is composed of a triplet of a symbol string, a codeword, and the next codebook or code tree to be used, and is assigned a codeword mode, which is a set of codewords. k The expanded codeword of the basic codebook or basic code tree T k The codebook or the code tree ∼T satisfies the condition that the prefix of the codeword is one of the codewords included in the codeword mode assigned to the k (L)(k=0, …, K-1, L=L min , …, L max ) is composed of a triplet of a symbol string, a codeword, and a codebook or code tree to be used next, and is assigned a codeword mode, which is a set of codewords. k The codeword mode assigned to (L) is the corresponding basic codebook or basic code tree T k The codeword mode is the same as the codeword mode assigned to the termination codebook or termination code tree T k All of the codebooks or code trees to be used next included in (L) are the starting codebooks or starting code trees, and the terminating codebooks or terminating code trees to T k The code words included in (L) are the code words of the termination codebook or termination code tree T k (L) is a codeword having a prefix that is one of the codewords in the codeword mode assigned to (L), and the encoding unit performs the following process: (1) initializes a counter B, sets the starting codebook or starting code tree to the current codebook or code tree, and sets the input symbol string to the current symbol string; (2) uses the current codebook or code tree to compare the current symbol string with the symbol string included in the codebook or code tree, obtains a codeword corresponding to the symbol string σ included in the current codebook or code tree that matches the prefix of the current symbol string for the longest period, sets the symbol string obtained by excluding the prefix that matches the symbol string σ from the current symbol string to the current symbol string, and increments the counter B by the length of the codeword corresponding to the symbol string σ; and (α) B CW -L max ​If , the next codebook or code tree to be used corresponding to the symbol string σ is set as the current codebook or code tree, and (β)B CW >B≧B CW -L max If so, the next codebook or code tree T k and obtain the codebook or code tree T k The corresponding termination codebook or termination code tree ~T k (B CW -B) is the current codebook or code tree, and (γ)B=B CW (3) if the length of the current symbol string obtained by the process of (2) is 0, outputting a code word obtained by concatenating all code words obtained by the process of (2) as the output code word and terminating the encoding process, while otherwise returning to the process of (2).

[0296] [4] A decoding device that receives as input a codeword to be decoded (hereinafter referred to as input codeword) and outputs a symbol string corresponding to the input codeword (hereinafter referred to as output symbol string), comprising: a decoding unit that obtains symbol strings corresponding to codewords that constitute the input codeword using a plurality of codebooks or code trees (where the plurality of codebooks or code trees are the same as the plurality of codebooks or code trees used in encoding processing to obtain the input codeword), and outputs a symbol string obtained by concatenating the obtained symbol strings as the output symbol string; the plurality of codebooks or code trees are composed of a plurality of base codebooks or base code trees and a plurality of terminating codebooks or terminating code trees; the plurality of base codebooks or base code trees and the plurality of terminating codebooks or terminating code trees are composed of pairs including at least a symbol string and a codeword; the symbol strings included in the plurality of base codebooks or base code trees are all the same length; a plurality of termination codebooks or termination code trees correspond to one basic codebook or basic code tree, and all of the codewords included in each of the termination codebooks or termination code trees corresponding to the basic codebook or basic code tree have the same length, but the lengths differ between the plurality of termination codebooks or termination code trees; a codeword included in a termination codebook or termination code tree has any codeword included in the basic codebook or basic code tree corresponding to the termination codebook or termination code tree as a prefix, or is a prefix of any codeword included in the basic codebook or basic code tree corresponding to the termination codebook or termination code tree; the decoding unit obtains a symbol string corresponding to a codeword constituting the input codeword using any of the plurality of basic codebooks or basic code trees, or the plurality of termination codebooks or termination code trees, and obtains the output symbol string by repeating a process of using any of the plurality of basic codebooks or basic parse trees, or the plurality of termination codebooks or termination code trees as the codebook or code tree to be used next;A decoding device in which, when a termination codebook or termination code tree is used, the next codebook or code tree to be used is a predetermined base codebook or base code tree (wherein the base codebook or base code tree is the same as the base codebook or base code tree that was first used in the encoding process to obtain the input codeword, and is hereinafter referred to as a start codebook or start code tree), and the next codebook or code tree to be used becomes the start codebook or start code tree at a predetermined cycle.

[0297] [5] The decoding device according to [4], CW is a predetermined codeword length representing a repetition unit of decoding (where the predetermined codeword length is equal to the predetermined codeword length representing the repetition unit of encoding used in the encoding process to obtain the input codeword), B is a counter for counting the codeword length processed in the decoding process in the repetition unit, L max is the maximum length of the codewords included in the plurality of termination codebooks or termination code trees, and a start codebook or start code tree is a basic codebook or basic code tree used in the first decoding in the repetition unit, and the decoding unit is CW -L max In decoding when (β) B, a process of obtaining a symbol string corresponding to a codeword constituting the input codeword using one of the plurality of basic codebooks or basic code trees, and using one of the plurality of basic codebooks or basic code trees as a codebook or code tree to be used next; CW >B≧B CW -L max In decoding when (γ)B=B, a process of obtaining a symbol string corresponding to a codeword constituting the input codeword using one of the plurality of basic codebooks or basic code trees, and using one of the plurality of termination codebooks or termination code trees as the codebook or code tree to be used next is performed. CW and in decoding when the input codeword is a starting codebook or a starting code tree, the output symbol string is obtained by repeatedly executing the repetition unit consisting of the steps of: obtaining a symbol string corresponding to a codeword constituting the input codeword using any of the plurality of termination codebooks or termination code trees; and setting the starting codebook or starting code tree as the codebook or code tree to be used next. ​

[0298] [6] The decoding device according to [5], k} k=0 K-1 (where K is an integer of 2 or more) to the plurality of basic codebooks or basic code trees, k (L)(k=0, …, K-1, L=L min , …, L max (where L represents the length of the codeword contained in the termination codebook or termination code tree, and L min , L max is L min <L max (an integer greater than or equal to 1)) is used as the basic codebook or basic code tree T k Multiple termination codebooks or termination code trees corresponding to the basic codebook {T k} k=0 K-1 , terminating codebook {~T k (L min ), …, ~T k (L max )} k=0 K-1 are the same as the basic codebook or basic code tree, and the termination codebook or termination code tree used in the encoding process to obtain the input codeword, respectively), and k (k=0, 1, ..., K-1) is composed of a triplet of a symbol string, a codeword, and the next codebook or code tree to be used, and is assigned a codeword mode, which is a set of codewords. k The expanded codeword of the basic codebook or basic code tree T k The codebook or the code tree ∼T satisfies the condition that the prefix of the codeword is one of the codewords included in the codeword mode assigned to the k (L)(k=0, …, K-1, L=L min , …, L max ) is composed of a triplet of a symbol string, a codeword, and a codebook or code tree to be used next, and is assigned a codeword mode, which is a set of codewords. kThe codeword mode assigned to (L) is the corresponding basic codebook or basic code tree T k The codeword mode is the same as the codeword mode assigned to the termination codebook or termination code tree T k All of the codebooks or code trees to be used next included in (L) are the starting codebooks or starting code trees, and the terminating codebooks or terminating code trees to T k The code words included in (L) are the code words of the termination codebook or termination code tree T k (L) is a codeword having a prefix of any one of the codewords in the codeword modes assigned to (L), and the decoding unit performs the following processes: (1) initializes a counter B, sets the starting codebook or starting code tree to the current codebook or code tree, and sets the input codeword to the current codeword; and (2) uses the current codebook or code tree to compare the current codeword with the codewords included in the codebook or code tree, and finds the codeword w included in the current codebook or code tree that has the longest match with the prefix of the current codeword (where the codeword w is a codeword of a predetermined length B), CW If there exists a codeword that satisfies the condition that (α)B is less than or equal to the length of the codeword w, and if there exists a codeword that corresponds to the codeword mode assigned to the codebook or code tree to be used next and that matches the prefix of the codeword obtained by excluding the prefix that matches the codeword w from the current codeword, obtain a symbol string corresponding to the codeword w, set the codeword obtained by excluding the prefix that matches the codeword w from the current codeword as the current codeword, and increment the counter B by the length of the codeword w, CW -L max If so, the next codebook or code tree corresponding to the codeword w is set as the current codebook or code tree, and (β)B CW >B≧B CW -L max If so, the next codebook or code tree T k and obtain the codebook or code tree T k The corresponding termination codebook or termination code tree ~T k (B CW -B) is the current codebook or code tree, and (γ)B=B CW ​(3) if the length of the current codeword obtained by the process of (2) is 0, outputting a symbol string obtained by concatenating all symbol strings obtained by the process of (2) as the output symbol string and terminating the decoding process, while otherwise returning to the process of (2).

[0299] [7] A coding method in which a coding device receives as input a symbol string to be coded (hereinafter referred to as an input symbol string) and outputs a codeword corresponding to the input symbol string (hereinafter referred to as an output codeword), the method comprising: a coding step in which the coding device obtains a codeword corresponding to a symbol string constituting the input symbol string using a plurality of codebooks or code trees, and outputs a codeword obtained by concatenating the obtained codewords as the output codeword; the plurality of codebooks or code trees are composed of a plurality of base codebooks or base code trees and a plurality of terminating codebooks or terminating code trees; the plurality of base codebooks or base code trees and the plurality of terminating codebooks or terminating code trees are composed of pairs including at least a symbol string and a codeword; all of the symbol strings included in the plurality of base codebooks or base code trees have the same length; a plurality of terminating codebooks or terminating code trees correspond to one base codebook or base code tree, and all of the codewords included in the terminating codebooks or terminating code trees corresponding to the base codebook or base code tree have the same length, but the lengths are different between the plurality of terminating codebooks or terminating code trees; a codeword included in a termination codebook or termination code tree has as its prefix any one of codewords included in a base codebook or base code tree corresponding to the termination codebook or termination code tree, or is a prefix of any codeword included in a base codebook or base code tree corresponding to the termination codebook or termination code tree, and the encoding step obtains the output codeword by using any one of the plurality of base codebooks or base code trees or the plurality of termination codebooks or termination code trees to obtain a codeword corresponding to a symbol string constituting the input symbol string, and repeating a process of setting any one of the plurality of basic codebooks or basic analytic trees or the plurality of termination codebooks or termination code trees as a codebook or code tree to be used next, and when a termination codebook or termination code tree is used, the codebook or code tree to be used next is a predetermined base codebook or basic code tree (hereinafter referred to as a start codebook or start code tree), and the codebook or code tree to be used next becomes the start codebook or start code tree at a predetermined cycle.

[0300] [8] A decoding method in which a decoding device receives as input a codeword to be decoded (hereinafter referred to as input codeword) and outputs a symbol string corresponding to the input codeword (hereinafter referred to as output symbol string), the method comprising: a decoding step in which the decoding device obtains symbol strings corresponding to codewords constituting the input codeword using a plurality of codebooks or code trees (where the plurality of codebooks or code trees are the same as the plurality of codebooks or code trees used in encoding processing to obtain the input codeword), and outputs a symbol string obtained by concatenating the obtained symbol strings as the output symbol string; the plurality of codebooks or code trees are composed of a plurality of base codebooks or base code trees and a plurality of terminating codebooks or terminating code trees; the plurality of base codebooks or base code trees and the plurality of terminating codebooks or terminating code trees are composed of pairs including at least a symbol string and a codeword; the symbol strings included in the plurality of base codebooks or base code trees are all the same length; a plurality of termination codebooks or termination code trees correspond to one basic codebook or basic code tree, and all of the codewords included in each of the termination codebooks or termination code trees corresponding to the basic codebook or basic code tree have the same length, but the lengths differ among the plurality of termination codebooks or termination code trees; a codeword included in a termination codebook or termination code tree has any codeword included in the basic codebook or basic code tree corresponding to the termination codebook or termination code tree as a prefix, or is a prefix of any codeword included in the basic codebook or basic code tree corresponding to the termination codebook or termination code tree; the decoding step obtains a symbol string corresponding to a codeword constituting the input codeword using any of the plurality of basic codebooks or basic code trees, or the plurality of termination codebooks or termination code trees, and obtains the output symbol string by repeating a process of using any of the plurality of basic codebooks or basic parse trees, or the plurality of termination codebooks or termination code trees as the codebook or code tree to be used next;a decoding method in which, when a termination codebook or termination code tree is used, the next codebook or code tree to be used is a predetermined base codebook or base code tree (wherein the base codebook or base code tree is the same as the base codebook or base code tree that was first used in the encoding process to obtain the input codeword, and is hereinafter referred to as a start codebook or start code tree), and the next codebook or code tree to be used becomes the start codebook or start code tree at a predetermined cycle.

[0301] [9] A program for causing a computer to function as either the encoding device according to any one of [1] to [3] or the decoding device according to any one of [4] to [6].

[0302] <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.

[0303] 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.

[0304] 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.

[0305] 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 18, and operating the control unit 2010, input unit 2030, output unit 2040, display unit 2050, etc.

[0306] 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.

[0307] 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.

[0308] 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).

[0309] 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.

[0310] 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 coding device that receives as input a symbol string to be coded (hereinafter referred to as an input symbol string) and outputs a codeword corresponding to the input symbol string (hereinafter referred to as an output codeword), comprising: a coding unit that obtains codewords corresponding to symbol strings that constitute the input symbol string using a plurality of codebooks or analytic trees, and outputs a codeword obtained by concatenating the obtained codewords as the output codeword; the plurality of codebooks or analytic trees are composed of a plurality of base codebooks or base analytic trees and one or more terminating codebooks or analytic trees; the plurality of base codebooks or base analytic trees and the one or more terminating codebooks or analytic trees are composed of pairs including at least symbol strings and codewords; all of the codewords included in the plurality of base codebooks or base analytic trees have the same length; and all of the codewords included in the one or more terminating codebooks or analytic trees have the same length; The encoding unit obtains the output codeword by repeating a process of obtaining a codeword corresponding to a symbol string constituting the input symbol string using any of the plurality of basic codebooks or basic analytic trees, or any of the one or more termination codebooks or termination analytic trees, as the codebook or analytic tree to be used next, wherein when a termination codebook or termination analytic tree is used, the codebook or analytic tree to be used next is a predetermined basic codebook or basic analytic tree (hereinafter referred to as a starting codebook or starting analytic tree), and the codebook or analytic tree to be used next becomes the starting codebook or starting analytic tree at a predetermined cycle.

2. The encoding device according to claim 1, CW is a predetermined number of times representing a unit of repetition of encoding, and the starting codebook or starting analytic tree is a basic codebook or basic analytic tree used in the first encoding in the unit of repetition, and the encoding unit CW - In the first two encodings, a process of obtaining a codeword corresponding to a symbol string constituting the input symbol string using one of the plurality of basic codebooks or basic analytic trees, and using one of the plurality of basic codebooks or basic analytic trees as a codebook or analytic tree to be used next; and (β) N CW In the first encoding, a codeword corresponding to a symbol string constituting the input symbol string is obtained using one of the plurality of basic codebooks or basic analytic trees, and one of the one or more termination codebooks or termination analytic trees is used as the next codebook or analytic tree; and CW and in the first encoding, a codeword corresponding to a symbol string constituting the input symbol string is obtained using one or more of the one or more termination codebooks or termination analytic trees, and the first codebook or the first analytic tree is used as the codebook or the analytic tree to be used next, thereby obtaining the output codeword.

3. The encoding device according to claim 2, k } k=0 K-1 (where K is an integer of 2 or more) to the plurality of basic codebooks or basic analytic trees, { k } k=0 K-1 is the one or more termination codebooks or termination analytic trees, and the basic codebook or basic analytic tree T k (k=0, 1, ..., K-1) is composed of a triplet of a symbol string, a codeword, and the next codebook or parse tree to be used, and is assigned a symbol string mode, which is a set of symbol strings. k The expansion symbol string of the basic codebook or basic parse tree T k The condition that the prefix of a word is one of the symbol strings included in the symbol string mode assigned to the terminating codebook or the terminating parse tree ~T is satisfied. k (k=0, 1, ..., K-1) is composed of a triplet of a symbol string, a codeword, and the next codebook or parse tree to be used, and is assigned a symbol string mode, which is a set of symbol strings. The terminal codebook or terminal parse tree ~T k The string modes assigned to are the corresponding basic codebooks or basic parse trees T k The symbol string mode is the same as the symbol string mode assigned to the terminal codebook or terminal parse tree ~T. k are the starting codebook or starting analytic tree, and N is a counter for counting the number of times encoding is executed, and the encoding unit performs the following process: (1) initializes counter N, sets the starting codebook or starting analytic tree as the current codebook or analytic tree, and sets the input symbol string as the current symbol string; (2) uses the current codebook or analytic tree to compare the current symbol string with the symbol string included in the codebook or analytic tree, and if there is a symbol string σ included in the current codebook or analytic tree that matches a prefix of the current symbol string, and there is a symbol string included in the symbol string mode assigned to the codebook or analytic tree to be used next that matches a prefix of the current symbol string excluding the prefix matching the symbol string σ from the current symbol string, obtains a codeword corresponding to the symbol string σ, sets the symbol string obtained by excluding the prefix matching the symbol string σ from the current symbol string as the current symbol string, and increments counter N by 1; <N CW If it is -1, the next codebook or parse tree to be used corresponding to the symbol string σ is set as the current codebook or parse tree, and (β)N=N CW If the value is -1, the next codebook or parse tree T corresponding to the symbol string σ is used. k and obtain the codebook or parse tree T k The corresponding termination codebook or termination analytic tree ~T k Let be the current codebook or parse tree, and (γ)N=N CW (3) if the length of the current symbol string obtained by the process in (2) is 0, outputting a codeword obtained by concatenating all codewords obtained by the process in (2) as the output codeword and terminating the encoding process, while otherwise returning to the process in (2).

4. A decoding device that receives as input a codeword to be decoded (hereinafter referred to as input codeword) and outputs a symbol string corresponding to the input codeword (hereinafter referred to as output symbol string), comprising: a decoding unit that obtains symbol strings corresponding to codewords that constitute the input codeword using a plurality of codebooks or analytic trees (wherein the plurality of codebooks or analytic trees are the same as the plurality of codebooks or analytic trees used in the encoding process to obtain the input codeword), and outputs a symbol string obtained by concatenating the obtained symbol strings as the output symbol string; the plurality of codebooks or analytic trees are composed of a plurality of basic codebooks or basic analytic trees and one or more terminating codebooks or analytic trees; the plurality of basic codebooks or basic analytic trees and the one or more terminating codebooks or analytic trees are composed of pairs including at least symbol strings and codewords; all of the codewords included in the plurality of basic codebooks or basic analytic trees have the same length; all of the codewords included in the one or more terminating codebooks or analytic trees have the same length; the decoding unit obtains the output symbol string by repeating a process of using any of the plurality of basic codebooks or basic analytic trees, or any of the one or more termination codebooks or termination analytic trees, to obtain a symbol string corresponding to a codeword constituting the input codeword, and designating any of the plurality of basic codebooks or basic analytic trees, or any of the one or more termination codebooks or termination analytic trees as the codebook or analytic tree to be used next, wherein when a termination codebook or termination analytic tree is used, the codebook or analytic tree to be used next is a predetermined basic codebook or basic analytic tree (however, this basic codebook or basic analytic tree is the same as the basic codebook or basic analytic tree initially used in the encoding process to obtain the input codeword, and will hereinafter be referred to as a starting codebook or starting analytic tree), and the codebook or analytic tree to be used next becomes the starting codebook or starting analytic tree at a predetermined cycle.

5. A decoding device according to claim 4, wherein N CW is a predetermined number of times representing a unit of decoding repetition (where the predetermined number of times is equal to the predetermined number of times representing a unit of encoding repetition used in the encoding process for obtaining the input codeword), the starting codebook or starting analytic tree is a basic codebook or basic analytic tree used in the first decoding in the repetition unit, and the decoding unit CW - In the first two decoding times, a process of obtaining a symbol string corresponding to a codeword constituting the input codeword using one of the plurality of basic codebooks or basic analytic trees, and using one of the plurality of basic codebooks or basic analytic trees as a codebook or analytic tree to be used next; and (β) N CW In the first decoding, a process of obtaining a symbol string corresponding to a codeword constituting the input codeword using one of the plurality of basic codebooks or basic analytic trees, and using one of the one or more termination codebooks or termination analytic trees as a codebook or analytic tree to be used next; and (γ)N CW and in the first decoding, a symbol string corresponding to a codeword constituting the input codeword is obtained using one or more of the one or more termination codebooks or termination analytic trees, and the one or more starting codebooks or starting analytic trees are used as the codebook or analytic tree to be used next, thereby obtaining the output symbol string.

6. A decoding device according to claim 5, k } k=0 K-1 (where K is an integer of 2 or more) to the plurality of basic codebooks or basic parse trees, { k } k=0 K-1 the one or more termination codebooks or termination parse trees (where, k } k=0 K-1 , terminating codebook {~T k } k=0 K-1 are the same as the basic codebook or basic analytic tree, and the termination codebook or termination analytic tree used in the encoding process to obtain the input codeword, respectively), and the basic codebook or basic analytic tree T k (k=0, 1, ..., K-1) is composed of a triplet of a symbol string, a codeword, and the next codebook or parse tree to be used, and is assigned a symbol string mode, which is a set of symbol strings. k The expansion symbol string of the basic codebook or basic parse tree T k The condition that the prefix of a word is one of the symbol strings included in the symbol string mode assigned to the terminating codebook or the terminating parse tree ~T is satisfied. k (k=0, 1, ..., K-1) is composed of a triplet of a symbol string, a codeword, and the next codebook or parse tree to be used, and is assigned a symbol string mode, which is a set of symbol strings. The terminal codebook or terminal parse tree ~T k The string modes assigned to are the corresponding basic codebooks or basic parse trees T k The symbol string mode is the same as the symbol string mode assigned to the terminal codebook or terminal parse tree ~T. k all of the codebooks or analytic trees to be used next included in are the starting codebook or starting analytic tree, N is a counter for counting the number of times decoding is executed, and the decoding unit performs the following process: (1) initializes counter N, sets the starting codebook or starting analytic tree as the current codebook or analytic tree, and sets the input codeword as the current codeword; (2) uses the current codebook or analytic tree to compare the current codeword with the codeword included in the codebook or analytic tree, obtains a symbol string corresponding to codeword w included in the current codebook or analytic tree that matches the prefix of the current codeword, sets the codeword obtained by removing the prefix that matches codeword w from the current codeword as the current codeword, and increments counter N by 1; (α)N <N CW If it is -1, the next codebook or parse tree corresponding to the codeword w is set as the current codebook or parse tree, and (β)N=N CW If the value is -1, the next codebook or parse tree T corresponding to the codeword w is used. k and obtain the codebook or parse tree T k The corresponding termination codebook or termination analytic tree ~T k Let be the current codebook or parse tree, and (γ)N=N CW (3) if the length of the current codeword obtained by the process in (2) is 0, outputting a symbol string obtained by concatenating all symbol strings obtained by the process in (2) as the output symbol string and terminating the decoding process, while otherwise returning to the process in (2).

7. A coding method in which a coding device receives as input a symbol string to be coded (hereinafter referred to as an input symbol string) and outputs a codeword corresponding to the input symbol string (hereinafter referred to as an output codeword), the method comprising: a coding step in which the coding device obtains codewords corresponding to symbol strings that constitute the input symbol string using a plurality of codebooks or analytic trees, and outputs a codeword obtained by concatenating the obtained codewords as the output codeword; the plurality of codebooks or analytic trees are composed of a plurality of base codebooks or base analytic trees and one or more terminating codebooks or analytic trees; the plurality of base codebooks or base analytic trees and the one or more terminating codebooks or analytic trees are composed of pairs including at least symbol strings and codewords; all of the codewords included in the plurality of base codebooks or base analytic trees have the same length; all of the codewords included in the one or more terminating codebooks or analytic trees have the same length; the encoding step obtains a codeword corresponding to a symbol string constituting the input symbol string using any of the plurality of basic codebooks or basic analytic trees, or any of the one or more termination codebooks or termination analytic trees, and obtains the output codeword by repeating a process of selecting any of the plurality of basic codebooks or basic analytic trees, or any of the one or more termination codebooks or termination analytic trees as the codebook or analytic tree to be used next, wherein when a termination codebook or termination analytic tree is used, the codebook or analytic tree to be used next is a predetermined basic codebook or basic analytic tree (hereinafter referred to as a starting codebook or starting analytic tree), and the codebook or analytic tree to be used next becomes the starting codebook or starting analytic tree at a predetermined cycle.

8. A decoding method in which a decoding device receives as input a codeword to be decoded (hereinafter referred to as input codeword) and outputs a symbol string corresponding to the input codeword (hereinafter referred to as output symbol string), the decoding method comprising the steps of: obtaining symbol strings corresponding to codewords constituting the input codeword using a plurality of codebooks or analytic trees (wherein the plurality of codebooks or analytic trees are the same as the plurality of codebooks or analytic trees used in the encoding process to obtain the input codeword); and outputting a symbol string obtained by concatenating the obtained symbol strings as the output symbol string; the plurality of codebooks or analytic trees are composed of a plurality of base codebooks or base analytic trees and one or more terminating codebooks or analytic trees; the plurality of base codebooks or base analytic trees and the one or more terminating codebooks or analytic trees are composed of pairs including at least symbol strings and codewords; all of the codewords included in the plurality of base codebooks or base analytic trees have the same length; all of the codewords included in the one or more terminating codebooks or analytic trees have the same length; the decoding step obtains the output symbol string by repeating a process of obtaining a symbol string corresponding to a codeword constituting the input codeword using any of the plurality of basic codebooks or basic analytic trees, or the one or more termination codebooks or termination analytic trees, as the codebook or analytic tree to be used next, wherein when a termination codebook or termination analytic tree is used, the codebook or analytic tree to be used next is a predetermined basic codebook or basic analytic tree (however, this basic codebook or basic analytic tree is the same as the basic codebook or basic analytic tree initially used in the encoding process to obtain the input codeword, and hereinafter referred to as a starting codebook or starting analytic tree), and the codebook or analytic tree to be used next becomes the starting codebook or starting analytic tree at a predetermined cycle.

9. A program for causing a computer to function as either the encoding device according to any one of claims 1 to 3 or the decoding device according to any one of claims 4 to 6.

Citation Information

Patent Citations

  • Coder, decoder, code conversion table generating method, coding method and decoding method

    JP2001086513A

  • Data compression device and data restoring device

    WO2008078390A1