Decoding device, decoding method, and program
The decoding device corrects errors in codebook or analytic tree selection during lossless compression decoding, enabling flexible and efficient decoding from any codeword in a sequence by verifying correctness based on decoding results and verification information.
Patent Information
- Application Number
- PCT/JP2024/004585
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-02-09
- Publication Date
- 2025-08-14
AI Technical Summary
Existing lossless compression coding technologies using multiple codebooks and analytic trees face challenges in decoding intermediate codewords due to the need to identify the correct codebook and analytic tree corresponding to each codeword in a sequence, limiting flexibility and efficiency.
A decoding device and method that allows decoding to start from any codeword in a sequence by verifying the correctness of the codebook or analytic tree used for decoding based on decoding results and verification information, ensuring correct decoding by switching between codebooks or analytic trees as needed.
Enables flexible and efficient decoding of codewords in a sequence by correcting errors in codebook or analytic tree selection, allowing decoding to commence from any intermediate point and improving overall decoding efficiency.
Smart Images

Figure JP2024004585_14082025_PF_FP_ABST
Abstract
Description
Decoding device, decoding method, and program
[0001] The present invention relates to a technique for decoding losslessly compressed and encoded codewords.
[0002] Currently, technologies have been developed for lossless compression coding of finite-precision digital signals and digital data, such as audio signals, image signals, time series signals obtained from various sensors such as brightness sensors, acceleration sensors, and seismometers, character strings, and word strings. Some lossless compression coding technologies output codewords of a fixed length corresponding to an input symbol string. This has the advantage that codewords can be decoded at fixed lengths, making it easier to handle data when performing calculations, searches, and other processing using the codewords as they are without decoding.
[0003] When designing lossless compression coding technology, rules that indicate which codewords should be output for which symbol strings (hereinafter referred to as coding rules) are expressed using codebooks or parse trees. For example, in the case of a coding 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 in 3 bits and maximize the expected length of the symbol string encoded in 3 bits for a randomly given symbol string. To achieve this, it is effective to design a coding 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. Figures 1A and 1B show examples of parse trees and codebooks. Figure 1A is a parse tree that represents a coding rule that is effective when the occurrence probability of symbol a is high, and the codebook in Figure 1B is equivalent to the parse tree in Figure 1A. In the parse tree in Figure 1A, 3-bit codewords are assigned to the terminal nodes, or leaves, and each symbol that makes up the symbol string is assigned to an edge. 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 1A, 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. Figures 2A and 2B are diagrams showing examples of analytic trees and codebooks. Figure 2A is an analytic tree equivalent to Figure 1A, and the codebook in Figure 2B is equivalent to the analytic tree in Figure 2A. The analytic tree in Figure 2A 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 2A, 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 FIGS. 2A and 2B, 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] On the other hand, the former conventional method, in which the length of codewords is constant and the coding rules are expressed by a single codebook or parse tree, has an important property that decoding is possible even if decoding is started from an intermediate codeword in the input codeword sequence (input codeword sequence).
[0008] In contrast, the latter conventional method, in which coding rules are expressed using multiple codebooks and analytic trees, has high compression efficiency but has a problem in that decoding cannot be started from an intermediate codeword in an input codeword sequence. That is, to perform decoding using the latter conventional method, it is necessary to identify a codebook and an analytic tree corresponding to each codeword in an input codeword sequence. Here, the codebook and analytic tree corresponding to the first codeword are predetermined, but the codebooks and analytic trees corresponding to subsequent codewords are identified based on the decoding of the immediately preceding codeword. Therefore, in order to decode intermediate codewords, it is necessary to start decoding from the first codeword and then track the switching of the codebooks and analytic trees corresponding to each codeword. Therefore, it is not possible to simply start decoding from an intermediate codeword.
[0009] Therefore, the present invention provides a technique that allows decoding to start from a codeword in the middle of a codeword sequence in a coding method in which coding rules are expressed using a plurality of codebooks or parse trees.
[0010] The decoding device decodes a plurality of codewords included in an input codeword sequence using a plurality of codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded. In this process, the decoding device verifies the correctness of the codebook or analytic tree used for decoding based on a decoding result obtained by a process of decoding at least one of a plurality of codewords while switching the codebook or analytic tree used for decoding according to a predetermined rule.
[0011] This allows decoding to start from a codeword in the middle of a codeword sequence in a coding method where the coding rules are expressed using multiple codebooks or parse trees.
[0012] FIG. 1A is a diagram showing an example of an analytic tree. FIG. 1B is a diagram showing an example of a codebook. FIG. 2A is a diagram showing an example of an analytic tree. FIG. 2B is a diagram showing an example of a codebook. FIG. 3 is a block diagram illustrating the configuration of an encoding device. FIG. 4 is a block diagram illustrating the configuration of a decoding device. FIGS. 5A and 5B are diagrams showing an example of a codebook. FIG. 6 is a flowchart illustrating the operation of an encoding device. FIG. 7 is a flowchart illustrating the operation of a decoding device. FIGS. 8A and 8B are diagrams showing an example of a codebook. FIG. 9 is a diagram showing an example of a codebook. FIG. 10 is a diagram showing an example of a codebook. FIG. 11 is a diagram showing an example of a codebook. FIG. 12 is a block diagram illustrating the configuration of an encoding device. FIG. 12 is a flowchart illustrating the operation of an encoding device. FIG. 14 is a block diagram illustrating the configuration of a decoding device. FIG. 15 is a flowchart illustrating the operation of a decoding device. FIG. 16 is a diagram showing an example of a codebook. FIG. 17 is a diagram showing an example of a codebook. FIG. 18 is a diagram showing an example of a codebook. FIG. 19 is a diagram showing an example of a codebook. Fig. 20 is a diagram showing an example of a codebook, Fig. 21 is a diagram showing an example of a codebook, and Fig. 22 is a diagram showing an example of the functional configuration of a computer that realizes each device in the embodiment of the present invention.
[0013] Embodiments of the present invention will be described below. [First Embodiment] First, the first embodiment will be described. An encoding device of this embodiment encodes multiple symbol strings included in an input symbol string (input symbol string) using multiple codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded. In this case, the encoding device of this embodiment encodes each of the multiple symbol strings while switching between codebooks or analytic trees used for encoding according to a predetermined rule, and outputs verification information that depends on the history of switching between codebooks or analytic trees. For example, the encoding device outputs a codeword sequence that includes multiple codewords obtained by encoding each of the multiple symbol strings while switching between codebooks or analytic trees used for encoding according to a predetermined rule, and verification information that depends on the history of switching between codebooks or analytic trees.
[0014] The decoding device of this embodiment decodes multiple codewords included in an input codeword sequence (input codeword sequence) using multiple codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded. In this case, the decoding device of this embodiment verifies the correctness of the codebook or analytic tree used for decoding based on a decoding result obtained by a process of decoding at least one of the multiple codewords while switching the codebook or analytic tree used for decoding according to a predetermined rule. For example, the decoding device of this embodiment verifies the correctness of the codebook or analytic tree used for decoding based on the decoding result and verification information that depends on the correct codebook or analytic tree for decoding. For example, the decoding device verifies the correctness of the codebook or analytic tree used for decoding based on the decoding result and verification information that depends on a history of switching the correct codebook or analytic tree for decoding. Such verification information is included, for example, in the input codeword sequence.
[0015] The decoding device of this embodiment verifies the correctness of the codebook or analytic tree used for decoding. Therefore, even if it is not possible to identify a codebook or analytic tree corresponding to a codeword in the middle of a codeword sequence, it is possible to detect whether the codebook or analytic tree used to decode that codeword was correct. If the codebook or analytic tree used to decode that codeword was correct, it is determined that the decoding was correct. On the other hand, if the codebook or analytic tree used for decoding was incorrect, the codebook or analytic tree for decoding that codeword can be changed and the decoding can be performed again. By repeating this process until it is determined that the codebook or analytic tree used is correct, correct decoding can be performed. As a result, in this embodiment, decoding can be started from a codeword in the middle of a codeword sequence in a coding method in which a coding rule is expressed using multiple codebooks or analytic trees.
[0016] Here, a symbol is an element of a set consisting of a finite number of elements, and may be text consisting of letters or words, such as a, b, and c, which are elements of the alphabet set {a, b, c}. A symbol string is a string made up of symbols lined up in a row, and for example, baaa is a symbol string of length 4 for two symbols {a, b}. An example of a symbol string is the following series of numbers converted to finite precision by quantization or the like. (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 a discrete Fourier transform, a discrete cosine transform, a modified discrete cosine transform, or the like 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 predictive analysis of the signal in (1); or (4) A series of features obtained by inputting the signal in (1) into a neural network. In other words, the symbol string is, for example, a series of finite-precision digital signals or a series of digital data. The input symbol string input to the encoding device of this embodiment is a symbol string to be encoded. The input symbol string of this embodiment includes a plurality of symbol strings.
[0017] A codeword is a string made up of at least one of two codes (e.g., codes {0, 1}) lined up. For example, 001 is a codeword with a length (code length) of 3. The length of codewords in this embodiment is constant. A codeword sequence is a string made up of one or more codewords lined up. For example, 001101111110 is a string made up of four codewords 001, 101, 111, and 110 lined up. The input codeword sequence input to the decoding device of this embodiment is the codeword sequence to be decoded. The input codeword sequence of this embodiment includes multiple codewords.
[0018] Codebooks and parse trees represent correspondences between symbol strings and codewords. This allows an encoder to identify the codeword that corresponds to a symbol string, and a decoder to identify the symbol string that corresponds to a codeword. The encoder and decoder must use the same codebook or parse tree.
[0019] In this embodiment, multiple codebooks or analytic trees are used. For example, multiple different codebooks or analytic trees are used. The encoding device encodes each of multiple symbol strings while switching between codebooks or analytic trees according to a predetermined rule to obtain multiple codewords. The decoding device decodes each of multiple codewords while switching between codebooks or analytic trees according to a predetermined rule to obtain multiple symbol strings. The codebook or analytic tree switching may be performed for each codeword or for multiple codewords. However, when decoding each codeword, the decoding device must use the same codebook or analytic tree as the one used to obtain each codeword in the encoding device. Therefore, the decoding device must reproduce the codebook or analytic tree switching performed in the encoding device. The predetermined rule may be any rule that allows the decoding device to reproduce such codebook or analytic tree switching. For example, the predetermined rule may determine the codebook or analytic tree to be used for encoding another symbol string based on the encoding process of a symbol string, and the codebook or analytic tree to be used for decoding another codeword based on the decoding process of a codeword. For example, the predetermined rule determines the codebook or parse tree to be used for encoding the next symbol string based on the encoding process of the symbol string, and determines the codebook or parse tree to be used for decoding the next code word based on the decoding process of the code word. Specific examples of the predetermined rule will be described later.
[0020] The verification information may be any information that depends on the history of switching of such codebooks or analytic trees. In other words, the verification information may be any information that depends on the history of switching of correct codebooks or analytic trees for decoding. In other words, the verification information may be any information that depends on the history of switching of correct codebooks or analytic trees for decoding. For example, the verification information may represent the history of switching of codebooks or analytic trees, or may represent information corresponding to the history of switching of codebooks or analytic trees. For example, the verification information may represent the history of switched codebooks or analytic trees, or may represent information according to the history of switching of codebooks or analytic trees, or may represent the history of information that determines the switching of codebooks or analytic trees, or may represent a function value of information that determines the switching of codebooks or analytic trees. The verification information may or may not be included in a codeword sequence output from an encoding device (output codeword sequence). Furthermore, the verification information may or may not be included in a codeword sequence input to a decoding device (input codeword sequence). Specific examples of verification information will be described later.
[0021] This embodiment will be described below with reference to the drawings. Although the following mainly describes an example in which a coding rule is expressed by a codebook, there is no difference in the encoding procedure / decoding procedure even if the coding rule is expressed by an analytic tree. In other words, the codebook in the encoding procedure / decoding procedure described below may be replaced with an analytic tree.
[0022] 3, the encoding device 11 of this embodiment has an encoding processing unit 111 and a storage unit 119. As shown in FIG. 4, the decoding device 12 of this embodiment has a decoding processing unit 121 and a storage unit 129.
[0023] <Pre-processing> A plurality of codebooks T are stored in the storage unit 119 of the encoding device 11 (FIG. 3) and the storage unit 129 of the decoding device 12 (FIG. 4) of this embodiment. k (k=0, 1, ..., K-1) is stored, where K is an integer equal to or greater than 2. As mentioned above, the codebook T krepresents the correspondence between symbol strings and code words, and is, for example, a set of pairs of symbol strings and code words. k The code length of the codewords stored in is constant. Figures 5A and 5B show examples of the codebook T0 and the codebook T1 of this embodiment when K=2.
[0024] <Encoding Process> The encoding process of this embodiment will be illustrated with reference to Fig. 3 and Fig. 6. An input symbol string, which is a symbol string to be encoded, is input to the encoding processing unit 111 of the encoding device 11 (Fig. 3) of this embodiment. The input symbol string of this embodiment includes a plurality of symbol strings. The encoding processing unit 111 uses a plurality of codebooks T k The codeword sequence is a set of multiple codewords C obtained by encoding multiple symbol strings included in the input symbol string. j (j=0, 1, ..., J-1), where J is an integer equal to or greater than 2. In this case, the encoding processing unit 111 uses the codebook T k are coded by switching between them according to a predetermined rule, and the codebook T k The verification information in this embodiment is, for example, the codebook T used to encode the symbol string included in the input symbol string. k The codeword TC representing k For example, the codeword TC k is a sequence of at least two codes (e.g., code {0, 1}) arranged ceil(log2K) times. For example, the codeword C k is a sequence of at least one of the two codes ceil(log2K) times. Here, ceil(α) is a ceiling function, which represents the smallest integer equal to or greater than α for a real number α. For example, when K=2, the codeword TC k is a string made up of one of the two codes. For example, TC0=0 and TC1=1. For example, the encoding processing unit 111 encodes U code words C j' ,…, C j'+U-1 Each time we obtain a codeword, we use the codebook T k The codeword TC representing kand the codeword TC k Alternatively, for example, the encoding processing unit 111 may use a sequence of U code words C j' ,…, C j'+U-1 Each time we obtain a codeword C j' ,…, C j'+U-1 The codebook T used to obtain either k (code word C j' ,…, C j'+U-1 The codebook T used for encoding to obtain either k ) codeword TC k and the codeword TC k For example, the encoding processing unit 111 may generate a sequence of U code words C j' ,…, C j'+U-1 Each time we get the final codeword C j'+U-1 The codebook T used to obtain k The codeword TC representing k and the codeword TC k may be used as verification information. U is a predetermined positive integer, j'∈{0, 1,..., J-U}, and {j',..., j'+U-1}⊆{0, 1,..., J-1}. Note that "U codewords C j' ,…, C j'+U-1 The condition "every time U encoding is performed" can be rephrased as "every time the sum of the code lengths of the obtained code words becomes U*B", where B is a positive integer representing the code length of the code word. The encoding processing unit 111 performs the encoding of the code words C0, ..., C J-1 For example, the encoding unit 111 may obtain and output a codeword sequence including codewords C0, ..., C J-1 and the verification information codeword TC k For example, the encoding processing unit 111 may obtain and output a codeword sequence including the codeword C j' ,…, C j'+U-1 After arranging the code words, the codebook T k The codeword TC representing k For example, the encoding processing unit 111 may obtain and output a codeword sequence including a sequence obtained by arranging the codewords C0, ..., CJ-1 Codeword C contained in j' ,…, C j'+U-1 After the sequence (j'=0, U, 2U, ..., θ*U), the codeword C j' ,…, C j'+U-1 The codebook T used to obtain the next codeword of k The codeword TC representing k Alternatively, the codeword sequence obtained by inserting j' ,…, C j'+U-1 The codebook T used to obtain either k The codeword TC representing k For example, the encoding processing unit 111 may obtain and output a codeword sequence including a sequence obtained by arranging the codewords C0, ..., C J-1 Codeword C contained in j' ,…, C j'+U-1 After the sequence (j'=0, U, 2U, ..., θ*U), the codeword C j' ,…, C j'+U-1 The codebook T used for encoding to obtain either k The codeword TC representing k Here, θ is an integer equal to or greater than 0, and satisfies 0≦θ*U+U−1≦J−1. For example, θ*U+U=J. That is, for example, the encoding processing unit 111 may insert a codebook T k The codewords C are obtained by encoding each of the symbol strings while switching between them according to a predetermined rule. j and codebook T k The verification information depends on the switching history of the codeword TC k and outputting a codeword sequence including the above (step S111).
[0025] <Example of Encoding Process> An example of the encoding process of this embodiment will be described. (Step S111a) The encoding processing unit 111 of the encoding device 11 (FIG. 3) selects a predetermined codebook T kis used as the current codebook and encoding is started, where k is an arbitrary integer between 0 and K-1, for example, k=0. Furthermore, the encoding processing unit 111 sets the input symbol string as the current symbol string.
[0026] (Step S111b) The encoding unit 111 uses the current codebook to compare the current symbol string with the symbol string contained in the current codebook. The encoding unit 111 selects the symbol string (hereinafter referred to as symbol string v) that matches the prefix of the current symbol string longest from the symbol strings contained in the current codebook, and obtains a codeword corresponding to the symbol string v. The encoding unit 111 also determines the symbol string obtained by removing prefixes of the current symbol string v from the prefixes of the current symbol string as the current (new current) symbol string. The encoding unit 111 then switches to the current codebook in accordance with a predetermined rule. This predetermined rule may be any rule that can be reproduced by the decoding device 12. The predetermined rule is, for example, a rule that determines the next codebook (new current codebook) to be used for encoding the next symbol string (new current symbol string) based on the encoding process of the current symbol string. For example, the codebook T shown in FIGS. 5A and 5B k When (k=0, 1), the encoding processing unit 111 switches the current codebook as follows (hereinafter referred to as an example of a predetermined rule): (i) If the current codebook does not contain any other symbol strings beginning with the above-mentioned symbol string v, the next codebook is set to T0. (ii) If the current codebook contains any other symbol strings beginning with the above-mentioned symbol string v, the next codebook is set to T1. Furthermore, every time a codeword is obtained U times, the encoding processing unit 111 outputs a codeword representing the current codebook as verification information.
[0027] (Step S111c) If the length of the current symbol string obtained by the process of (step S111b) is 0, the encoding processing unit 111 outputs the codeword sequence obtained by concatenating all the codewords obtained by the process of (step S111b) and the verification information as described above, and ends the encoding process. On the other hand, if not, the process returns to the process of (step S111b).
[0028] <Specific Example of Encoding Process> The encoding processing unit 111 encodes the codebook Tk An example will be described in which an input symbol string aaabbbcca is encoded using (k=0, 1), and a codeword representing the current codebook is output as verification information every time a codeword is obtained twice (every time the total code length of the obtained codewords becomes 6 bits). Here, the codeword representing codebook T0 is set to 0, and the codeword representing codebook T0 is set to 1. Also, it is assumed that the codebook is switched according to the example of the predetermined rule described above.
[0029] The encoding processing unit 111 starts encoding using codebook T0 as the current codebook. The input symbol string aaabbbcca is set as the current symbol string (step S111a). The encoding processing unit 111 selects the symbol string aaa that has the longest match with the prefix of the current symbol string aaabbbcca from among the symbol strings included in the current codebook T0, and obtains and outputs the codeword 000 corresponding to the symbol string aaa. The encoding processing unit 111 sets the symbol string bbbcca, which is obtained by removing prefixes of the current symbol string aaabbbcca that match the symbol string aaa, as the current symbol string. Since there are no other symbol strings beginning with the symbol string aaa in the current codebook T0, the encoding processing unit 111 sets the current codebook to T0 (step S111b).
[0030] Because the length of the current symbol string bbbcca is not 0 (step S111c), the encoding unit 111 selects the symbol string b that has the longest match with the prefix of the current symbol string bbbcca from the symbol strings included in the current codebook T0, obtains and outputs codeword 101 corresponding to symbol string b. The encoding unit 111 then determines the current symbol string to be bbcca, which is the symbol string of the current symbol string bbbcca minus prefixes that match symbol string b. Furthermore, because the current codebook T0 contains another symbol string ba beginning with symbol string b, the encoding unit 111 switches the current codebook to T1. Furthermore, because the codeword was obtained twice (because the total code length of the obtained codewords 000 and 101 is 6 bits), the encoding unit 111 outputs codeword 1 representing the current codebook T1 as verification information (step S111b).
[0031] Because the length of the current symbol string bbcca is not 0 (step S111c), the encoding processing unit 111 selects, from the symbol strings included in the current codebook T1, the symbol string bb that has the longest match with the prefix of the current symbol string bbcca, and obtains and outputs the codeword 101 corresponding to the symbol string bb. The encoding processing unit 111 sets the symbol string cca, which is obtained by removing prefixes that match the symbol string bb from the prefixes of the current symbol string bbcca, as the current symbol string. Furthermore, because the current codebook T1 does not contain any other symbol strings that begin with the symbol string bb, the encoding processing unit 111 switches the current codebook to T0 (step S111b).
[0032] Because the length of the current symbol string cca is not 0 (step S111c), the encoding unit 111 selects the symbol string c that has the longest match with the prefix of the current symbol string cca from the symbol strings included in the current codebook T0, obtains and outputs the codeword 110 corresponding to the symbol string c. The encoding unit 111 determines the symbol string ca, which is the prefix of the current symbol string cca minus the prefixes that match the symbol string c, as the current symbol string. Furthermore, because the current codebook T0 contains another symbol string ba beginning with the symbol string b, the encoding unit 111 switches the current codebook to T1. Furthermore, because two more codewords have been obtained (because the total code length of the obtained codewords 101 and 110 is 6 bits), the encoding unit 111 outputs the codeword 1 representing the current codebook T1 as verification information (step S111b).
[0033] Because the length of the current symbol string ca is not zero (step S111c), the encoding processing unit 111 selects the symbol string ca that has the longest match with the prefix of the current symbol string ca from the symbol strings included in the current codebook T1, and obtains and outputs the codeword 110 corresponding to the symbol string ca. The encoding processing unit 111 sets the symbol string ε, obtained by excluding prefixes that match the symbol string ca from the prefixes of the current symbol string ca, as the current symbol string. Note that ε represents a symbol string with a length of 0. Furthermore, because there are no other symbol strings in the current codebook T1 that begin with the symbol string ca, the encoding processing unit 111 switches the current codebook to T0.
[0034] Since the length of the current symbol string ε is 0, the encoding processing unit 111 outputs the codeword sequence 00010111011101110 obtained by concatenating all the obtained codewords and the verification information, and ends the encoding process (step S111c).
[0035] 4 and 7, the decoding process of this embodiment will be illustrated. An input codeword string, which is a string of codewords to be decoded, is input to the decoding processing unit 121 of the decoding device 12 (FIG. 4) of this embodiment. The input codeword string of this embodiment is a codeword sequence output from the encoding device 11, and is made up of a plurality of codewords C j (j=0, 1, ..., J-1) and verification information. k , and multiple code words C included in the input code word sequence are used. j The decoding unit 121 decodes the codebook T k By switching between multiple codewords C j At this time, the decoding unit 121 decodes a plurality of code words C j Based on the decoding result obtained based on the process of decoding at least one of the above, the codebook T k Verify the correctness of.
[0036] In this embodiment, the codebook T used for decoding is calculated based on the decoding result and the verification information included in the codeword sequence. k For example, the decoding processing unit 121 verifies the correctness of the codebook T k By switching between multiple codewords C j In this process, the decoding unit 121 decodes a plurality of code words C j A codebook T for decoding any other codeword based on the process of decoding any codeword of k For example, the decoding unit 121 identifies a plurality of code words C j Based on the process of decoding the codeword contained in kOn the other hand, the verification information is the codebook T used for encoding the symbol string in the encoding processing unit 111 of the encoding device (FIG. 3). k For example, the verification information is information that depends on the history of switching between the codebooks T k The codeword TC representing k That is, this verification information is information that depends on the history of switching to the correct codebook for decoding, and is information that depends on the correct codebook for decoding. Therefore, the decoding processing unit 121 determines the codebook T used for decoding based on such decoding results and verification information. k That is, the decoding processing unit 121 can verify the correctness of the codebook T k and the codebook T used in the encoding to obtain the codeword represented by the verification information. k The codebook T used for decoding is determined based on whether it matches or not. k For example, the decoding processing unit 121 can verify the correctness of the codebook T k and the codeword TC included in the verification information k The correct codebook T for decoding the particular codeword is k The codebook T used for decoding is determined based on whether it matches or not. k The correctness of the codebook T for decoding a specific codeword obtained from the decoding result can be verified. k is any codeword TC included in the verification information. k The codebook T is represented by k The comparison depends on the codeword sequence generated in the encoding process described above.
[0037] Here, the decoding unit 121 decodes the plurality of codewords C included in the input codeword sequence in the order in which they were coded by the coding unit 111 of the coding device (FIG. 3), for example. j At this time, the decoding processing unit 121 decodes the codebook T k By switching between multiple codewords C jThe predetermined rule is, for example, that the codebook to be used for encoding other symbol strings (for example, the next symbol string) is determined based on the encoding process of the symbol string, and that the codebook to be used for decoding other codewords (for example, the next codeword) is determined based on the decoding process of the codeword. In such a case, the codebook T used when the encoding unit 111 first performs encoding is k If the decoding processing unit 121 has acquired the codebook T k is the codebook T switched by the encoding processing unit 111 according to the predetermined rule. k In other words, in this case, the codebook T used for decoding in the decoding processing unit 121 is equal to k On the other hand, the codebook T used when the encoding unit 111 first performs encoding is correct. k Even if the decoding processing unit 121 has acquired the codebook T k In such a case, the decoding unit 121 arbitrarily selects the codebook T k The only option is to select the selected codebook T k If it is correct, the codebook T k On the other hand, the selected codebook T k If the code is incorrect, the codebook T k In contrast, the decoding processing unit 121 of this embodiment switches the codebook T k Therefore, the decoding processing unit 121 uses the codebook T k is arbitrarily selected to decode the codeword, and the codebook T k The codebook T used for decoding can be switched between the two.k If it is determined that the symbol string obtained by such decoding is correct, then the symbol string obtained by such decoding can be output. k is determined to be incorrect, the codebook T k The code word is decoded by reselecting the codebook T k The code words after that are decoded again while switching the codebook T k This process is performed on the codebook T k is determined to be correct, the correct symbol string can be decoded (step S121).
[0038] <Example of Decoding Process> An example of the decoding process of this embodiment will be described below. Below, an example will be described in which the codeword sequence obtained in step S111c is used as the input codeword sequence. The decoding process of this embodiment differs depending on whether the decoding processing unit 121 of the decoding device 12 ( FIG. 4 ) can obtain information on the codebook to be used for decoding the first codeword to be decoded among multiple codewords included in the input codeword sequence (hereinafter referred to as a "case where the codebook is self-evident") or not (hereinafter referred to as a "case where the codebook is not self-evident"). Examples of cases where the codebook is self-evident include a case where decoding starts from the first codeword included in the input codeword sequence, or a case where decoding starts from the codeword immediately following a codeword for which the correct codebook can be identified by verification information.
[0039] <When the codebook is self-evident> (Step S121a-1) The decoding processing unit 121 of the decoding device 12 (FIG. 4) selects the codebook T to be used for decoding the codeword to be decoded first from among the multiple codebooks stored in the storage unit 129. k is used as the current codebook to start decoding. kis known. For example, k is the same as the codebook number used when the encoding process of the input symbol string was started. The decoding processing unit 121 determines the codeword string obtained by excluding the verification information and the codewords before the codeword to be decoded first from the input codeword string (the codeword sequence obtained in step S111c) as the current codeword. If the codeword to be decoded first is the first codeword, the decoding processing unit 121 determines the input codeword string as the current codeword.
[0040] (Step S121b-1) The decoding processing unit 121 uses the current codebook to compare the current codeword with the codeword contained in the codebook. It obtains a symbol string corresponding to a codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword. The decoding processing unit 121 also determines the codeword obtained by removing the prefix that matches the codeword w from the current codeword as the current codeword. Furthermore, the decoding processing unit 121 switches to the current codebook in accordance with a predetermined rule corresponding to that used by the encoding processing unit 111. This predetermined rule is, for example, a rule for determining the next codebook (new current codebook) to be used for decoding the next codeword (new current codeword) based on the decoding process of the current codeword. For example, the codebook T k For (k=0, 1), the current codebook is switched as in the example of the predetermined rule mentioned above.
[0041] (Step S121c-1) If the length of the current codeword obtained by the process (step S121b-1) is 0, the decoding processing unit 121 outputs the symbol string obtained by concatenating all the symbol strings obtained by the process (step S121b-1) as an output symbol string, and ends the decoding process. On the other hand, in other cases, the process returns to the process (step S121b-1).
[0042] <When the codebook is not obvious> (Step S121a-2) The decoding processing unit 121 of the decoding device 12 (FIG. 4) selects the codebook T to be used for decoding the codeword to be decoded first from among the multiple codebooks stored in the storage unit 129. k is arbitrarily selected and used as the current codebook to start decoding. kis correct or not. The decoding processing unit 121 determines the codeword sequence obtained by excluding codewords before the codeword to be decoded first from the input codeword sequence (the codeword sequence obtained in step S111c) as the current codeword. If the codeword to be decoded first is the first codeword, the decoding processing unit 121 determines the input codeword sequence as the current codeword.
[0043] (Step S121b-2) The decoding unit 121 uses the current codebook to compare the current codeword with the codewords contained in the codebook. A symbol string corresponding to a codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword is obtained. The decoding unit 121 then determines the codeword obtained by removing the prefix that matches codeword w from the current codeword as the current codeword. Furthermore, the decoding unit 121 switches to the current codebook in accordance with a predetermined rule corresponding to that used by the encoding unit 111.
[0044] (Step S121c-2) If the prefix of the current codeword is verification information, the decoding processing unit 121 determines whether the codebook indicated by the verification information matches (is consistent with) the current codebook. If they do not match, the process returns to step S121a-2 and the codebook T k arbitrarily select (e.g., other codebook T k On the other hand, if they match, the code word obtained by removing the verification information at the beginning of the current code word is set as the current code word, and the process proceeds to step S121d-2. If the beginning of the current code word does not contain verification information, the process proceeds to step S121d-2.
[0045] (Step S121d-2) If the length of the codeword obtained by excluding the verification information from the current codeword obtained by the process of (step S121b-2) is 0, the decoding processing unit 121 outputs the symbol string obtained by concatenating all the symbol strings obtained by the process of (step S121b-2) as the output symbol string, and ends the decoding process. On the other hand, otherwise, the process returns to the process of (step S121b-2).
[0046] <Specific Example of Decoding Process> The decoding processing unit 121 decodes the codebook T kAn example of decoding the codeword sequence 00010111011101110 (input codeword sequence) obtained in the specific example of encoding processing described above using (k=0, 1) will be shown.
[0047] <When the codebook is self-evident> The decoding processing unit 121 starts decoding by using, as the current codebook, the codebook T0 used for decoding the codeword to be decoded first from among the multiple codebooks stored in the storage unit 129. The decoding processing unit 121 removes the verification information from the input codeword sequence 00010111011101110 and sets 000101101110110 as the current codeword (step S121a-1).
[0048] The decoding processing unit 121 obtains a symbol string aaa corresponding to the codeword 000 included in the current codebook T0, which matches the prefix 000 of the current codeword 000101101110110. The decoding processing unit 121 also sets the current codeword to be codeword 101101110110, obtained by removing the prefix 000 that matches the current codeword 000 from the current codeword 000101101110110. Furthermore, since there are no other symbol strings in the current codebook T0 that start with the symbol string aaa, the decoding processing unit 121 sets the current codebook to T0 (step S121b-1).
[0049] Because the length of the current codeword 101101110110 is not 0 (step S121c-1), the decoding processing unit 121 obtains a symbol string b corresponding to the codeword 101 included in the current codebook T0, which matches the prefix 101 of the current codeword 101101110110. The decoding processing unit 121 also sets the codeword 101110110, obtained by removing the prefix 101 that matches the current codeword 101 from the current codeword 101101110110, as the current codeword. Because the current codebook T0 contains another symbol string that begins with symbol string b, the decoding processing unit 121 switches the current codebook to T1 (step S121b-1).
[0050] Because the length of the current codeword 101110110 is not 0 (step S121c-1), the decoding processing unit 121 obtains a symbol string bb corresponding to the codeword 101 included in the current codebook T1, which matches the prefix 101 of the current codeword 101110110. The decoding processing unit 121 also sets the current codeword to codeword 110110, obtained by removing the prefix 101 that matches the codeword 101 from the current codeword 101110110. Because there are no other symbol strings in the current codebook T1 that start with the symbol string bb, the decoding processing unit 121 switches the current codebook to T0 (step S121b-1).
[0051] Because the length of the current codeword 110110 is not 0 (step S121c-1), the decoding processing unit 121 obtains a symbol string c corresponding to the codeword 110 included in the current codebook T0, which matches the prefix 110 of the current codeword 110110. The decoding processing unit 121 also determines the codeword 110 obtained by excluding the prefix 110 that matches the current codeword 110 from the current codeword 110110 as the current codeword. Furthermore, because the current codebook T0 contains another symbol string that starts with the symbol string c, the decoding processing unit 121 switches the current codebook to T1 (step S121b-1).
[0052] Because the length of the current codeword 110 is not 0 (step S121c-1), the decoding processing unit 121 obtains a symbol string ca corresponding to the codeword 110 included in the current codebook T1, which matches the prefix 110 of the current codeword 110. The decoding processing unit 121 also determines the codeword η obtained by removing the prefix 110 that matches the current codeword 110 from the current codeword 110 as the current codeword. Note that the codeword η represents a codeword with a length of 0. Because there are no other symbol strings in the current codebook T1 that start with the symbol string ca, the decoding processing unit 121 switches the current codebook to T0 (step S121b-1).
[0053] Since the length of the current codeword η is 0 (step S121c-1), the decoding processing unit 121 outputs the symbol string aaabbbcca obtained by concatenating all the symbol strings obtained by the processing (step S121b-1) as the output symbol string, and terminates the decoding processing.
[0054] <When the Codebook is Not Trivial> First, a case will be illustrated in which decoding begins with the second codeword 101 of the input codeword sequence 00010111011101110, i.e., the fourth bit. The correct codebook for decoding this second codeword 101 is not trivial. Here, it is assumed that the decoding processing unit 121 selects T1 from the multiple codebooks stored in the storage unit 129 as the codebook to be used for decoding the second codeword 101 to be decoded first, and starts decoding with this as the current codebook T1. The decoding processing unit 121 determines the codeword sequence 10111011101110, which is obtained by excluding codewords before the codeword 101 to be decoded first from the input codeword sequence 00010111011101110, as the current codeword (step S121a-2).
[0055] The decoding unit 121 obtains a symbol string bb corresponding to the codeword 101 included in the current codebook T1, which matches the prefix 101 of the current codeword 10111011101110. The decoding unit 121 then determines the current codeword to be 11011101110, which is the current codeword obtained by removing the prefix 101 that matches the current codeword 101 from the current codeword 10111011101110. Since the current codebook T1 does not contain any other symbol strings beginning with the symbol string bb, the decoding unit 121 switches the current codebook to T0 (step S121b-2). Because the prefix 1 of the current codeword 11011101110 is verification information, the decoding unit 121 determines whether the codebook T1 indicated by the verification information matches (is consistent with) the current codebook T0. However, since these do not match (are contradictory), the process returns to step S121a-2, where the codebook to be used for decoding the first codeword is reselected as T0 and the process is repeated again. This results in the correct symbol string bbbcca being obtained. In this case, the codebook indicated by the verification information matches the current codebook.
[0056] Next, an example will be given of a case where decoding starts from the fourth codeword 110, i.e., the 11th bit, of the input codeword sequence 00010111011101110. The correct codebook for decoding this fourth codeword 110 is not obvious. Here, it is assumed that the decoding processing unit 121 selects T1 from the multiple codebooks stored in the storage unit 129 as the codebook to be used for decoding the fourth codeword 110 to be decoded first, and starts decoding as the current codebook T1. The decoding processing unit 121 determines the codeword sequence 1101110, which is obtained by excluding codewords before the codeword 110 to be decoded first from the input codeword sequence 00010111011101110, as the current codeword (step S121a-2).
[0057] The decoding unit 121 obtains a symbol string ca corresponding to the codeword 110 included in the current codebook T1, which matches the prefix 110 of the current codeword 1101110. The decoding unit 121 then determines the codeword 1110, obtained by removing the prefix 110 that matches the current codeword 110 from the current codeword 1101110, as the current codeword. Since the current codebook T1 does not contain any other symbol strings beginning with the symbol string ca, the decoding unit 121 switches the current codebook to T0 (step S121b-2). Because the prefix 1 of the current codeword 1110 is verification information, the decoding unit 121 determines whether the codebook T1 represented by the verification information matches (is consistent with) the current codebook T0. However, since they do not match (are inconsistent), the process returns to step S121a-2, where the codebook used to decode the codeword to be decoded first is reselected as T0, and the process is repeated. This results in the correct symbol string cca being obtained. In this case, the codebook indicated by the verification information matches the current codebook.
[0058] The encoding procedure / decoding procedure using the codebook described above becomes an encoding procedure / decoding procedure using an analytic tree simply by replacing the word "codebook" with "analytic tree."
[0059] <Features of the Present Embodiment> The encoding device of the present embodiment encodes multiple symbol strings included in an input symbol string using multiple codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded. The encoding device of the present embodiment encodes each of the multiple symbol strings while switching between the codebooks or analytic trees used for encoding according to a predetermined rule, and outputs verification information depending on the history of switching between the codebooks or analytic trees. The decoding device of the present embodiment decodes multiple codewords included in an input codeword sequence using multiple codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded. The decoding device of the present embodiment verifies the correctness of the codebook or analytic tree used for decoding based on the verification information and a decoding result obtained by decoding at least one of the multiple codewords while switching between the codebooks or analytic trees used for decoding according to a predetermined rule. This allows the decoding device of the present embodiment to detect that the codebook or analytic tree used for decoding is incorrect if decoding is started using an incorrect codebook or analytic tree, even if it does not know the correct codebook or analytic tree for the codeword to be initially decoded. In such a case, the decoding device of this embodiment simply reselects the codebook or analytic tree of the codeword to be decoded first, performs the decoding, and repeats the process of verifying the correctness of the codebook or analytic tree used for the decoding. As a result, if it is determined that the codebook or analytic tree used for the decoding is correct, the obtained symbol string is also correct. This makes it possible to start decoding from a codeword in the middle of a codeword sequence in a coding method in which coding rules are expressed using multiple codebooks or analytic trees.
[0060] The encoding device may output a codeword sequence including multiple codewords obtained by encoding each of multiple symbol strings while switching the codebook or analytic tree used for encoding according to a predetermined rule, and verification information that depends on the history of switching the codebook or analytic tree. In this case, the decoding device decodes a codeword sequence (input codeword sequence) including multiple codewords and verification information, starting with a codeword at a desired position, and when the position of the verification information is reached, verifies the correctness of the codebook or analytic tree used for decoding up to that point. Here, as the frequency (ratio) of verification information included in the codeword sequence to be decoded increases (e.g., as the aforementioned U decreases), the number of codewords to be decoded before verifying the correctness of the codebook or analytic tree used for decoding can be reduced. Therefore, the higher the frequency of verification information included in the codeword sequence, the faster the decoding speed. On the other hand, as the frequency of verification information included in the codeword sequence increases, the lower the compression efficiency. Therefore, the encoding device may be able to change the frequency of verification information included in the codeword sequence depending on whether to prioritize decoding speed or compression efficiency. For example, the frequency (ratio) of verification information included in the code word sequence in a mode prioritizing decoding speed may be made higher than the frequency (ratio) of verification information included in the code word sequence in a mode prioritizing compression efficiency, and these modes may be switchable.
[0061] Furthermore, when decoding is started from the codeword immediately following the verification information, it is possible to identify the correct codebook or analytic tree to be used for decoding this codeword. In this case, there is no need to verify the correctness of the codebook or analytic tree used for decoding, and therefore the decoding speed is fast. Therefore, if any codebook or analytic tree is consistent as the one to be used first for decoding, it is desirable to start decoding from the codeword immediately following the verification information. However, when decoding is started from the codeword immediately following the verification information, if the frequency of verification information included in the codeword sequence is high, the number of positions at which decoding can be started increases, but the compression efficiency decreases. On the other hand, if the frequency of verification information included in the codeword sequence is low, the number of positions at which decoding can be started decreases. By verifying the correctness of the codebook or analytic tree used for decoding using verification information as in this embodiment, it is possible to perform decoding from any position in the codeword sequence without significantly reducing the compression efficiency.
[0062] [First Modification of First Embodiment] The decoding device may simultaneously perform, by parallel computation or the like, a process of decoding a plurality of codewords while switching the codebook or analytic tree used for decoding according to a predetermined rule, and a process of verifying the correctness of the codebook or analytic tree used for decoding based on the decoding result and verification information.
[0063] [Second Modification of First Embodiment] In the first embodiment, the verification information is exemplified by a sequence of codewords representing the codebook used to encode the symbol string included in the input symbol string. This does not limit the present invention. Any information may be used as the verification information as long as it is information that depends on the history of codebook switching, i.e., information that depends on the correct codebook or parse tree for decoding, or information that depends on the history of switching the correct codebook or parse tree for decoding. For example, the following information may be used as the verification information.
[0064] <Verification Information Variation 1> A function value of a symbol string corresponding to a predetermined number of code words may be used as verification information. As described above, the codebook or parse tree used to encode the next symbol string may be switched depending on the encoded symbol string (e.g., the example of the predetermined rule described above). Therefore, the function value of a symbol string encoded using a predetermined number of code words is information that depends on the history of codebook switching. Here, an example of the function value is a hash function value. A hash function refers to a function that converts a symbol string or numeric string of any length into a value within a predetermined range. For example, if the output range of the hash function is set to 1 bit, 1 bit of verification information can be obtained. For example, in the first embodiment, an example was shown in which the symbol string aaabbbcca is encoded into the codeword sequence 00010111011101110. In this example, the codeword 1 representing the next codebook T1 is placed after the second codeword 101 (the codeword corresponding to symbol string b) of the codeword sequence 00010111011101110, and the codeword 1 representing the next codebook T1 is placed after the fourth codeword 110 (the codeword corresponding to symbol string c). Alternatively, the hash function value α of the symbol string aaab corresponding to the codeword 000101 may be placed after the second codeword 101 (the codeword corresponding to symbol string b), and the hash function value β of the symbol string bbc corresponding to the codeword 101110 may be placed after the fourth codeword 110 (the codeword corresponding to symbol string c). In this case, the codeword sequence may be, for example, 000101α101110β110, where α and β are ∈ {0, 1}. In this case, the decoding device can verify the correctness of the codebook or analytic tree used for decoding by checking whether the function value of the symbol string (decoding result) obtained by the process of decoding a predetermined number of codewords while switching the codebook or analytic tree used for decoding the codewords according to a predetermined rule matches the verification information. However, the decoding device cannot perform this verification unless it decodes a predetermined number of codewords corresponding to the verification information. Therefore, in this example, the position at which the decoding device can start decoding is limited.For example, in the case of the codeword sequence 000101α101110β110, verification using the verification information α cannot be performed unless the first two codewords 000101 are decoded, and verification using the verification information α cannot be performed unless the third and fourth codewords 101110 are decoded.
[0065] <Verification Information Variation 2> A function value of the length of a symbol string corresponding to a predetermined number of code words may be used as the verification information. For example, a code word representing this length may be used as the verification information, or a code word representing whether the integer value representing this length is odd or even may be used as the verification information. For example, in the case of a code word sequence corresponding to the above-mentioned symbol string aaabbbcca, a hash function value α having the length of the symbol string aaab corresponding to the code word 000101 may be placed after the second code word 101 (the code word corresponding to the symbol string b), and a hash function value β having the length of the symbol string bbc corresponding to the code word 101110 may be placed after the fourth code word 110 (the code word corresponding to the symbol string c). In this case, the code word sequence may be, for example, 000101α101110β110, where α and β are ∈ {0, 1}. In this case, the decoding device can verify the correctness of the codebook or analytic tree used for decoding by checking whether or not a function value of the length of a symbol string (decoded result) obtained through a process of decoding a predetermined number of codewords while switching the codebook or analytic tree used for decoding the codewords according to a predetermined rule matches the verification information. In this example, the position at which the decoding device can start decoding is also limited.
[0066] <Verification Information Variation 3> A function value of values corresponding to a codebook or analytic tree used by the encoding device to obtain a predetermined number of codewords may be used as the verification information. Here, the value corresponding to the codebook or analytic tree may be, for example, an identifier for identifying the codebook or analytic tree, or a symbol string and codewords represented by the codebook or analytic tree. An example of the function value is a hash function value. In this case, the decoding device can verify the correctness of the codebook or analytic tree used for decoding the predetermined number of codewords based on whether the function value of values corresponding to the codebook or analytic tree used for decoding the predetermined number of codewords matches the verification information.
[0067] [Second Embodiment] Next, a second embodiment will be described. In the first embodiment, the encoding device outputs verification information in addition to a codeword corresponding to a symbol string, and the decoding device verifies the correctness of the codebook or analytic tree used for decoding based on the verification information and a decoding result obtained by a process of decoding at least one of a plurality of codewords while switching the codebook or analytic tree used for decoding according to a predetermined rule. This embodiment illustrates a method for verifying the correctness of the codebook or analytic tree used for decoding without using such verification information. That is, this embodiment illustrates a method for verifying the correctness of the codebook or analytic tree used for decoding by using a codebook or analytic tree in which a number of correspondences between symbol strings and codewords that is fewer than the number of types (number of patterns) that can be expressed by the codewords is recorded. Hereinafter, the same reference numbers will be used to simplify the description of matters already described.
[0068] The encoding device of this embodiment encodes multiple symbol strings included in an input symbol string (input symbol string) using multiple codebooks or analytic trees in which correspondences between symbol strings and code words are recorded. In this case, the encoding device of this embodiment encodes each of the multiple symbol strings while switching between the codebooks or analytic trees used for encoding according to a predetermined rule, thereby obtaining multiple codewords corresponding to the multiple symbol strings, and outputs a codeword sequence including the multiple codewords. Here, the length of the codewords recorded in the codebook or analytic tree of this embodiment is constant. Additionally, the codebook or analytic tree of this embodiment records correspondences between symbol strings and codewords that are fewer in number than the number of types (number of patterns) that can be expressed by codewords of this constant length. In other words, of the codewords that can be expressed by this constant length, only some of the codewords and their corresponding symbol strings are recorded in the codebook or analytic tree of this embodiment.
[0069] The decoding device of this embodiment decodes multiple codewords included in an input codeword sequence (input codeword sequence) using multiple codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded. In this case, the decoding device of this embodiment verifies the correctness of the codebook or analytic tree used for decoding based on a decoding result obtained based on a process of decoding at least one of the multiple codewords while switching the codebook or analytic tree used for decoding according to a predetermined rule. That is, the multiple codewords included in the input codeword sequence of this embodiment include a first codeword and a second codeword. The above-mentioned decoding result is obtained based on a process of decoding the first codeword and includes information identifying the codebook or analytic tree used for decoding the second codeword. The decoding device of this embodiment verifies the correctness of the codebook or analytic tree used for decoding the first codeword based on whether the second codeword can be decoded using the codebook or analytic tree identified from the decoding result. That is, the codebook or analytic tree of this embodiment records correspondences between symbol strings and codewords that are fewer in number than the number of types that can be expressed by a codeword of this fixed length. Here, if a codeword is decoded using the same codebook or analytic tree as that used to obtain a certain codeword, a correct symbol string corresponding to the codeword can be obtained. However, even if a different codebook or analytic tree is used to decode the codeword, there may be cases where the codeword cannot be decoded because the same codeword does not exist in the codebook or analytic tree. Based on this, the correctness of the codebook or analytic tree used for decoding can be verified.
[0070] This embodiment will be described below with reference to the drawings. Although the following mainly describes an example in which a coding rule is expressed by a codebook, there is no difference in the encoding procedure / decoding procedure even if the coding rule is expressed by an analytic tree. In other words, the codebook in the encoding procedure / decoding procedure described below may be replaced with an analytic tree.
[0071] 3, the encoding device 21 of this embodiment has an encoding processing unit 211 and a storage unit 119. As shown in FIG. 4, the decoding device 22 of this embodiment has a decoding processing unit 221 and a storage unit 129.
[0072] <Pre-processing> A plurality of codebooks T are stored in the storage unit 119 of the encoding device 21 (FIG. 3) and the storage unit 129 of the decoding device 22 (FIG. 4) of this embodiment. k (k=0, 1, ..., K-1) is stored, where K is an integer equal to or greater than 2. As mentioned above, the codebook T k represents the correspondence between symbol strings and code words, and is, for example, a set of pairs of symbol strings and code words. k The code length of the codewords stored in the codebook T k The difference between this and the codebook T k In the codebooks T0 and T1 of FIG. 8A and FIG. 8B, the number of correspondences between symbol strings and code words recorded is fewer than the number of types that can be expressed by a codeword of this fixed length. Figures 8A and 8B show examples of the codebooks T0 and T1 of this embodiment when K=2. For example, the codewords in the codebooks T0 and T1 of FIG. 8A and FIG. 8B have a code length of 3 bits. The number of types (number of patterns) that can be expressed by a 3-bit codeword is 8. In contrast, the codebooks T0 and T1 of FIG. 8A and FIG. 8B record correspondences between symbol strings and codewords, which is five, fewer than the number of types that can be expressed by a 3-bit codeword. That is, the codebook T0 does not record the codewords 101, 110, and 111, and the codebook T1 does not record the codewords 000, 001, and 010. Therefore, it is not possible to obtain the codewords 101, 110, and 111 or to decode the codewords 101, 110, and 111 using the codebook T0. Similarly, the codeword 000,001,010 cannot be obtained or decoded using codebook T1.
[0073] <Encoding Process> The encoding process of this embodiment will be illustrated with reference to Fig. 3 and Fig. 6. An input symbol string, which is a symbol string to be encoded, is input to the encoding processing unit 211 of the encoding device 21 (Fig. 3) of this embodiment. The input symbol string of this embodiment includes a plurality of symbol strings. The encoding processing unit 211 uses a plurality of codebooks T k The codeword sequence is a set of multiple codewords C obtained by encoding multiple symbol strings included in the input symbol string. j(j=0, 1, ..., J-1), where J is an integer equal to or greater than 2. In this case, the encoding processing unit 211 uses the codebook T k The plurality of symbol strings are coded while being switched according to a predetermined rule (step S211).
[0074] <Example of Encoding Process> This is the same as the example of encoding process of the first embodiment, except that the encoding device 21 and the encoding processing unit 211 perform the processing instead of the encoding device 21 and the encoding processing unit 211, the codebooks T0 and T1 of Figures 8A and 8B are used instead of the codebooks T0 and T1 of Figures 5A and 5B, and the codeword representing the current codebook is not output as verification information every time a codeword is obtained U times. Therefore, the obtained codeword sequence does not include verification information.
[0075] <Specific Example of Encoding Process> The encoding processing unit 211 encodes the codebook T k When the input symbol string aabaca is encoded using (k=0, 1), the codeword sequence 001100110 is obtained. The encoding processing unit 211 outputs the codeword sequence 001100110.
[0076] 4 and 7, the decoding process of this embodiment will be illustrated. An input codeword string, which is a string of codewords to be decoded, is input to the decoding processing unit 221 of the decoding device 22 (FIG. 4). The input codeword string of this embodiment is a codeword sequence output from the encoding device 21, and is made up of a plurality of codewords C j (j=0, 1, . . . , J−1) and verification information. k , and multiple code words C included in the input code word sequence are used. j The decoding unit 221 decodes the codebook T k By switching between multiple codewords C j At this time, the decoding unit 121 decodes a plurality of code words C j Based on the decoding result obtained based on the process of decoding at least one of the above, the codebook Tk Verify the correctness of.
[0077] In this embodiment, the codebook T used for decoding is calculated based on the decoding result. k That is, the multiple code words included in the input code word string include a first code word and a second code word. The decoding processing unit 221 verifies the correctness of the code book T used to decode the second code word based on the process of decoding the first code word. k The decoding processing unit 221 obtains a decoding result including information specifying the codebook T k The codebook T used to decode the first codeword is used depending on whether the second codeword can be decoded using k In other words, the decoding processing unit 221 verifies the correctness of the codebook T k The correctness of the codebook used to decode the first codeword is verified by checking whether the codebook T contains the same codeword as the second codeword. If the codebook identified from the decoding result contains the same codeword as the second codeword, the codebook T used to decode the first codeword is verified. k is determined to be correct, and if it does not contain the same code word as the second code word, the codebook T k In this way, the decoding processing unit 221 of this embodiment determines that the codebook T k Therefore, the decoding processing unit 221 uses the codebook T k If the codebook T k is arbitrarily selected to decode the codeword, and the codebook T k The codebook T used for decoding can be switched between the two. k If it is determined that the symbol string obtained by such decoding is correct, then the symbol string obtained by such decoding can be output. k is determined to be incorrect, the codebook T k The code word is decoded by reselecting the codebook T kThe code words after that are decoded again while switching the codebook T k This process is performed on the codebook T k is determined to be correct, the correct symbol string can be decoded (step S221).
[0078] <Example of Decoding Process> An example of the decoding process of this embodiment will be described below, in which the codeword sequence obtained by the encoding processing unit 211 is used as the input codeword sequence.
[0079] <When the codebook is self-evident> (Step S221a-1) The decoding processing unit 221 of the decoding device 22 (FIG. 4) selects the codebook T to be used for decoding the codeword to be decoded first from among the multiple codebooks stored in the storage unit 129. k is used as the current codebook to start decoding. k is known. The decoding processing unit 221 determines the codeword sequence obtained by excluding codewords before the codeword to be decoded first from the input codeword sequence as the current codeword. If the codeword to be decoded first is the first codeword, the decoding processing unit 221 determines the input codeword sequence as the current codeword.
[0080] (Step S221b-1) The decoding unit 221 uses the current codebook to compare the current codeword with the codeword contained in the codebook. A symbol string corresponding to a codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword is obtained. The decoding unit 221 then determines the codeword obtained by removing the prefix that matches the codeword w from the current codeword as the current codeword. Furthermore, the decoding unit 221 switches to the current codebook in accordance with a predetermined rule corresponding to the one used by the encoding unit 111. This predetermined rule is, for example, a rule for determining the next codebook (new current codebook) to be used for decoding the next codeword (new current codeword) based on the decoding process of the current codeword.
[0081] (Step S221c-1) If the length of the current codeword obtained by the process (step S221b-1) is 0, the decoding unit 221 outputs the symbol string obtained by concatenating all the symbol strings obtained by the process (step S221b-1) as an output symbol string, and ends the decoding process. On the other hand, in other cases, the process returns to the process (step S221b-1).
[0082] <When the codebook is not obvious> (Step S221a-2) The decoding processing unit 221 of the decoding device 22 (FIG. 4) selects the codebook T to be used for decoding the codeword to be decoded first from among the multiple codebooks stored in the storage unit 129. k is arbitrarily selected and used as the current codebook to start decoding. k It is not obvious whether this is correct or not. The decoding processing unit 221 sets the codeword string obtained by excluding codewords before the codeword to be decoded first from the input codeword string as the current codeword. If the codeword to be decoded first is the first codeword, the decoding processing unit 221 sets the input codeword string as the current codeword.
[0083] (Step S221b-2) The decoding processing unit 221 uses the current codebook to compare the current codeword with the codewords contained in the codebook, and determines whether or not there is a codeword contained in the current codebook that matches the prefix of the current codeword (hereinafter referred to as codeword w). If there is such a codeword, the decoding processing unit 221 obtains a symbol string corresponding to the codeword contained in the current codebook (hereinafter referred to as codeword w). The decoding processing unit 221 also determines the codeword obtained by removing the prefix that matches the codeword w from the current codeword as the current codeword. Furthermore, the decoding processing unit 221 switches to the current codebook in accordance with a predetermined rule corresponding to that used in the encoding processing unit 111. Thereafter, the process proceeds to step S221d-2. On the other hand, if there is no codeword contained in the current codebook that matches the prefix of the current codeword, the process returns to step S221a-2, and the codebook T used to decode the codeword to be decoded first is selected. k arbitrarily select (e.g., other codebook T k (and select a new one) and start the process again.
[0084] (Step S221d-2) If the length of the current codeword obtained by the process of (step S221b-2) is 0, the decoding unit 221 outputs the symbol string obtained by concatenating all the symbol strings obtained by the process of (step S221b-2) as the output symbol string, and ends the decoding process. On the other hand, if not, the process returns to the process of (step S221b-2).
[0085] <Specific Example of Decoding Process> The decoding processing unit 221 decodes the codebook T k An example of decoding the codeword sequence 001100110 (input codeword sequence) obtained in the specific example of encoding processing described above using (k=0, 1) will be shown.
[0086] <When the codebook is self-evident> The decoding processing unit 221 uses the codebook T k Using (k=0, 1), the codeword sequence 001100110 is decoded to obtain the symbol sequence aabaca and output it.
[0087] <When the Codebook is Not Trivial> An example will be given below in which decoding begins with the second codeword 100 of the codeword sequence 001100110, i.e., the fourth bit. The correct codebook for decoding this second codeword 100 is not trivial. Here, it is assumed that the decoding processing unit 221 selects T0 from the multiple codebooks stored in the storage unit 129 as the codebook to be used for decoding the second codeword 100 to be decoded first, and starts decoding with this as the current codebook T0. The decoding processing unit 221 sets the codeword sequence 100110, which is obtained by excluding codewords before the codeword 100 to be decoded first from the input codeword sequence 001100110, as the current codeword (step S221a-2).
[0088] The decoding processing unit 221 obtains a symbol string c corresponding to the codeword 100 included in the current codebook T0, which matches the prefix 100 of the current codeword 100110. The decoding processing unit 221 also sets the current codeword to codeword 110, obtained by removing the prefix 100 that matches the current codeword 100 from the current codeword 100110. Furthermore, since there are no other symbol strings in the current codebook T0 that start with the symbol string c, the decoding processing unit 121 sets the current codebook to T0 (step S221b-2).
[0089] Because the length of the current symbol string c is not 0 (step S211d-2), the decoding processing unit 221 determines whether there is a codeword 110 in the current codebook T0 that matches the prefix of the current codeword 110. However, there is not one. Therefore, the process returns to step S221a-2, and the codebook to be used for decoding the codeword to be decoded first is set to T1, and the process is repeated. This enables the decoding processing unit 221 to obtain the correct symbol string baca.
[0090] The encoding procedure / decoding procedure using the codebook described above becomes an encoding procedure / decoding procedure using an analytic tree simply by replacing the word "codebook" with "analytic tree."
[0091] <Features of the Present Embodiment> The encoding device of the present embodiment encodes multiple symbol strings included in an input symbol string using multiple codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded, thereby obtaining multiple codewords corresponding to the multiple symbol strings, and outputs a codeword sequence including the multiple codewords. The encoding device of the present embodiment encodes each of the multiple symbol strings while switching between codebooks or analytic trees used for encoding according to a predetermined rule. Here, the codebook of the present embodiment stores codewords of a fixed length, and stores fewer correspondences between symbol strings and codewords than can be expressed by the fixed length. The decoding device of the present embodiment decodes multiple codewords included in an input codeword sequence (input codeword sequence) using multiple codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded. The decoding device of the present embodiment verifies the correctness of the codebook or analytic tree used for decoding based on a decoding result obtained by decoding at least one of the multiple codewords while switching between codebooks or analytic trees used for decoding according to a predetermined rule. That is, the multiple codewords included in the input codeword sequence of this embodiment include a first codeword and a second codeword. The above-mentioned decoding result is obtained based on a process of decoding the first codeword and includes information identifying the codebook or analytic tree used to decode the second codeword. The decoding device of this embodiment verifies the correctness of the codebook or analytic tree used to decode the first codeword based on whether the second codeword can be decoded using the codebook or analytic tree identified from the decoding result. As a result, even if the decoding device of this embodiment does not know the correct codebook or analytic tree for the codeword to be initially decoded, if decoding is started using an incorrect codebook or analytic tree, it can detect that the codebook or analytic tree used for decoding is incorrect. In such a case, the decoding device of this embodiment simply reselects the codebook or analytic tree for the codeword to be initially decoded, performs decoding, and repeats the process of verifying the correctness of the codebook or analytic tree used for decoding. As a result, if it is determined that the codebook or analytic tree used for decoding is correct, the obtained symbol string is also correct. This makes it possible to start decoding from a codeword in the middle of a codeword sequence in a coding method in which coding rules are expressed using multiple codebooks or parse trees.
[0092] [Third Embodiment] In the first and second embodiments, an example of an encoding method is described in which "a symbol string that matches the prefix of the current symbol string longest is selected from the symbol strings included in the current codebook, and a codeword corresponding to the symbol string ν is obtained." Furthermore, the following predetermined rules for switching codebooks are described: "(i) if the current codebook does not contain any other symbol strings beginning with the symbol string ν, then the next codebook is set to T0; (ii) if the current codebook contains any other symbol string beginning with the symbol string ν, then the next codebook is set to T1." However, this is merely an example and does not limit the present invention. The present invention may also be applied when a different encoding method and predetermined rule for switching codebooks are used. Below are examples of encoding methods, decoding methods, and predetermined rules for switching codebooks to which the present invention can be applied. Applying the present invention to the following methods (hereinafter referred to as modified methods) can further improve compression performance.
[0093] <When the first embodiment of the present invention is applied to the first example of the modified method> When the first embodiment of the present invention is applied to the first example of the modified method, the following occurs. <Example of encoding process> (1) The encoding processing unit 111 encodes a predetermined codebook T k is used as the current codebook to start encoding. Here, k is an arbitrary integer between 0 and K-1, for example, k=0. Also, the input symbol string is used as the current symbol string.
[0094] (2) The encoding unit 111 uses the current codebook to compare the current symbol string with the symbol string contained in the codebook. If there is a symbol string (hereinafter referred to as 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 a 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 encoding unit 111 obtains a codeword corresponding to the symbol string σ, sets the next codebook to be used corresponding to the symbol string σ as the current codebook, and sets the symbol string obtained by excluding the prefix that matches the symbol string σ from the current symbol string as the current symbol string. Furthermore, the encoding unit 111 outputs a codeword representing the current codebook as verification information every time a codeword is obtained U times. Note that a set of symbol strings for a codebook is defined as a mode. A mode is assigned to each of multiple codebooks used for encoding / decoding. Since the mode assigned to a codebook is defined as a set of symbol strings, it is assumed that there is no overlap between the symbol strings included in the modes. Details of the modes will be described later.
[0095] (3) If the length of the current symbol string obtained by the process (2) is 0, the encoding processing unit 111 outputs the code word obtained by concatenating all the code words obtained by the process (2) with the verification information as a code word sequence (output code word) and terminates the encoding process, but otherwise returns to the process (2).
[0096] <Example of Decoding Process> <When the Codebook is Self-Evidence> (1) The decoding processing unit 121 decodes a predetermined codebook T k is used as the current codebook and decoding begins. Here, k is the codebook number used when the encoding process of the input codeword began. Also, the codeword sequence obtained by excluding the verification information and codewords before the codeword to be first decoded from the input codeword sequence (input codeword) is set as the current codeword.
[0097] (2) The decoding unit 121 uses the current codebook to compare the current codeword with the codewords contained in the codebook, obtains a symbol string corresponding to a codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword, sets the codebook to be used next that corresponds to codeword w as the current codebook, and sets the codeword obtained by removing the prefix that matches codeword w from the current codeword as the current codeword.
[0098] (3) If the length of the current codeword obtained by the process (2) is 0, the decoding processing unit 121 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, but otherwise returns to the process (2).
[0099] <When the codebook is not obvious> (1) The decoding processing unit 121 first selects the codebook T k is arbitrarily selected and decoding is started using it as the current codebook. The codeword string obtained by excluding the codewords before the codeword to be first decoded from the input codeword string (input codeword) is set as the current codeword.
[0100] (2) The decoding unit 121 uses the current codebook to compare the current codeword with the codewords contained in the codebook, obtains a symbol string corresponding to a codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword, sets the codebook to be used next that corresponds to codeword w as the current codebook, and sets the codeword obtained by removing the prefix that matches codeword w from the current codeword as the current codeword.
[0101] (2') If the prefix of the current codeword is verification information, the decoding processing unit 121 determines whether the codebook indicated by the verification information matches (is consistent with) the current codebook. If they do not match, the process returns to (1) and the codebook T used to decode the codeword to be decoded first is selected. k arbitrarily select (e.g., other codebook T k If they match, the code word obtained by removing the verification information at the beginning of the current code word is used as the current code word, and the process proceeds to (3). If the verification information is not at the beginning of the current code word, the process proceeds to (3).
[0102] (3) If the length of the current codeword obtained by the process (2) is 0, the decoding processing unit 121 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, but otherwise returns to the process (2).
[0103] Moreover, the first or second modification of the first embodiment may be applied to these.
[0104] <When the second embodiment of the present invention is applied to the first example of the modified method> When the second embodiment of the present invention is applied to the first example of the modified method, the following occurs. First, the code words stored in the codebook in the first example of the modified method have a constant code length. Furthermore, this codebook stores triplet sets of an input symbol string, an output code word of a predetermined length, and the next codebook to be used (hereinafter referred to as a link destination). When the second embodiment is applied to the first example of the modified method, the number of triplet sets stored in the codebook is set to be fewer than the number of types that can be expressed by the code length.
[0105] <Example of Encoding Process> In the encoding process in this case, the encoding processing unit 111 does not output the codeword representing the current codebook as verification information every time a codeword is obtained U times. Therefore, the obtained codeword sequence does not include verification information. The rest is the same as when the first embodiment of the present invention is applied to the first example of the modified method.
[0106] <Example of Decoding Process> <When the Codebook is Self-Evidence> (1) The decoding processing unit 121 decodes a predetermined codebook T k is used as the current codebook and decoding begins. Here, k is the codebook number used when the encoding process of the input codeword began. Also, the codeword sequence excluding the codewords before the codeword to be first decoded from the input codeword sequence (input codeword) is used as the current codeword.
[0107] (2) The decoding unit 121 uses the current codebook to compare the current codeword with the codewords contained in the codebook, obtains a symbol string corresponding to a codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword, sets the codebook to be used next that corresponds to codeword w as the current codebook, and sets the codeword obtained by removing the prefix that matches codeword w from the current codeword as the current codeword.
[0108] (3) If the length of the current codeword obtained by the process (2) is 0, the decoding processing unit 121 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, but otherwise returns to the process (2).
[0109] <When the codebook is not obvious> (1) The decoding processing unit 121 first selects the codebook T k is arbitrarily selected and decoding is started using it as the current codebook. The codeword string obtained by excluding the codewords before the codeword to be first decoded from the input codeword string (input codeword) is set as the current codeword.
[0110] (2) The decoding unit 121 uses the current codebook to compare the current codeword with the codewords contained in the codebook and determines whether a codeword (hereinafter referred to as codeword w) contained in the current codebook that matches the prefix of the current codeword is present. If such a codeword is present, the decoding unit 221 obtains a symbol string corresponding to the codeword (hereinafter referred to as codeword w) contained in the current codebook that matches the prefix of the current codeword, sets the codebook to be used next corresponding to the codeword w as the current codebook, and sets the codeword obtained by removing the prefix that matches the codeword w from the current codeword as the current codeword. Then, the process proceeds to (3). On the other hand, if no codeword contained in the current codebook that matches the prefix of the current codeword is present, the process returns to (1), arbitrarily selects a codebook to be used for decoding the codeword to be decoded first (for example, selects a different codebook), and starts the process again.
[0111] (3) If the length of the current codeword obtained by the process (2) is 0, the decoding processing unit 121 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, but otherwise returns to the process (2).
[0112] <Application of the First Embodiment of the Present Invention to the Second Example of the Modified Method> When the first embodiment of the present invention is applied to the second example of the modified method, the following occurs.
[0113] (1) The encoding processing unit 111 uses a predetermined codebook T k is used as the current codebook to start encoding. Here, k is an arbitrary integer between 0 and K-1, for example, k=0. Also, the input symbol string is used as the current symbol string.
[0114] (2) Using the current codebook, the encoding unit 111 compares the current symbol string with the symbol strings included in the input set of the current codebook. If there is a symbol string (hereinafter referred to as symbol string σ) included in the input set of the current codebook that matches the prefix of the current symbol string, a codeword corresponding to the input set including the symbol string σ is obtained, the codebook to be used next corresponding to the input set including the symbol string σ is set as the current codebook, and the symbol string obtained by excluding from the current symbol string any prefix that matches the predetermined prefix of any symbol string included in the input set including the symbol string σ is set as the current symbol string. In addition, if the length of the current symbol string is shorter than the length of the symbol string included in the input set of the current codebook, and therefore there is no symbol string included in the input set of the current codebook that matches the prefix of the current symbol string, and there is a symbol string included in the input set of the current codebook that matches the prefix of a symbol string obtained by concatenating an arbitrary symbol string to the current symbol string (hereinafter referred to as symbol string σ), a codeword corresponding to the input set including the symbol string σ is obtained, and the codebook to be used next corresponding to the input set including the symbol string σ is set as the current codebook, and the symbol string obtained by removing a predetermined prefix of the input set including the symbol string σ from the current symbol string is set as the current symbol string. Furthermore, each time a codeword is obtained U times, the encoding processing unit 111 outputs a codeword representing the current codebook as verification information. In addition, the input set refers to a set of symbol strings that start with the input symbol string.
[0115] (3) If the length of the current symbol string obtained by the process (2) is 0, the encoding processing unit 111 outputs the code word obtained by concatenating all the code words obtained by the process (2) with the verification information as the output code word and terminates the encoding process, but otherwise returns to the process (2).
[0116] <Example of Decoding Process> <When the Codebook is Self-Evidence> (1) The decoding processing unit 121 decodes a predetermined codebook T k is set as the current codebook and decoding begins. Here, k is the codebook number used when the encoding process of the input codeword began. Also, the input codeword is set as the current codeword.
[0117] (2) The decoding unit 121 uses the current codebook to compare the current codeword with the codewords contained in the codebook, obtains a symbol string that is a predetermined prefix of an arbitrary symbol string contained in the input set corresponding to a codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword, sets the codebook to be used next corresponding to the codeword w as the current codebook, and sets the codeword obtained by removing the prefix that matches the codeword w from the current codeword as the current codeword.
[0118] (3) If the length of the current codeword obtained by the process (2) is 0, the decoding processing unit 121 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, but otherwise returns to the process (2).
[0119] <When the codebook is not obvious> (1) The decoding processing unit 121 first selects the codebook T k is arbitrarily selected and decoding is started using it as the current codebook. The codeword string obtained by excluding the codewords before the codeword to be first decoded from the input codeword string (input codeword) is set as the current codeword.
[0120] (2) The decoding unit 121 uses the current codebook to compare the current codeword with the codewords contained in the codebook, obtains a symbol string that is a predetermined prefix of an arbitrary symbol string contained in the input set corresponding to a codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword, sets the codebook to be used next corresponding to the codeword w as the current codebook, and sets the codeword obtained by removing the prefix that matches the codeword w from the current codeword as the current codeword.
[0121] (2') If the prefix of the current codeword is verification information, the decoding processing unit 121 determines whether the codebook indicated by the verification information matches (is consistent with) the current codebook. If they do not match, the process returns to (1) and the codebook T used to decode the codeword to be decoded first is selected. k arbitrarily select (e.g., other codebook T k If they match, the code word obtained by removing the verification information at the beginning of the current code word is used as the current code word, and the process proceeds to (3). If the verification information is not at the beginning of the current code word, the process proceeds to (3).
[0122] (3) If the length of the current codeword obtained by the process (2) is 0, the decoding processing unit 121 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, but otherwise returns to the process (2).
[0123] Moreover, the first or second modification of the first embodiment may be applied to these.
[0124] <When the second embodiment of the present invention is applied to the second example of the modification method> When the second embodiment of the present invention is applied to the second example of the modification method, the following occurs. First, the codewords stored in the codebook in the second example of the modification method have a constant code length. Furthermore, this codebook is composed of triples: a set of symbol strings beginning with an input symbol string (hereinafter referred to as the input set), an output codeword of a predetermined length, and the next codebook to be used (hereinafter referred to as the link destination). When the second embodiment is applied to the second example of the modification method, the number of triples stored in the codebook is set to be fewer than the number of types that can be represented by the code length.
[0125] <Example of Encoding Process> In the encoding process in this case, the encoding processing unit 111 does not output the codeword representing the current codebook as verification information every time a codeword is obtained U times. Therefore, the obtained codeword sequence does not include verification information. The rest is the same as when the first embodiment of the present invention is applied to the second example of the modified method.
[0126] <Example of Decoding Process> <When the Codebook is Self-Evidence> (1) The decoding processing unit 121 decodes a predetermined codebook T k is set as the current codebook and decoding begins. Here, k is the codebook number used when the encoding process of the input codeword began. Also, the input codeword is set as the current codeword.
[0127] (2) The decoding unit 121 uses the current codebook to compare the current codeword with the codewords contained in the codebook, obtains a symbol string that is a predetermined prefix of an arbitrary symbol string contained in the input set corresponding to a codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword, sets the codebook to be used next corresponding to the codeword w as the current codebook, and sets the codeword obtained by removing the prefix that matches the codeword w from the current codeword as the current codeword.
[0128] (3) If the length of the current codeword obtained by the process (2) is 0, the decoding processing unit 121 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, but otherwise returns to the process (2).
[0129] <When the codebook is not obvious> (1) The decoding processing unit 121 first selects the codebook T k is arbitrarily selected and decoding is started using it as the current codebook. The codeword string obtained by excluding the codewords before the codeword to be first decoded from the input codeword string (input codeword) is set as the current codeword.
[0130] (2) The decoding unit 121 uses the current codebook to compare the current codeword with the codewords contained in the codebook and determines whether a codeword (hereinafter referred to as codeword w) contained in the current codebook exists that matches the prefix of the current codeword. If such a codeword exists, the decoding unit 221 obtains a symbol string that is a predetermined prefix of an arbitrary symbol string contained in the input set corresponding to the codeword (hereinafter referred to as codeword w) contained in the current codebook that matches the prefix of the current codeword, sets the codebook to be used next corresponding to the codeword w as the current codebook, and sets the codeword obtained by removing the prefix that matches the codeword w from the current codeword as the current codeword. Then, the process proceeds to (3). On the other hand, if no codeword contained in the current codebook that matches the prefix of the current codeword exists, the process returns to (1), arbitrarily selects a codebook to be used for decoding the codeword to be decoded first (for example, selects a new codebook), and starts the process again.
[0131] (3) If the length of the current codeword obtained by the process (2) is 0, the decoding processing unit 121 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, but otherwise returns to the process (2).
[0132] <Modification Method> The modification method will be described in detail below.
[0133] Before describing each embodiment of the present invention, the notation method used in the present invention will be described.
[0134] ^ (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.
[0135] 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.
[0136] <Technical Background> In the encoding / decoding in the embodiment of the present invention, a plurality of codebooks having a predetermined structure are used to express a coding rule that satisfies the condition that it can be uniquely coded (hereinafter referred to as the unique coding possibility condition). Note that analytic trees may be used instead of codebooks, and this does not result in any difference in the encoding procedure / decoding procedure.
[0137] <<1: Codebook / Analysis Tree>> First, a mode, a concept necessary for explaining the codebook in the first embodiment, will be described. A set of symbol strings for a codebook is defined as a mode. A mode is assigned to each of multiple codebooks used for encoding / decoding. Since the modes assigned to a codebook are defined as a set of symbol strings, it is assumed that there is no duplication of symbol strings included in a mode. It is preferable that the 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. For example, if there are two codebooks, codebook T0 and codebook T1, the modes assigned to codebook T0 and codebook T1 can be defined as {aab, abc, aca} and {ac, ba}, respectively.
[0138] The codebook in the first embodiment 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 the link destination). Figure 9 shows an example of a codebook. The codebook in Figure 9 is used to encode a symbol string consisting of symbols {a, b, c} into a codeword consisting of codes {0, 1}, and consists of five codebooks: T0, T1, T2, T3, and T4. Note that the length of the output codeword in codebooks T0, T1, T2, T3, and T4 is 2. In Figure 9, ε represents a symbol string of length 0. Note that the symbol string ε can be the prefix of any symbol string. The mode {ε} is assigned to codebook T0, and the 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.
[0139] Next, we will explain the conditions required for a codebook so that encoding / decoding in the first embodiment satisfies the unique coding possibility condition. To this end, we will define the concept of an expansion symbol string. 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 mode assigned to the next codebook to be used and 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. 9 are the symbol string aca obtained by concatenating the symbol string aca with the symbol string ε that is an element of the mode {ε} assigned to the codebook T0 to be used next and that corresponds to the symbol string aca, the symbol string baa obtained by concatenating the symbol string baa with the symbol string ε that is an element of the mode {ε} assigned to the codebook T0 to be used next and that 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 that are elements of the mode {b, c} assigned to the codebook T3 to be used next and that 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 that are elements of the mode {b, c} assigned to the codebook T3 to be used next and that corresponds to the symbol string ba.
[0140] The following two conditions are required for the codebook in order for encoding / decoding to satisfy the unique codability condition.
[0141] (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.
[0142] (2) For any codebook included in a plurality of codebooks, the expansion symbol string of the codebook starts with any symbol string included in the mode assigned to the codebook.
[0143] 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.
[0144] As mentioned above, the coding rules can also be expressed using an analytic tree. Figure 10 is a diagram showing an example of an analytic tree, and the analytic tree in Figure 10 is equivalent to the codebook in Figure 9. The above explanation of the codebook also applies to analytic trees, simply by replacing the word "codebook" with "analytic tree." By replacing the words with "analytic tree," the following explanation of the analytic tree can be obtained.
[0145] A set of symbol strings for a parse tree is defined as a mode. A mode is assigned to each of the multiple parse trees used for encoding / decoding.
[0146] 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).
[0147] 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 a mode assigned to the next analytic tree corresponding to the symbol string. Here, the symbol string included in the analytic tree refers to a symbol string that is an element of a triple that constitutes the analytic tree.
[0148] The following two conditions are required for the parse tree in order for encoding / decoding to satisfy the unique codability condition.
[0149] (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.
[0150] (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 mode assigned to the analytic tree.
[0151] <<2: Encoding Procedure / Decoding Procedure>> First, the encoding procedure in the first embodiment will be described. The encoding procedure in the first embodiment takes a symbol string to be encoded (hereinafter referred to as an input symbol string) as input, and encodes the symbol string from a plurality of codebooks {T k} k=0 K-1 (where K is an integer equal to or greater than 2) to obtain code words corresponding to the symbol strings that make up the input symbol string, and then output a code word (hereinafter referred to as the output code word) obtained by concatenating all the obtained code words. k} k=0 K-1 In the process of obtaining a code word corresponding to a symbol string constituting an input symbol string using
[0000] , if there is a symbol string (hereinafter referred to as symbol string σ) included in the current codebook that matches the prefix of the current symbol string, and if there is a symbol string included in the mode assigned to the codebook 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, the code word corresponding to the symbol string σ is obtained, the codebook to be used next that corresponds to the symbol string σ is set as the current codebook, 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, and this process is repeated until the length of the current symbol string becomes 0. Here, the current symbol string refers to the symbol string that is currently being encoded, and the current symbol string at the time when encoding starts refers to the input symbol string.
[0152] More specifically, the encoding procedure in the first embodiment comprises the following three steps:
[0153] (1) A predetermined codebook T kis used as the current codebook to start encoding. Here, k is an arbitrary integer between 0 and K-1, for example, k=0. Also, the input symbol string is used as the current symbol string.
[0154] (2) Using the current codebook, the current symbol string is compared with the symbol string contained in the current codebook. If there is a symbol string (hereinafter referred to as 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 mode assigned to the codebook 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, the codeword corresponding to the symbol string σ is obtained, the codebook to be used next that corresponds to the symbol string σ is set as the current codebook, 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.
[0155] (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).
[0156] Next, a decoding procedure in the first embodiment will be described. The decoding procedure in the first embodiment involves inputting a codeword to be decoded (hereinafter referred to as an input codeword) and decoding the codeword from a plurality of codebooks {T k} k=0 K-1 (However, if multiple codebooks {T k} k=0 K-1 is the codebook used in the encoding procedure) to obtain symbol strings corresponding to the codewords that make up the input codeword, and then output a symbol string (hereinafter referred to as the output symbol string) obtained by concatenating all the obtained symbol strings. k} k=0 K-1In the process of obtaining a symbol string corresponding to a codeword constituting an input codeword using [mathematical formula - see original document], a symbol string corresponding to a codeword (hereinafter referred to as codeword w) included in the current codebook that matches the prefix of the current codeword is obtained, the codebook to be used next that corresponds to codeword w is set as the current codebook, and the codeword obtained by removing the prefix that matches codeword w from the current codeword is set as the current codeword. This process is repeated until the length of the current codeword becomes 0. Here, the current codeword is the codeword currently being decoded, and the current codeword at the start of decoding is the input codeword.
[0157] More specifically, the decoding procedure in the first embodiment comprises the following three steps.
[0158] (1) A predetermined codebook T k is set as the current codebook and decoding begins. Here, k is the codebook number used when the encoding process of the input codeword began. Also, the input codeword is set as the current codeword.
[0159] (2) Using the current codebook, compare the current codeword with the codewords contained in the codebook. Obtain a symbol string corresponding to the codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword, and set the codebook to be used next that corresponds to codeword w as the current codebook. Also set the codeword obtained by removing the prefix that matches codeword w from the current codeword as the current codeword.
[0160] (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).
[0161] The encoding procedure / decoding procedure using the above codebook can also be converted to an encoding procedure / decoding procedure using an analytic tree by simply replacing the word "codebook" with "analytic tree."
[0162] <<3: Example of Encoding / Decoding>> Here, as an example of encoding / decoding, encoding / decoding of the symbol string accba when using the codebook in Fig. 9 will be described. First, encoding will be described. Here, it is assumed that codebook T0 is used as the current codebook at the start of the encoding process. The input is the symbol string accba to be encoded, and the symbol string accba is set as the current symbol string.
[0163] (1) Using the current codebook T0, the current symbol string accba is compared with the symbol strings contained in the codebook T0. The symbol string a is included in the current codebook T0 and matches the prefix of the current symbol string accba. However, there is no symbol string included in the mode assigned to the codebook T1 to be used next that matches the prefix of the symbol string ccba obtained by excluding the prefix that matches the symbol string a from the current symbol string accba. Therefore, the symbol string a is not coded as the codeword 00. Next, there is a symbol string ε as a symbol string included in the current codebook T0 that matches the prefix of the current symbol string accba, and there is also a symbol string ac as a symbol string included in the mode assigned to the codebook T2 to be used next that matches the prefix of the symbol string accba obtained by excluding the prefix that matches the symbol string ε from the current symbol string accba. Therefore, the symbol string ε is encoded as codeword 01, the codebook T2 to be used next that corresponds to the symbol string ε is set as the current codebook, and the symbol string accba obtained by excluding the prefix that matches the symbol string ε from the current symbol string accba is set as the current symbol string.
[0164] (2) Using the current codebook T2, the current symbol string accba is compared with the symbol strings contained in the codebook T2. There is a symbol string ac as a symbol string contained in the current codebook T2 that matches the prefix of the current symbol string accba, and there is also a symbol string c as a symbol string contained in the mode assigned to the codebook T3 to be used next that matches the prefix of the symbol string cba obtained by excluding the prefix that matches the symbol string ac from the current symbol string accba. Therefore, the symbol string ac is encoded into codeword 10, the codebook T3 to be used next that corresponds to the symbol string ac is set as the current codebook, and the symbol string cba obtained by excluding the prefix that matches the symbol string ac from the current symbol string accba is set as the current symbol string.
[0165] (3) Using the current codebook T3, the current symbol string cba is compared with the codewords contained in that codebook T3. There is a symbol string ε as a symbol string contained in the current codebook T3 that matches the prefix of the current symbol string cba, but there is no symbol string contained in the mode assigned to the codebook T4 to be used next that matches the prefix of the symbol string cba obtained by excluding the prefix that matches the symbol string ε from the current symbol string cba; therefore, the symbol string ε is not encoded into codeword 10. Next, there is a symbol string c as a symbol string contained in the current codebook T3 that matches the prefix of the current symbol string cba, and there is a symbol string b as a symbol string contained in the mode assigned to the codebook T3 to be used next that matches the prefix of the symbol string ba obtained by excluding the prefix that matches the symbol string c from the current symbol string cba; therefore, the symbol string c is encoded into codeword 11, the codebook T3 to be used next that corresponds to the symbol string c is set as the current codebook, and the symbol string ba obtained by excluding the prefix that matches the symbol string c from the current symbol string cba is set as the current codeword.
[0166] (4) Using the current codebook T3, the current symbol string ba is compared with the symbol strings contained in the codebook T3. There is a symbol string ba as a symbol string contained in the current codebook T3 that matches the prefix of the current symbol string ba, and there is also a symbol string ε as a symbol string contained in the mode assigned to the codebook T0 to be used next that matches the prefix of the symbol string ε obtained by excluding the prefixes that match the symbol string ba from the current symbol string ba. Therefore, the symbol string ba is encoded as codeword 00, the codebook T0 to be used next that corresponds to the symbol string ba is set as the current codebook, and the symbol string ε obtained by excluding the prefixes that match the symbol string ba from the current symbol string ba is set as the current symbol string.
[0167] (5) Since the current symbol string ε is a symbol string of length 0, the code word 01101100 is output.
[0168] Next, decoding will be explained. At the start of the decoding process, the codebook T0 used at the start of the encoding process is set as the current codebook. The input is the codeword 01101100 to be decoded, and the codeword 01101100 is set as the current codeword. Also, λ represents a codeword of length 0.
[0169] (1) For the first two bits of codeword 01 of the current codeword 01101100, obtain a symbol string ε as a symbol string corresponding to codeword 01 using the current codebook T0, and use the codebook T2 to be used next that corresponds to codeword 01 as the current codebook. Also, use the codeword 101100, obtained by removing the first two bits of codeword 01 from the current codeword 01101100, as the current codeword.
[0170] (2) For the first two bits of the current codeword 101100, codeword 10, a symbol string ac is obtained as a symbol string corresponding to codeword 10 using the current codebook T2, and the next codebook T3 to be used corresponding to codeword 10 is set as the current codebook. Codeword 1100, obtained by removing the first two bits of codeword 10 from the current codeword 101100, is set as the current codeword.
[0171] (3) For the first two bits of codeword 11 of the current codeword 1100, obtain symbol string c as the symbol string corresponding to codeword 11 using the current codebook T3, and use the codebook T3 to be used next that corresponds to codeword 11 as the current codebook. Also, use codeword 00, which is the current codeword 1100 minus the first two bits of codeword 11, as the current codeword.
[0172] (4) For the first two bits of the current codeword 00, obtain the symbol string ba as the symbol string corresponding to the codeword 00 using the current codebook T3, and use the codebook T0 to be used next that corresponds to the codeword 00 as the current codebook. Also, use the codeword λ obtained by removing the first two bits of the codeword 00 from the current codeword 00 as the current codeword.
[0173] (5) Since the current codeword λ is a codeword of length 0, the symbol string εaccba, that is, the symbol string accba, is output.
[0174] (Variation 1) In the above explanation, the conditions for multiple codebooks to enable unique encoding were shown, but as long as unique decoding is possible, a code is sufficient even if it cannot be uniquely encoded. Here, encoding / decoding using multiple codebooks that cannot enable unique encoding will be explained.
[0175] The codebook in the first modification of the first embodiment also consists of a triplet of an input symbol string, an output codeword of a predetermined length, and a codebook to be used next (hereinafter referred to as a link destination), and a mode is assigned to each triplet. However, the codebook in the first modification of the first embodiment differs from the codebook in the first embodiment in that, among the conditions required for a codebook to satisfy the unique codability condition for encoding / decoding, the codebook satisfies condition (2) but does not satisfy condition (1).
[0176] The codebook in Modification 1 of the first embodiment will be described below using an example. FIG. 11 is a diagram showing an example of a codebook. FIG. 11 shows a codebook in Modification 1 of the first embodiment. Like the codebook in FIG. 9, this codebook 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 consists of five codebooks: T0, T1, T2, T3, and T4. However, codebook T0 differs from the codebook in FIG. 9 only in that the link destination for symbol string ε in codebook T0 is T1. The set of all expanded symbol strings in codebook T0 is {aa, ab, a, b, bb, bc, c}, and element a, for example, is the prefix of element aa, so condition (1) is not satisfied. On the other hand, all expanded symbol strings in codebook T0 begin with symbol string ε included in mode {ε} assigned to codebook T0, so condition (2) is satisfied.
[0177] In the encoding procedure in the first modification of the first embodiment, there may be a plurality of symbol strings σ that satisfy the condition in (2) of the encoding procedure in the first embodiment, that is, "there exists a symbol string (hereinafter referred to as symbol string σ) included in the current codebook that matches the prefix of the current symbol string, and there exists a symbol string included in the mode assigned to the codebook 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." Therefore, in the encoding procedure in the first modification of the first embodiment, it is preferable to select any one of the symbol strings σ that satisfy the above condition in (2), and then perform a process of obtaining a codeword and a process of determining the current codebook and the current symbol string. Meanwhile, the decoding procedure may be the same as that of the first embodiment.
[0178] First Embodiment An encoding device 1100 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 1200 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).
[0179] Here, a codeword is a string formed by lining up two codes {0, 1}. As explained in the <Technical Background>, a code string of length 0 is represented as λ. A symbol is an element of a set consisting of a finite number of elements, and may be text consisting of letters or words, such as a, b, and c, which are elements of the alphabet set {a, b, c}. A symbol string is a string formed by lining up symbols, and for example, abbaa is a symbol string of length 5 for two symbols {a, b}. As explained in the <Technical Background>, a symbol string of length 0 is represented as ε. The following series, which are quantized to finite precision, can be used as symbol strings:
[0180] (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.
[0181] The encoding device 1100 and the decoding device 1200 use a plurality of codebooks or parse trees {T k} k=0 K-1 (where K is an integer greater than or equal to 2) is a data structure with the following characteristics:
[0182] (1) Codebook or parse tree Tk (k=0, 1, ..., K-1) consists of a triplet of a symbol string, a codeword of a predetermined length, and the codebook or parse tree to be used next, and is assigned a mode, which is a set of symbol strings.
[0183] (2) Codebook or parse tree T k The set of all expanded symbol sequences (k=0, 1,…, K-1) satisfies the prefix condition, and the codebook or parse tree T k The expanded symbol string (k=0, 1, . . . , K-1) satisfies the condition that any symbol string included in the mode assigned to the codebook or parse tree begins with the word.
[0184] As explained in the Technical Background, multiple codebooks or parse trees {T k} k=0 K-1 satisfies conditions (1) and (2), multiple codebooks or parse trees {T k} k=0 K-1 satisfies the unique codability condition. However, if multiple codebooks or parse trees {T k} k=0 K-1 is sufficient as a code if it satisfies condition (2).
[0185] <<Encoding Device 1100>> The encoding device 1100 will be described below with reference to Figs. 12 and 13. Fig. 12 is a block diagram showing the configuration of the encoding device 1100. Fig. 13 is a flowchart showing the operation of the encoding device 1100. As shown in Fig. 12, the encoding device 1100 includes an encoding unit 1110 and a recording unit 1190. The recording unit 1190 is a component that appropriately records information required for the processing of the encoding device 1100. The recording unit 1190 stores, for example, a plurality of codebooks or parse trees {T k} k=0 K-1 Keep a record of the following.
[0186] The operation of the encoding device 1100 will be described with reference to FIG.
[0187] In S1110, the encoding unit 1110 generates a plurality of codebooks or parse trees {T k} k=0K-1 The encoding unit 1110 obtains a code word corresponding to the symbol string that constitutes the input symbol string using the above-mentioned arithmetic operations, and outputs the code word obtained by concatenating the obtained code words as the output code word.
[0188] (1) Codebook or parse tree T k (where k is an integer between 0 and K-1) as the current codebook or analytic tree, and the input symbol string is the current symbol string. (2) Using the current codebook or analytic tree, the current symbol string is compared with the symbol string contained in the codebook or analytic tree, and if there is a symbol string contained in the current codebook or analytic tree (hereinafter referred to as symbol string σ) that matches the prefix of the current symbol string, and if there is a symbol string contained in the mode assigned to the codebook or analytic 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, a codeword corresponding to the symbol string σ is obtained, the codebook or analytic tree to be used next that corresponds to the symbol string σ is set as the current codebook or analytic tree, 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. (3) If the length of the current symbol string obtained by processing (2) is 0, the codeword obtained by concatenating all the codewords obtained by processing (2) is output as the output codeword, and the encoding process is terminated; otherwise, the process returns to processing (2). Here, the mode can be said to be a set assigned in the encoding process to check whether it is correct to use the next codebook or analytic tree corresponding to the symbol string contained in the codebook or analytic tree as the current codebook or analytic tree to encode the current codeword.
[0189] <<Decoding Device 1200>> Hereinafter, the decoding device 1200 will be described with reference to Figs. 14 and 15. Fig. 14 is a block diagram showing the configuration of the decoding device 1200. Fig. 15 is a flowchart showing the operation of the decoding device 1200. As shown in Fig. 14, the decoding device 1200 includes a decoding unit 1210 and a recording unit 1290. The recording unit 1290 is a component that appropriately records information necessary for the processing of the decoding device 1200. The recording unit 1290 stores, for example, a plurality of codebooks or parse trees {T k} k=0K-1 (However, {T k} k=0 K-1 The input codeword is encoded using a plurality of codebooks or parse trees.
[0190] The operation of the decoding device 1200 will be described with reference to FIG.
[0191] In S1210, the decoding unit 1210 generates a plurality of codebooks or parse trees {T k} k=0 K-1 The decoding unit 1210 performs a decoding process consisting of the following three steps:
[0192] (1) Codebook or parse tree T k (where k is the codebook or analytic tree number used when the encoding process for the input codeword was started) as the current codebook or analytic tree, and the input codeword as the current codeword. (2) Using the current codebook or analytic tree, compare the current codeword with the codewords contained in the codebook or analytic tree, obtain a symbol string corresponding to a codeword contained in the current codebook or analytic tree that matches the prefix of the current codeword (hereinafter referred to as codeword w), set the codebook or analytic tree to be used next corresponding to codeword w as the current codebook or analytic tree, and set the codeword obtained by removing the prefix matching codeword w from the current codeword as the current codeword. (3) If the length of the current codeword obtained by process (2) is zero, output the symbol string obtained by concatenating all symbol strings obtained by process (2) as the output symbol string, and terminate the decoding process. Otherwise, return to process (2). According to the embodiments of the present invention, by using multiple codebooks or analytic trees with a predetermined structure, it is possible to realize codes with higher compression efficiency. Furthermore, by making multiple codebooks or analytic trees satisfy predetermined conditions, it is possible to easily design codes that can be uniquely encoded.
[0193] In the first embodiment, the concept of a mode was introduced, and encoding / decoding using a plurality of codebooks, each of which is assigned a mode, was described. However, it is possible to configure a codebook equivalent to the codebook in the first embodiment without specifying the modes assigned to the codebooks. Furthermore, it is possible to configure a codebook equivalent to the codebook in the first embodiment not only without specifying the modes assigned to the codebooks, but also without including the next codebook to be used as a component of the codebook. By using a codebook configured in this manner, it is possible in some cases to reduce the memory required for processing and improve the processing speed compared to when the codebook in the first embodiment is used.
[0194] The technical background of encoding / decoding in the second embodiment will be explained below.
[0195] <Technical Background> <<1: Codebook>> First, several concepts necessary for explaining the codebook in the second embodiment will be defined.
[0196] A string σ and a set of strings S={σ0, σ1, …, σ N-1} (where N is an integer equal to or greater than 1), the set of symbol strings σ+S is the set of symbol strings obtained by concatenating the symbol string σ and the symbol strings that are elements of the set of symbol strings S. Therefore, w+S={σσ0, σσ1, …, σσ N-1}.
[0197] Let Sym be a set of symbols, P and Q be integers greater than or equal to 0 such that P≦Q, and let σ=s0s1…s be a string of P symbols. P-1 (However, s i Extending a symbol string consisting of Q symbols (i=0, 1, …, P-1) (where i=0, 1, …, P-1) is a symbol included in the symbol set Sym) means concatenating a symbol string consisting of any QP symbols to the symbol string σ. Also, the set of symbol strings T obtained by extending a symbol string consisting of P symbols σ to a symbol string consisting of Q symbols is defined as the set of all symbol strings obtained by extending a symbol string consisting of P symbols σ to a symbol string consisting of Q symbols. Therefore, T={s0s1…s P-1 s P s P+1 …s Q-1 | si (i=P, P+1, …, Q-1) represents any symbol in the set Sym of symbols. In other words, the set T is 2 Q-P Furthermore, P n (n=0, …, N-1, N is an integer equal to or greater than 1), Q is P n Let Q be an integer greater than or equal to 0, and let the set of symbol strings {σ0, …, σ N-1} (where σ n (n=0, …, N-1) is P n A set of symbol strings T' obtained by extending the symbol string consisting of Q symbols from the symbol string consisting of Q symbols is called P n A string σ consisting of symbols n A set of symbol strings T that is an extension of n (n=0, …, N-1). For example, if the set of symbols is Sym={a, b, c}, then the set of symbol strings {ε} expanded to two-symbol strings is {aa, ab, ac, ba, bb, bc, ca, cb, cc}. Also, the set of symbol strings {a, b, ca} expanded to two-symbol strings is {aa, ab, ac, ba, bb, bc, ca}, the union of {aa, ab, ac}, {ba, bb, bc}, and {ca}.
[0198] The codebook in the second embodiment is composed of a triplet consisting of a set of symbol strings beginning with the input symbol string (hereinafter referred to as the input set), a codeword of a predetermined length to be output, and the codebook to be used next (hereinafter referred to as the link destination).Unlike the codebook in the first embodiment, no mode is assigned to the codebook.
[0199] The codebooks in the second embodiment will be described below using examples. Fig. 16 is a diagram showing an example of a codebook. Fig. 16 shows a codebook in the second embodiment, and this codebook is equivalent to the codebook in Fig. 9, i.e., it shows the same encoding rules. 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 consists of five codebooks: T0, T1, T2, T3, and T4.
[0200] An input set, which is a component of a codebook in the second embodiment, is generated using the symbol strings, which are the component of the codebook in the first embodiment, and the modes assigned to the codebook to be used next. An example will be given using codebook T0. In FIG. 9, the mode assigned to the codebook T1 to be used next, corresponding to symbol string a, is {a, b}. Here, the longest symbol string among the symbol strings included in the modes assigned to codebooks T0, T1, T2, T3, and T4, contains two symbols. Furthermore, the set of symbol strings obtained by expanding the set of symbol strings {a, b} to a string consisting of two symbols is {aa, ab, ac, ba, bb, bc}. Therefore, the input set corresponding to symbol string a is defined as a+{aa, ab, ac, ba, bb, bc}={aaa, aab, aac, aba, abb, abc} (see FIG. 16). Similarly, in Fig. 9, the mode assigned to the next codebook T2 to be used corresponding to symbol string ε is {ac, ba}, and the set of symbol strings obtained by extending the set of symbol strings {ac, ba} to two symbols is {ac, ba}, so the input set corresponding to symbol string ε is set to ε+{ac, ba}={ac, ba} (see Fig. 16). Also, in Fig. 9, the mode assigned to the next codebook T3 to be used corresponding to symbol string b is set to {b, c}, and the set of symbol strings obtained by extending the set of symbol strings {b, c} to two symbols is {ba, bb, bc, ca, cb, cc}, so the input set corresponding to symbol string b is set to b+{ba, bb, bc, ca, cb, cc}={bba, bbb, bbc, bca, bcb, bcc} (see Fig. 16).
[0201] In encoding / decoding, prefixes and suffixes of the symbol strings that are elements of the input set are treated differently. In the following, to distinguish them from the general terms prefix and suffix, the prefixes and suffixes of the symbol strings that are elements of the input set will be referred to as predetermined prefixes and predetermined suffixes, respectively, and will be defined as follows:
[0202] For a symbol string that is an element of the input set, the predetermined prefix and predetermined suffix are respectively the longest prefix common to all elements of the input set, and the symbol string minus the predetermined prefix of the symbol string.
[0203] The predetermined prefix of a symbol string that is an element of the input set does not have to be the longest prefix common to all elements of the input set, but can be any length among prefixes common to all elements of the input set. In this case, the predetermined prefix and predetermined suffix of a symbol string that is an element of the input set are defined as follows:
[0204] For a symbol string that is an element of the input set, the predetermined prefix and predetermined suffix are respectively a prefix common to all elements of the input set and the symbol string obtained by removing the predetermined prefix of the symbol string.
[0205] As can be seen from the above definition, the predetermined prefixes of symbol strings that are elements of an input set are always the same, so one predetermined prefix is determined for each input set. On the other hand, the predetermined endings of symbol strings that are elements of an input set are not always the same, so one or more predetermined endings are determined for each input set. Therefore, the predetermined prefixes of symbol strings that are elements of an input set are called the predetermined prefixes of the input set, and the set of predetermined endings of symbol strings that are elements of the input set is called the set of predetermined endings of the input set.
[0206] In the following examples in the Technical Background, a given prefix of a symbol string that is an element of an input set will be described as the longest prefix common to all elements of the input set.
[0207] An example will be described using codebook T0. In Fig. 16, the longest prefix common to all elements of input set {aaa, aab, aac, aba, abb, abc} is a. Therefore, the predetermined prefix for input set {aaa, aab, aac, aba, abb, abc} is a, and the predetermined set of suffixes is {aa, ab, ac, ba, bb, bc}. Similarly, in Fig. 16, the longest prefix common to all elements of input set {ac, ba} is ε, so the predetermined prefix for input set {ac, ba} is ε, and the predetermined set of suffixes is {ac, ba}. In addition, in FIG. 16, the longest prefix common to all elements of the input set {bba, bbb, bbc, bca, bcb, bcc} is b, so the predetermined prefix of the input set {bba, bbb, bbc, bca, bcb, bcc} is b, and the predetermined suffix set is {ba, bb, bc, ca, cb, cc}.
[0208] As can be seen from the above explanation, in the example of Figure 16, the last two symbols of a symbol string that is an element of the input set become the predetermined suffix of that symbol string. Therefore, the predetermined suffix set of the input set corresponding to a certain codeword corresponds to the mode of the next codebook to be used that corresponds to that codeword in the first embodiment. In other words, it can be seen that by using the input set, it is not necessary to specify the mode.
[0209] The method for determining the predetermined prefix and suffix for the symbol strings that are elements of the input set is shared between the encoding side and the decoding side.
[0210] Furthermore, the following two conditions are required for the codebook in order for encoding / decoding to satisfy the unique codability condition.
[0211] (1) For any codebook included in a plurality of codebooks, the union of the input sets of the codebooks satisfies the prefix condition.
[0212] (2) For any codebook included in the plurality of codebooks, a symbol string included in the input set of the next codebook to be used, which corresponds to a codeword of the codebook, has a predetermined suffix at the beginning of one of the symbol strings included in the input set corresponding to the codeword.
[0213] Here, the input set of a codebook refers to all input sets contained in that codebook. For example, the input set of codebook T0 is {aaa, aab, aac, aba, abb, abc}, {ac, ba}, {bba, bbb, bbc, bca, bcb, bcc}, {caa, cab, cac, cba, cbb, cbc, cca, ccb, ccc}. Furthermore, the codebook to be used after a codebook refers to all codebooks to be used next contained in that codebook. For example, the codebook to be used after codebook T0 is T1, T2, T3, and T0.
[0214] The above conditions (1) and (2) respectively correspond to the conditions (1) and (2) of the unique encoding possibility condition in the first embodiment. Therefore, in the second embodiment, as in the first modification of the first embodiment, multiple codebooks can satisfy the condition (2) but not the condition (1).
[0215] (Modification 1) The codebook in the second embodiment can be expressed more simply. This will be explained below.
[0216] The codebook in the first modification of the second embodiment also consists of a triplet consisting of a set of symbol strings beginning with the input symbol string (hereinafter referred to as the input set), a codeword of a predetermined length to be output, and the codebook to be used next (hereinafter referred to as the link destination). However, the codebook in the first modification of the second embodiment differs from the codebook in the second embodiment in the way the input set is expressed.
[0217] The codebooks in the first modification of the second embodiment will be described below using examples. Fig. 17 is a diagram showing an example of a codebook. Fig. 17 shows a codebook in the first modification of the second embodiment, and this codebook is equivalent to the codebooks in Fig. 9 and Fig. 16, i.e., it shows the same encoding rules. The codebook in Fig. 17 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 consists of five codebooks: T0, T1, T2, T3, and T4.
[0218] The input set, which is a component of the codebook in the first modification of the second embodiment, is generated using the symbol strings, which are the component of the codebook in the first embodiment, and the modes assigned to the codebook to be used next. An example will be described using codebook T0. In FIG. 9, the mode assigned to the codebook T1 to be used next, corresponding to symbol string a, is {a, b}. Therefore, the input set corresponding to symbol string a is set as a+{a, b}={aa, ab} (see FIG. 17). Similarly, in FIG. 9, the mode assigned to the codebook T2 to be used next, corresponding to symbol string ε, is set as {ac, ba}, so the input set corresponding to symbol string ε is set as ε+{ac, ba}={ac, ba} (see FIG. 17). Furthermore, in FIG. 9, the mode assigned to the codebook T3 to be used next, corresponding to symbol string b, is set as {b, c}, so the input set corresponding to symbol string b is set as b+{b, c}={bb, bc} (see FIG. 17).
[0219] The definitions of the predetermined prefixes and suffixes for the symbol strings that are elements of the input set are the same as above.
[0220] An example will be taken of codebook T0. In Fig. 17, the longest prefix common to all elements of input set {aa, ab} is a. Therefore, the predetermined prefix for input set {aa, ab} is a, and the predetermined set of suffixes is {a, b}. Similarly, in Fig. 17, the longest prefix common to all elements of input set {ac, ba} is ε, so the predetermined prefix for input set {ac, ba} is ε, and the predetermined set of suffixes is {ac, ba}. Also, in Fig. 17, the longest prefix common to all elements of input set {bb, bc} is b, so the predetermined prefix for input set {bb, bc} is b, and the predetermined set of suffixes is {b, c}.
[0221] As can be seen from the above explanation, the predetermined suffix set of the input set corresponding to a certain codeword coincides with the mode of the codebook to be used next corresponding to that codeword in the first embodiment. In other words, by using the input set, it is not necessary to specify the mode.
[0222] The conditions required for the codebook to satisfy the unique coding possibility condition for encoding / decoding are the same as those mentioned above.
[0223] (Variation 2) In the second embodiment and its variation 1, the codebooks have been described as being configured as triplet sets, but the predetermined suffix set of the input set corresponding to a certain codeword corresponds to or coincides with the mode of the next codebook to be used corresponding to that codeword in the first embodiment. Therefore, when the modes assigned to the codebooks differ among multiple codebooks, the codebooks can be configured as doublet sets by expressing them using a correspondence table consisting of pairs of the predetermined suffix set of the input set and the next codebook to be used. Note that a function can also be used instead of the correspondence table.
[0224] The codebook in the second modification of the second embodiment is composed of a set of symbol strings (hereinafter referred to as an input set) that starts with an input symbol string, and a pair of output codewords of a predetermined length. The codebook in the second modification of the second embodiment is used together with a correspondence table (hereinafter referred to as a transition correspondence table) that consists of pairs of a predetermined suffix set of the input set and the codebook to be used next, or a function (hereinafter referred to as a transition function) that takes the predetermined suffix set of the input set as input and outputs the codebook to be used next.
[0225] The codebook in Modification 2 of the second embodiment will be described below using an example. Figures 18 and 19 are diagrams showing an example of a codebook and an example of a correspondence table, respectively. Figure 18 shows a codebook in Modification 2 of the second embodiment, which is a codebook composed of pairs of input sets and codewords, which are components of the codebook in Figure 16. Figure 19 shows a correspondence table used together with the codebook in Figure 18.
[0226] Figures 20 and 21 are diagrams showing an example of a codebook and an example of a correspondence table, respectively. Figure 20 shows a codebook in Modification 2 of the second embodiment, which is a codebook consisting of pairs of input sets and codewords, which are components of the codebook in Figure 17. Figure 21 shows a correspondence table used together with the codebook in Figure 20.
[0227] The coding rules can also be expressed using analytic trees. Therefore, the above explanation of the codebook also applies to analytic trees, simply by replacing the word "codebook" with "analytic tree."
[0228] <<2: Encoding Procedure / Decoding Procedure>> First, the encoding procedure in the second embodiment will be described. The encoding procedure in the second embodiment uses a symbol string to be encoded (hereinafter referred to as an input symbol string) as input, and encodes the symbol string from a plurality of codebooks {T k} k=0 K-1 (where K is an integer equal to or greater than 2) to obtain code words corresponding to the symbol strings that make up the input symbol string, and then output a code word (hereinafter referred to as the output code word) obtained by concatenating all the obtained code words. k} k=0 K-1 In the process of obtaining a code word corresponding to a symbol string constituting an input symbol string using
[0000] , if there is a symbol string (hereinafter referred to as symbol string σ) included in the input set of the current codebook that matches the prefix of the current symbol string, a code word corresponding to the input set including that symbol string σ is obtained, the codebook to be used next that corresponds to the input set including that symbol string σ is set as the current codebook, and a symbol string obtained by excluding from the current symbol string any prefix that matches the predetermined prefix of any symbol string included in the input set including that symbol string σ is set as the current symbol string, and this process is repeated until the length of the current symbol string becomes 0. Here, the current symbol string refers to the symbol string currently being encoded, and the current symbol string at the time encoding starts refers to the input symbol string.
[0229] More specifically, the encoding procedure in the second embodiment comprises the following three steps:
[0230] (1) A predetermined codebook T k is used as the current codebook to start encoding. Here, k is an arbitrary integer between 0 and K-1, for example, k=0. Also, the input symbol string is used as the current symbol string.
[0231] (2) Using the current codebook, the current symbol string is compared with the symbol strings contained in the input set of the codebook. If there is a symbol string (hereinafter referred to as symbol string σ) contained in the input set of the current codebook that matches the prefix of the current symbol string, a codeword corresponding to the input set including the symbol string σ is obtained, the codebook to be used next corresponding to the input set including the symbol string σ is set as the current codebook, and the symbol string obtained by removing from the current symbol string any prefix that matches the predetermined prefix of any symbol string contained in the input set including the symbol string σ is set as the current symbol string. Note that, when there is no symbol string in the input set of the current codebook that matches the prefix of the current symbol string because the length of the current symbol string is shorter than the length of the symbol string included in the input set of the current codebook, and there is a symbol string (hereinafter referred to as symbol string σ) included in the input set of the current codebook that matches the prefix of a symbol string obtained by concatenating an arbitrary symbol string to the current symbol string, a codeword corresponding to the input set including that symbol string σ is obtained, and the codebook to be used next that corresponds to the input set including that symbol string σ is set as the current codebook, and the symbol string obtained by excluding a predetermined prefix of the input set that includes that symbol string σ from the current symbol string is set as the current symbol string.
[0232] (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).
[0233] The encoding procedure in the second modification of the second embodiment differs from the encoding procedure in the second embodiment in the process (2). Specifically, it is as follows.
[0234] (2) Using the current codebook, the current symbol string is compared with the symbol string included in the input set of the current codebook. If there is a symbol string (hereinafter referred to as symbol string σ) included in the input set of the current codebook that matches the prefix of the current symbol string, a codeword corresponding to the input set including the symbol string σ is obtained, and a transition correspondence table or a transition function is used to obtain the codebook to be used next that corresponds to the predetermined suffix set of the input set including the symbol string σ, and this codebook is set as the current codebook. The symbol string obtained by removing the prefix that matches the predetermined prefix of the input set including the symbol string σ from the current symbol string is set as the current symbol string. Note that, because the length of the current symbol string is shorter than the length of the symbol string included in the input set of the current codebook, there is no symbol string included in the input set of the current codebook that matches the prefix of the current symbol string. However, if there is a symbol string included in the input set of the current codebook (hereinafter referred to as symbol string σ) that matches the prefix of a symbol string obtained by concatenating an arbitrary symbol string to the current symbol string, a codeword corresponding to the input set including this symbol string σ is obtained, and a codebook to be used next that corresponds to a predetermined suffix set of the input set including this symbol string σ is obtained using a transition correspondence table or a transition function. This codebook is designated as the current codebook, and the symbol string obtained by excluding the predetermined prefix of the input set including this symbol string σ from the current symbol string is designated as the current symbol string.
[0235] In addition, instead of executing the process from the introductory part of process (2) in the encoding procedure in the second embodiment or its variant 2, the following processes (1) and (3) may be executed instead of the processes (1) and (3) above.
[0236] (1) A predetermined codebook T k is used as the current codebook and encoding is started. Here, k is an arbitrary integer between 0 and K-1 inclusive, for example, k = 0. Also, in the process of repeatedly executing process (2), the current symbol string is a symbol string obtained by concatenating an arbitrary symbol string of sufficient length to the input symbol string so that the length of the current symbol string does not become shorter than the length of the symbol string included in the input set of the current codebook.
[0237] (3) If the length of the current symbol string obtained by process (2) is equal to the length of the symbol string concatenated in process (1), 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 is terminated; otherwise, return to process (2).
[0238] Next, the decoding procedure in the second embodiment will be described. The decoding procedure in the second embodiment involves inputting a codeword to be decoded (hereinafter referred to as an input codeword) and decoding the codewords from a plurality of codebooks {T k} k=0 K-1 (However, if multiple codebooks {T k} k=0 K-1 is the codebook used in the encoding procedure) to obtain symbol strings corresponding to the codewords that make up the input codeword, and then output a symbol string (hereinafter referred to as the output symbol string) obtained by concatenating all the obtained symbol strings. k} k=0 K-1 In the process of obtaining a symbol string corresponding to a codeword constituting an input codeword using
[0000] , a symbol string that is a predetermined prefix of an arbitrary symbol string included in the input set corresponding to a codeword included in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword is obtained, the codebook to be used next that corresponds to codeword w is set as the current codebook, and the codeword obtained by removing the prefix that matches codeword w from the current codeword is set as the current codeword. This process is repeated until the length of the current codeword becomes 0. Here, the current codeword is the codeword that is currently being decoded, and the current codeword at the start of decoding is the input codeword.
[0239] More specifically, the decoding procedure in the second embodiment comprises the following three steps.
[0240] (1) A predetermined codebook T k is set as the current codebook and decoding begins. Here, k is the codebook number used when the encoding process of the input codeword began. Also, the input codeword is set as the current codeword.
[0241] (2) Using the current codebook, the current codeword is compared with the codewords contained in the codebook. A symbol string that is a predetermined prefix of an arbitrary symbol string contained in the input set corresponding to a codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword is obtained, and the codebook to be used next that corresponds to codeword w is set as the current codebook. The codeword obtained by removing the prefix that matches codeword w from the current codeword is set as the current codeword.
[0242] (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).
[0243] The decoding procedure in the second modification of the second embodiment differs from the decoding procedure in the second embodiment in the process (2). Specifically, it is as follows.
[0244] (2) Using the current codebook, compare the current codeword with the codewords contained in the codebook. Obtain a symbol string that is a predetermined prefix of an arbitrary symbol string contained in the input set corresponding to a codeword contained in the current codebook (hereinafter referred to as codeword w) that matches the prefix of the current codeword. Obtain a codebook to be used next that corresponds to a predetermined suffix set in the input set corresponding to codeword w using a transition correspondence table or transition function. Set this codebook as the current codebook, and set the codeword obtained by removing the prefix that matches codeword w from the current codeword as the current codeword.
[0245] The encoding procedure / decoding procedure using the above codebook can also be converted to an encoding procedure / decoding procedure using an analytic tree by simply replacing the word "codebook" with "analytic tree."
[0246] <<3: Example of Encoding / Decoding>> Here, as an example of encoding / decoding, encoding / decoding of the symbol string accba when using the codebook in Fig. 16 or Fig. 17 will be described. First, the case when the codebook in Fig. 16 is used will be described.
[0247] <<<3-1: Encoding / Decoding When the Codebook of Fig. 16 is Used>>> First, encoding will be described. Here, it is assumed that at the start of the encoding process, codebook T0 is used as the current codebook. The input is the symbol string accba to be encoded, and the symbol string accba is set as the current symbol string.
[0248] (1) Using the current codebook T0, the current symbol string accba is compared with the symbol strings included in the input set of the codebook T0. Since the symbol string ac is included in the input set of the current codebook T0 and matches the prefix of the current symbol string accba, the codeword 01 corresponding to the input set {ac, ba} including the symbol string ac is obtained, the codebook T2 to be used next corresponding to the input set {ac, ba} including the symbol string ac is set as the current codebook, and the symbol string accba obtained by removing the predetermined prefix ε of the input set {ac, ba} including the symbol string ac from the current symbol string accba is set as the current symbol string.
[0249] (2) Using the current codebook T2, the current symbol string accba is compared with the symbol strings included in the input set of the codebook T2. Since the symbol string accb is included in the input set of the current codebook T2 and matches the prefix of the current symbol string accba, a codeword 10 corresponding to the input set {acba, acbb, acbc, acca, accb, accc} including the symbol string accb is obtained, and the codebook T3 to be used next, which corresponds to the input set {acba, acbb, acbc, acca, accb, accc} including the symbol string accb, is set as the current codebook. The symbol string cba obtained by removing the predetermined prefix ac of the input set {acba, acbb, acbc, acca, accb, accc} including the symbol string accb from the current symbol string accba is set as the current symbol string.
[0250] (3) Using the current codebook T3, the current symbol string cba is compared with the codewords included in the input set of the codebook T3. Since the symbol string cba is included in the input set of the current codebook T3 and matches the prefix of the current symbol string cba, a codeword 11 corresponding to the input set {cba, cbb, cbc, cca, ccb, ccc} including the symbol string cba is obtained, and the codebook T3 to be used next that corresponds to the input set {cba, cbb, cbc, cca, ccb, ccc} including the symbol string cba is set as the current codebook. The symbol string ba obtained by removing the predetermined prefix c of the input set {cba, cbb, cbc, cca, ccb, ccc} including the symbol string cba from the current symbol string cba is set as the current codeword.
[0251] (4) Using the current codebook T3, the current symbol string ba is compared with the symbol strings included in the input set of the codebook T3. There is no symbol string included in the input set of the current codebook T3 that matches the prefix of the current symbol string ba. Therefore, the symbol string baaa obtained by concatenating the symbol string aa with the current symbol string ba is set as a tentative current symbol string, and the tentative current symbol string baaa is compared with the symbol strings included in the input set of the codebook T3. Since the input set of the current codebook T3 contains a symbol string baaa that matches the prefix of the tentative current symbol string baaa, a codeword 00 corresponding to the input set {baaa, baab, baac, baba, babb, babc, baca, bacb, bacc} containing the symbol string baaa is obtained, and the codebook T0 to be used next that corresponds to the input set {baaa, baab, baac, baba, babb, babc, baca, bacb, bacc} containing the symbol string baaa is set as the current codebook. A symbol string ε obtained by removing the predetermined prefix ba of the input set {baaa, baab, baac, baba, babb, babc, baca, bacb, bacc} containing the symbol string baaa from the current symbol string ba is set as the current codeword.
[0252] (5) Since the current symbol string ε is a symbol string of length 0, the code word 01101100 is output.
[0253] Next, decoding will be explained. At the start of the decoding process, the codebook T0 used at the start of the encoding process is set as the current codebook. The input is the codeword 01101100 to be decoded, and the codeword 01101100 is set as the current codeword. Also, λ represents a codeword of length 0.
[0254] (1) For the first two-bit codeword 01 of the current codeword 01101100, the current codebook T0 is used to obtain a symbol string ε, which is a predetermined prefix of the input set {ac, ba} corresponding to the codeword 01, and the codebook T2 to be used next, which corresponds to the codeword 01, is set as the current codebook. The codeword 101100, obtained by removing the first two-bit codeword 01 from the current codeword 01101100, is set as the current codeword.
[0255] (2) For the first two-bit codeword 10 of the current codeword 101100, the current codebook T2 is used to obtain a symbol string ac, which is a predetermined prefix of the input set {acba, acbb, acbc, acca, accb, accc} corresponding to the codeword 10, and the codebook T3 to be used next, which corresponds to the codeword 10, is set as the current codebook. The codeword 1100, obtained by removing the first two-bit codeword 10 from the current codeword 101100, is set as the current codeword.
[0256] (3) For the first two-bit codeword 11 of the current codeword 1100, use the current codebook T3 to obtain a symbol string c, which is a predetermined prefix of the input set {cba, cbb, cbc, cca, ccb, ccc} corresponding to the codeword 11, and set the next codebook T3 to be used corresponding to the codeword 11 as the current codebook. Also set the codeword 00, which is the current codeword 1100 minus the first two-bit codeword 11, as the current codeword.
[0257] (4) For the initial 2-bit codeword 00 of the current codeword 00, the current codebook T3 is used to obtain a symbol string ba, which is a predetermined prefix of the input set {baaa, baab, baac, baba, babb, babc, baca, bacb, bacc} corresponding to the codeword 00, and the codebook T0 to be used next, which corresponds to the codeword 00, is set as the current codebook. The codeword λ obtained by removing the initial 2-bit codeword 00 from the current codeword 00 is set as the current codeword.
[0258] (5) Since the current codeword λ is a codeword of length 0, the symbol string εaccba, that is, the symbol string accba, is output.
[0259] Next, a case where the codebook in FIG. 17 is used will be described.
[0260] <<<3-2: Encoding / Decoding When the Codebook of Fig. 17 is Used>>> First, encoding will be described. Here, it is assumed that at the start of the encoding process, codebook T0 is used as the current codebook. The input is the symbol string accba to be encoded, and the symbol string accba is set as the current symbol string.
[0261] (1) Using the current codebook T0, the current symbol string accba is compared with the symbol strings included in the input set of the codebook T0. Since the symbol string ac is included in the input set of the current codebook T0 and matches the prefix of the current symbol string accba, the codeword 01 corresponding to the input set {ac, ba} including the symbol string ac is obtained, the codebook T2 to be used next corresponding to the input set {ac, ba} including the symbol string ac is set as the current codebook, and the symbol string accba obtained by removing the predetermined prefix ε of the input set {ac, ba} including the symbol string ac from the current symbol string accba is set as the current symbol string.
[0262] (2) Using the current codebook T2, the current symbol string accba is compared with the symbol strings included in the input set of the codebook T2. Since the symbol string acc is included in the input set of the current codebook T2 and matches the prefix of the current symbol string accba, codeword 10 corresponding to the input set {acb, acc} including the symbol string acc is obtained, the codebook T3 to be used next corresponding to the input set {acb, acc} including the symbol string acc is set as the current codebook, and the symbol string cba obtained by removing the predetermined prefix ac of the input set {acb, acc} including the symbol string acc from the current symbol string accba is set as the current symbol string.
[0263] (3) Using the current codebook T3, the current symbol string cba is compared with the codewords contained in the input set of the codebook T3. Since the symbol string cb is included in the input set of the current codebook T3 and matches the prefix of the current symbol string cba, a codeword 11 corresponding to the input set {cb, cc} containing the symbol string cb is obtained, the codebook T3 to be used next corresponding to the input set {cb, cc} containing the symbol string cb is set as the current codebook, and the symbol string ba obtained by removing the predetermined prefix c of the input set {cb, cc} containing the symbol string cb from the current symbol string cba is set as the current codeword.
[0264] (4) Using the current codebook T3, the current symbol string ba is compared with the symbol strings included in the input set of the codebook T3. Since the symbol string ba is included in the input set of the current codebook T3 and matches the prefix of the current symbol string ba, the codeword 00 corresponding to the input set {ba} including the symbol string ba is obtained, the codebook T0 to be used next corresponding to the input set {ba} including the symbol string ba is set as the current codebook, and the symbol string ε obtained by removing the predetermined prefix ba of the input set {ba} including the symbol string ba from the current symbol string ba is set as the current codeword.
[0265] (5) Since the current symbol string ε is a symbol string of length 0, the code word 01101100 is output.
[0266] Next, decoding will be explained. At the start of the decoding process, the codebook T0 used at the start of the encoding process is set as the current codebook. The input is the codeword 01101100 to be decoded, and the codeword 01101100 is set as the current codeword. Also, λ represents a codeword of length 0.
[0267] (1) For the first two-bit codeword 01 of the current codeword 01101100, the current codebook T0 is used to obtain a symbol string ε, which is a predetermined prefix of the input set {ac, ba} corresponding to the codeword 01, and the codebook T2 to be used next, which corresponds to the codeword 01, is set as the current codebook. The codeword 101100, obtained by removing the first two-bit codeword 01 from the current codeword 01101100, is set as the current codeword.
[0268] (2) For the first two bits of the current codeword 101100, the current codebook T2 is used to obtain the symbol string ac, which is a predetermined prefix of the input set {acb, acc} corresponding to the codeword 10, and the codebook T3 to be used next, which corresponds to the codeword 10, is set as the current codebook. The codeword 1100, obtained by removing the first two bits of the codeword 10 from the current codeword 101100, is set as the current codeword.
[0269] (3) For the first two-bit codeword 11 of the current codeword 1100, use the current codebook T3 to obtain a symbol string c, which is a predetermined prefix of the input set {cb, cc} corresponding to the codeword 11, and set the next codebook T3 corresponding to the codeword 11 to be used as the current codebook. Also, set the codeword 00 obtained by removing the first two-bit codeword 11 from the current codeword 1100 as the current codeword.
[0270] (4) For the first two bits of the current codeword 00, obtain a symbol string ba, which is a predetermined prefix of the input set {ba} corresponding to the codeword 00, using the current codebook T3. Then, the codebook T0 to be used next, which corresponds to the codeword 00, is set as the current codebook. The codeword λ obtained by removing the first two bits of the codeword 00 from the current codeword 00 is set as the current codeword.
[0271] (5) Since the current codeword λ is a codeword of length 0, the symbol string εaccba, that is, the symbol string accba, is output.
[0272] Second Embodiment An encoding device 1100 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 1200 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).
[0273] The encoding device 1100 and the decoding device 1200 use a plurality of codebooks or parse trees {T k} k=0 K-1 (where K is an integer greater than or equal to 2) is a data structure with the following characteristics:
[0274] (1) Codebook or parse tree T k (k=0, 1, ..., K-1) consists of at least two pairs of a set of symbol strings (hereinafter referred to as an input set) beginning with a symbol string for obtaining a corresponding code word of a predetermined length, and the code word of the predetermined length.
[0275] Here, the predetermined prefix and predetermined suffix of a symbol string that is an element of an input set are respectively a prefix common to all elements of the input set, and the symbol string minus the predetermined prefix of the symbol string.
[0276] (2) Codebook or parse tree T k The union of the input set (k=0, 1,…, K-1) satisfies the prefix condition, and the codebook or parse tree T k The symbol string included in the input set of the codebook or parse tree to be used next corresponding to the codeword (k=0, 1, ..., K-1) satisfies the condition that it has at its beginning a predetermined ending of any symbol string included in the input set corresponding to the codeword.
[0277] Codebook or parse tree T k (k=0, 1, ..., K-1) may be composed of a triplet of an input set, a codeword of a predetermined length, and the codebook or parse tree to be used next, or may be composed of two pairs of an input set and a codeword of a predetermined length. In the second configuration, the codebook or parse tree T k (k=0, 1, ..., K-1) is used together with a correspondence table (hereinafter referred to as a transition correspondence table) consisting of a set of predetermined suffixes of an input set of a codebook or analytic tree and a pair of the codebook or analytic tree to be used next. Note that instead of the transition correspondence table, a function (hereinafter referred to as a transition function) may be used that takes as input a predetermined suffixes of an input set of a codebook or analytic tree and outputs the codebook or analytic tree to be used next.
[0278] As explained in the technical background, multiple codebooks or parse trees {T k} k=0 K-1 satisfies conditions (1) and (2), multiple codebooks or parse trees {T k} k=0 K-1satisfies the unique codability condition. However, if multiple codebooks or parse trees {T k} k=0 K-1 is sufficient as a code if it satisfies condition (2).
[0279] <<Encoding Device 1100>> The encoding device 1100 will be described below with reference to Figs. 12 and 13. Fig. 12 is a block diagram showing the configuration of the encoding device 1100. Fig. 13 is a flowchart showing the operation of the encoding device 1100. As shown in Fig. 12, the encoding device 1100 includes an encoding unit 1110 and a recording unit 1190. The recording unit 1190 is a component that appropriately records information required for the processing of the encoding device 1100. The recording unit 1190 stores, for example, a plurality of codebooks or parse trees {T k} k=0 K-1 Keep a record of the following.
[0280] The operation of the encoding device 1100 will be described with reference to FIG.
[0281] In S1110, the encoding unit 1110 generates a plurality of codebooks or 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.
[0282] Codebook or parse tree T k The processing of the encoding unit 1110 will be described in detail according to the differences in the configuration.
[0283] (1) Codebook or parse tree T k When (k=0, 1, ..., K-1) consists of a triplet of an input set, a codeword of a predetermined length, and the codebook or parse tree to be used next, the encoding unit 1110 executes an encoding process consisting of the following three steps:
[0284] (1-1) Codebook or analytic tree T k(where k is an integer between 0 and K-1) as the current codebook or analytic tree, and the input symbol string as the current symbol string. (1-2) Using the current codebook or analytic tree, the current symbol string is compared with the symbol strings contained in the input set of the codebook or analytic tree. If there is a symbol string (hereafter referred to as symbol string σ) contained in the input set of the current codebook or analytic tree that matches the prefix of the current symbol string, a codeword corresponding to the input set including that symbol string σ is obtained, and the codebook or analytic tree to be used next corresponding to the input set including that symbol string σ is set as the current codebook or analytic tree. The symbol string obtained by removing from the current symbol string any prefix that matches the predetermined prefix of any symbol string contained in the input set including that symbol string σ is set as the current symbol string (however, if the length of the current symbol string is longer than the length of the input set of the current codebook or analytic tree, (1-3) If there is no symbol string included in the input set of the current codebook or analytic tree that matches the prefix of the current symbol string because the length of the symbol string is shorter than the length of the symbol string included in the set, and if there is a symbol string included in the input set of the current codebook or analytic tree that matches the prefix of the symbol string obtained by concatenating an arbitrary symbol string to the current symbol string (hereinafter referred to as symbol string σ), a codeword corresponding to the input set including the symbol string σ is obtained, and the codebook or analytic tree to be used next that corresponds to the input set including the symbol string σ is set as the current codebook or analytic tree, and the symbol string obtained by excluding the predetermined prefix of the arbitrary symbol string included in the input set including the symbol string σ from the current symbol string is set as the current symbol string. (1-3) If the length of the current symbol string obtained by the process in (1-2) is 0, the codeword obtained by concatenating all the codewords obtained by the process in (1-2) is output as the output codeword, and the encoding process is terminated, but otherwise the process returns to the process in (1-2). (2) Codebook or analytic tree T k When (k=0, 1, ..., K-1) consists of two sets of an input set and a codeword of a predetermined length, the encoding unit 1110 executes the encoding process consisting of the following three processes. The transition correspondence table and transition functions are recorded in the recording unit 1190.
[0285] (2-1) Codebook or analytic tree T k(where k is an integer between 0 and K-1) as the current codebook or analytic tree, and the input symbol string as the current symbol string. (2-2) Using the current codebook or analytic tree, compare the current symbol string with the symbol strings included in the input set of the codebook or analytic tree, and if there is a symbol string included in the input set of the current codebook or analytic tree (hereinafter referred to as symbol string σ) that matches the prefix of the current symbol string, obtain a codeword corresponding to the input set including that symbol string σ, and use a transition correspondence table or transition function to obtain the codebook or analytic tree to be used next that corresponds to the predetermined suffix set of the input set including that symbol string σ, and set that codebook or analytic tree as the current codebook or analytic tree, and set the symbol string obtained by excluding from the current symbol string any prefix that matches the predetermined prefix of any symbol string included in the input set including that symbol string σ as the current symbol string (however, if the length of the current symbol string is longer than the length of the input If there is no symbol string in the input set of the current codebook or parse tree that matches the prefix of the current symbol string because the length of the symbol string is shorter than the length of the symbol string included in the set, and there is a symbol string (hereinafter referred to as symbol string σ) in the input set of the current codebook or parse tree that matches the prefix of the symbol string obtained by concatenating an arbitrary symbol string to the current symbol string, obtain a codeword corresponding to the input set that includes that symbol string σ, use a transition correspondence table or transition function to obtain a codebook or parse tree to be used next that corresponds to a predetermined suffix set of the input set that includes that symbol string σ, set that codebook or parse tree as the current codebook or parse tree, and set the symbol string obtained by removing the predetermined prefix of any symbol string included in the input set that includes that symbol string σ from the current symbol string as the current symbol string. (2-3) If the length of the current symbol string obtained by the process (2-2) is 0, output the codeword obtained by concatenating all codewords obtained by the process (2-2) as an output codeword, and end the encoding process; otherwise, return to the process (2-2). <<Decoding Device 1200>> The decoding device 1200 will be described below with reference to FIGS. 14 and 15. FIG. 14 is a block diagram showing the configuration of the decoding device 1200. FIG. 15 is a flowchart showing the operation of the decoding device 1200. As shown in FIG. 14, the decoding device 1200 includes a decoding unit 1210 and a recording unit 1290. The recording unit 1290 is a component that appropriately records information necessary for the processing of the decoding device 1200.The recording unit 1290 stores, for example, a plurality of codebooks or parse trees {T. k} k=0 K-1 (However, {T k} k=0 K-1 The input codeword is encoded using a plurality of codebooks or parse trees.
[0286] The operation of the decoding device 1200 will be described with reference to FIG.
[0287] In S1210, the decoding unit 1210 generates a plurality of codebooks or parse trees {T k} 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.
[0288] Codebook or parse tree T k The processing of the decoding unit 1210 will be described in detail according to the difference in the configuration.
[0289] (1) Codebook or parse tree T k When (k=0, 1, ..., K-1) consists of a triplet of an input set, a codeword of a predetermined length, and the codebook or parse tree to be used next, the decoding unit 1210 executes a decoding process consisting of the following three steps:
[0290] (1-1) Codebook or analytic tree T k(where k is the number of the codebook or analytic tree used when the encoding process of the input codeword started) as the current codebook or analytic tree, and the input codeword as the current codeword. (1-2) Using the current codebook or analytic tree, compare the current codeword with the codeword contained in the codebook or analytic tree, obtain a symbol string that is a predetermined prefix of an arbitrary symbol string contained in the input set corresponding to the codeword contained in the current codebook or analytic tree (hereinafter referred to as codeword w) that matches the prefix of the current codeword, and set the codebook or analytic tree to be used next corresponding to the codeword w as the current codebook or analytic tree, and set the codeword obtained by removing the prefix that matches the codeword w from the current codeword as the current codeword. (1-3) If the length of the current codeword obtained by the process in (1-2) is 0, output the symbol string obtained by concatenating all the symbol strings obtained by the process in (1-2) as the output symbol string, and end the decoding process, but otherwise return to the process in (1-2). (2) Codebook or analytic tree T k When (k=0, 1, ..., K-1) consists of two sets of an input set and a codeword of a predetermined length, the decoding unit 1210 executes the decoding process consisting of the following three processes. The transition correspondence table and transition functions are recorded in the recording unit 1290.
[0291] (2-1) Codebook or analytic tree T k(where k is the number of the codebook or analytic tree used when the encoding process of the input codeword started) as the current codebook or analytic tree, and the input codeword as the current codeword. (2-2) Using the current codebook or analytic tree, compare the current codeword with the codeword contained in the codebook or analytic tree, obtain a symbol string that is a predetermined prefix of an arbitrary symbol string contained in the input set corresponding to the codeword contained in the current codebook or analytic tree (hereinafter referred to as codeword w) that matches the prefix of the current codeword, obtain the codebook or analytic tree to be used next that corresponds to the predetermined suffix set of the input set corresponding to the codeword w using a transition correspondence table or transition function, set the codebook or analytic tree to be used next as the current codebook or analytic tree, and set the codeword obtained by excluding the prefix that matches the codeword w from the current codeword as the current codeword. (2-3) If the length of the current codeword obtained by the process in (2-2) is 0, output the symbol string obtained by concatenating all the symbol strings obtained by the process in (2-2) as the output symbol string, and terminate the decoding process, but otherwise return to the process in (2-2). It is also possible to perform encoding / decoding by combining the encoding device / decoding device of the first embodiment with the encoding device / decoding device of the second embodiment. For example, encoding can be performed by the encoding device of the first embodiment, and decoding can be performed by the decoding device of the second embodiment. During encoding, there are cases where the current symbol string is shorter than the symbol string to be compared. In this case, encoding can be performed using a symbol string obtained by concatenating an arbitrary symbol string to the current symbol string.
[0292] <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.
[0293] 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.
[0294] 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.
[0295] 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 22, and operating the control unit 2010, input unit 2030, output unit 2040, display unit 2050, etc.
[0296] 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.
[0297] 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.
[0298] 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).
[0299] 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.
[0300] 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.
[0301] [Notes] The encoding / decoding of the above-described embodiments can be summarized as follows: [Note 1] A decoding device comprising: a decoding processing unit that decodes a plurality of codewords included in an input codeword sequence by using a plurality of codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded, and the decoding processing unit verifies the correctness of the codebook or the analytic tree used for the decoding based on a decoding result obtained based on a process of decoding at least one of the plurality of codewords while switching the codebook or the analytic tree used for the decoding according to a predetermined rule.
[0302] [Supplementary Note 2] The decoding device of Supplementary Note 1, wherein the decoding processing unit verifies the correctness of the codebook or the analytic tree used for the decoding based on the decoding result and verification information that depends on a correct codebook or analytic tree for the decoding.
[0303] [Supplementary Note 3] The decoding device of Supplementary Note 1, wherein the decoding processing unit verifies the correctness of the codebook or the analytic tree used for the decoding based on the decoding result and verification information that depends on a history of switching of the correct codebook or analytic tree for the decoding.
[0304] [Supplementary Note 4] The decoding device according to Supplementary Note 3, wherein the input codeword sequence further includes the verification information.
[0305] [Supplementary Note 5] The decoding device of Supplementary Note 1, wherein the plurality of codewords include a first codeword and a second codeword, the decoding result is obtained based on a process of decoding the first codeword and includes information specifying a codebook or an analytic tree to be used for decoding the second codeword, and the decoding processing unit verifies the correctness of the codebook or the analytic tree used for decoding the first codeword based on whether the second codeword can be decoded using the codebook or the analytic tree specified from the decoding result.
[0306] [Supplementary Note 6] A coding device comprising: a coding processing unit that encodes a plurality of symbol strings included in an input symbol string using a plurality of codebooks or analytic trees in which correspondences between symbol strings and code words are recorded, wherein the coding processing unit encodes each of the plurality of symbol strings while switching the codebook or analytic tree used for encoding according to a predetermined rule, and outputs verification information that depends on a history of switching the codebook or the analytic tree.
[0307] [Supplementary Note 7] A coding device comprising: a coding processing unit that encodes a plurality of symbol strings included in an input symbol string using a plurality of codebooks or analytic trees in which correspondences between symbol strings and code words are recorded, wherein the coding processing unit outputs a codeword sequence including a plurality of codewords obtained by encoding each of the plurality of symbol strings while switching the codebook or analytic tree used for encoding according to a predetermined rule, and verification information that depends on a history of switching the codebook or the analytic tree.
[0308] [Supplementary Note 8] A decoding method executed by a decoding device, comprising a decoding processing step of decoding a plurality of codewords included in an input codeword sequence using a plurality of codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded, wherein the decoding processing step is a step of verifying the correctness of the codebook or the analytic tree used for the decoding based on a decoding result obtained based on a process of decoding at least one of the plurality of codewords while switching the codebook or the analytic tree used for the decoding according to a predetermined rule.
[0309] [Supplementary Note 9] An encoding method executed by an encoding device, comprising an encoding processing step of encoding a plurality of symbol strings included in an input symbol string using a plurality of codebooks or analytic trees in which correspondences between symbol strings and code words are recorded, wherein the encoding processing step includes a step of encoding each of the plurality of symbol strings while switching the codebook or analytic tree used for encoding according to a predetermined rule, and outputting verification information that depends on a history of switching the codebook or the analytic tree.
[0310] [Supplementary Note 10] An encoding method executed by an encoding device, comprising an encoding processing step of encoding a plurality of symbol strings included in an input symbol string using a plurality of codebooks or analytic trees in which correspondences between symbol strings and code words are recorded, wherein the encoding processing step includes a step of outputting a codeword sequence including a plurality of codewords obtained by encoding each of the plurality of symbol strings while switching the codebook or analytic tree used for encoding according to a predetermined rule, and verification information depending on a history of switching the codebook or the analytic tree.
[0311] [Supplementary Note 11] A program for causing a computer to function as the decoding device according to any one of Supplementary Notes 1 to 5.
[0312] [Supplementary Note 12] A program for causing a computer to function as the encoding device of Supplementary Note 6 or 7.
[0313] 11, 12 Encoding device 111, 211 Encoding processing unit 12, 22 Decoding device 121, 221 Decoding processing unit
Claims
1. A decoding device having a decoding processing unit that decodes multiple codewords included in an input codeword sequence using multiple codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded, and the decoding processing unit verifies the correctness of the codebook or analytic tree used for the decoding based on the decoding result obtained based on a process of decoding at least one of the multiple codewords while switching the codebook or analytic tree used for the decoding according to a predetermined rule.
2. A decoding device according to claim 1, wherein the decoding processing unit verifies the correctness of the codebook or analytic tree used for the decoding based on the decoding result and verification information that depends on the correct codebook or analytic tree for the decoding.
3. A decoding device according to claim 1, wherein the decoding processing unit verifies the correctness of the codebook or analytic tree used for the decoding based on the decoding result and verification information that depends on a history of switching to the correct codebook or analytic tree for the decoding.
4. A decoding device according to claim 3, wherein the input codeword sequence further includes the verification information.
5. A decoding device according to claim 1, wherein the plurality of code words include a first code word and a second code word, the decoding result is obtained based on a process of decoding the first code word and includes information specifying a codebook or analytic tree to be used in decoding the second code word, and the decoding processing unit verifies the correctness of the codebook or analytic tree used in decoding the first code word based on whether the second code word can be decoded using the codebook or analytic tree specified from the decoding result.
6. A decoding method executed by a decoding device, comprising a decoding processing step of decoding a plurality of codewords included in an input codeword sequence using a plurality of codebooks or analytic trees in which correspondences between symbol strings and codewords are recorded, wherein the decoding processing step is a step of verifying the correctness of the codebook or analytic tree used for the decoding based on a decoding result obtained based on a process of decoding at least one of the plurality of codewords while switching the codebook or analytic tree used for the decoding according to a predetermined rule.
7. A program for causing a computer to function as the decoding device of claim 1.
Citation Information
Patent Citations
Data compression device and data restoring device
WO2008078390A1