WO2007108395A1 - 可変長符号の復号装置および復号方法 - Google Patents

可変長符号の復号装置および復号方法 Download PDF

Info

Publication number
WO2007108395A1
WO2007108395A1 PCT/JP2007/055221 JP2007055221W WO2007108395A1 WO 2007108395 A1 WO2007108395 A1 WO 2007108395A1 JP 2007055221 W JP2007055221 W JP 2007055221W WO 2007108395 A1 WO2007108395 A1 WO 2007108395A1
Authority
WO
WIPO (PCT)
Prior art keywords
prefix
codeword
length
decoding
word length
Prior art date
Application number
PCT/JP2007/055221
Other languages
English (en)
French (fr)
Inventor
Takahiro Kumura
Original Assignee
Nec Corporation
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nec Corporation filed Critical Nec Corporation
Priority to US12/225,422 priority Critical patent/US7924179B2/en
Priority to JP2008506268A priority patent/JPWO2007108395A1/ja
Publication of WO2007108395A1 publication Critical patent/WO2007108395A1/ja

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/40Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30018Bit or string instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30021Compare instructions, e.g. Greater-Than, Equal-To, MINMAX
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/423Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Definitions

  • the present invention relates to a technique for decoding a compression-coded signal, and more particularly to a variable length code decoding apparatus and method.
  • Variable-length encoding is widely used to compress images and music.
  • Variable length coding is a coding method that assigns codewords preferentially with high appearance probability, short symbols.
  • the variable length code ⁇ has a feature that the average word length of the code word can be reduced.
  • (a) Simple table 'Lookup method is the simplest method.
  • the word length of the longest codeword is set to N bits, N bits are extracted from the beginning of the input bit string, and elements are extracted from a table with 2N elements using the N bits as an index.
  • the element extracted from the table is the symbol corresponding to the code word.
  • the size of the table is large.
  • (b) Reading ⁇ Sign 'count method decodes a group of codewords based on the number of consecutive 1s and 0s (sign bits) at the beginning of the input bit string. Take the M bits following the sign bit at the beginning of the input bit string and use it to decode the codeword. M is 4 or 5 and varies depending on the codeword structure. However, in many cases, only a part of M is meaningful. There is a lot of useless data in the table. Although the table is smaller than the simple “table” lookup method in (a), two types of tables (code length, symbol) may be required depending on the codeword structure. Most software variable-length decoders use this method.
  • the noinari 'tree method is a bitwise decoding method that follows a binary tree representing a codeword. Is the method. When you reach the leaf of the tree, decode the symbol with a table lookup etc.
  • Prefix The “grouping method” is a decoding method based on the fact that “a codeword is divided into a prefix and a suffix”. Compare the input bit string with the prefix status of all codewords and check which prefix. Since the prefix and code length correspond one-to-one, the code length is automatically known when the prefix can be specified. When the input bit string prefix is known, the suffix is extracted from the input bit string. Once you have identified the prefix and suffix, you can get an offset to reference them. Search the table using the offset to retrieve the symbol corresponding to the codeword. Regarding this prefix 'grouping method, there are Patent Documents 1 and 2, and Non-Patent Documents 1 and 2.
  • the prefix 'grouping method is smaller in table size than the reading' sign 'counting method in (b), and the table size is approximately equal to the number of symbols. This method is suitable for hardware implementation because it is usually difficult to perform the comparison process between the input bit string and the prefix and the process of calculating the prefix and suffix force offset in software.
  • Patent Document 1 Japanese Patent Laid-Open No. 7-235878
  • Patent Document 2 Japanese Translation of Special Publication 2002-516501
  • Non-Patent Literature 1 Bai- Jue Shieh et al., A New Approach of uroup-Based VLC codec System with Full Table Programmability, "IEEE Transactions on ireuits and Systems for Video Technology, Vol.11, No.2, Feb . 2001.
  • Non-Patent Document 2 Cheng- Teh Hsieh et al., "A Concurrent Memory-efficient VLC Decoder for MPEG Applications, lEEE Transactions on Consumer Electronics, Vol.42, Aug. 1996.
  • the prefix grouping method in addition to the table storing symbols, (1) the prefix, (2) the word length of the codeword including the prefix, and (3) the suffix word length corresponding to the prefix A table to store is needed. Therefore, the prefix grouping method has the feature that the table size for storing symbols is very small, but the size of the table for storing (1), (2) and (3) above is large when there are many types of prefixes. There is a problem of becoming big.
  • variable-length code decoder is a low-efficiency / low-efficiency decoder that uses the prefix grouping method, but is an MPEG-2 code method. Strong dependence. Therefore, it is possible to apply the principle of this decoder to other coding schemes, but it is necessary to design a new decoder.
  • an object of the present invention is to provide a variable length code decoding apparatus and decoding method for compactly storing information related to a prefix.
  • Another object of the present invention is to provide a variable length code decoding method and apparatus that can handle various types of variable length codes.
  • a decoding device that decodes a codeword using a prefix included in a variable-length-coded codeword, and includes a plurality of prefixes used for decoding.
  • Storage means for storing a prefix common part common to each task, a prefix individual part other than the prefix common part in each prefix, and an input bit string including an unknown codeword of a variable-length code, and stored in the storage means
  • Each prefix common part and multiple prefix individual parts corresponding to the prefix common part And a prefix identifying means for judging which prefix is included in the input bit string stored in the storage means.
  • a decoding device that decodes a variable-length-coded codeword using a decoded value table, and a plurality of codewords used for decoding and those words.
  • Storage means for storing a length and an input bit string including an unknown codeword of a variable-length code, and the codewords out of the plurality of codewords using the plurality of codewords and their word lengths.
  • Identification means for determining whether or not the power is included in the input bit string, word length calculation means for calculating the word length of the unknown codeword included in the input bit string based on the determination result, and based on the determination result Then, the index calculation means for calculating an index for referring to the decoded value table, the identification means, the word length so as to generate the word length and the index of the unknown codeword included in the input bit string Calculation Characterized in that it has control means for controlling the stage and the index calculating means.
  • a variable length code decoding method for decoding a code word using a prefix included in a variable length encoded code word.
  • a prefix common part common to a plurality of prefixes used for decoding is stored in the storage means, and a prefix individual part other than the prefix common part is stored in the storage means for each prefix! /
  • An input bit string including an unknown codeword of a variable length code is stored in the storage means, and each prefix common part stored in the storage means and a plurality of prefix individual parts corresponding to the prefix common part.
  • the method includes the steps of generating a prefix and determining whether one of the plurality of prefixes is included in the input bit string.
  • a program for operating the decryption device according to the first and second aspects and a command for executing the decryption method according to the third aspect are provided to a computer.
  • a program (product) is provided.
  • the program has a processing step for executing each step of the decoding method of the third aspect, or operates each means of the decoding device of the second aspect.
  • a decoding device that decodes a codeword using a prefix included in a variable-length-coded codeword, and includes a plurality of prefixes used for decoding.
  • An input bit string including an unknown code word of a long code, storage means for storing, and a prefix status among a plurality of prefixes generated from the prefix common part and a plurality of prefix individual parts is included in the input bit string
  • the prefix identifying means for determining whether or not the power is used, and the word length of the prefix common part, the word length of the prefix individual part, and the word length of the suffix, which are specified based on the determination result,
  • a word that calculates the word length of an unknown codeword contained in the input bit string Included in
  • the decoding device can be mounted on a program control processor.
  • the storage means is a register file
  • the control means is configured to execute the prefix identification means
  • the instruction decoder controls the word length calculating means and the index calculating means, and stores the calculated word length of the unknown codeword and the decoding table index in the register file.
  • a variable-length code decoding apparatus is a processor that can operate as a variable-length code decoder that decodes a variable-length code using a prefix included in a variable-length-coded codeword (see FIG. Reference numeral 100) of 2 and can be configured as follows.
  • a bit string common to a plurality of prefixes (common part), a word length of the common part, and a bit string of each prefix other than the common part (individual part)
  • the input bit string including each individual part and its word length, suffix word length, and variable-length code word is stored.
  • the prefix identifying means determines which prefix is included in the input bit string from among the plurality of prefixes in which the prefix common part and the plurality of prefix individual parts are also generated. To do.
  • the word length calculation means (the code word length calculation unit 103 in FIG. 2) uses the word length of the prefix common part, the word length of the prefix individual part, and the word length of the suffix specified based on the determination result to input bit string.
  • the word length of the unknown codeword included in is calculated.
  • the index calculation means calculates the index of the decoding table using the word length of the suffix and the word length of the unknown codeword specified based on the determination result.
  • control means (the instruction decoder 105 and the program memory 109 in FIG. 2) operates the identification means, the index calculation means, and the word length calculation means in response to the instruction given to the processor.
  • the index calculated by the index calculating means and the word length of the codeword calculated by the word length calculating means are stored in the register file.
  • the first effect of the present invention is that the size of a storage area for storing a prefix can be reduced.
  • N prefixes are stored as they are in a storage means such as a memory or a register.
  • the prefix length varies from 1 bit to several tens of bits, and the number of prefixes N varies from less than 10 to about 30.
  • the variable length code used for the video AC code MPEG-2 intra AC coefficient code has 23 prefixes, and the prefix word length is 2 to 12 bits.
  • the prefix type and word length vary slightly depending on how the prefix is extracted.
  • 23 X 2 46 bytes of register are required to store 23 prefixes.
  • variable length code for a scale factor of the MPEG-2 AAC (advanced audio coding) music coding method There are 37 prefixes included in the variable length code for scalefactor.
  • variable-length codes of various code methods can be decoded at high speed. That is, in response to an instruction given to the processor, the identification unit, the index calculation unit, and the word length calculation unit are operated to calculate the word length of the index and the unknown codeword, and the number of prefixes increases. However, by dividing them into multiple groups and repeating the same process, it is possible to flexibly cope with various encoding methods. In addition, it is possible to perform high-speed decoding by loading data with less capacity than before into the register file in the processor.
  • FIG. 1 (A) is a schematic diagram of a codeword in which a codeword is divided into a prefix and a suffix, and (B) is a common part of a prefix used in the variable length code decoding method according to the present invention. It is a schematic diagram showing individual parts.
  • FIG. 2 is a functional block diagram showing a variable length code decoding apparatus according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram showing information relating to a prefix and an input bit string stored in a register file 101 used in the decoding device of FIG. 2.
  • FIG. 4 is a schematic diagram showing eight prefixes generated by the bit matching unit 102.
  • FIG. 5 is an explanatory diagram showing a procedure for obtaining a decoded value index symboljndex.
  • FIG. 6 is a flowchart showing a decoding method according to an embodiment of the present invention.
  • Fig. 1 (A) is a schematic diagram of a code word in which the code word is divided into a prefix and a suffix
  • Fig. 1 (B) is a common part of the prefix used in the variable length code decoding method according to the present invention and It is a schematic diagram which shows an individual part.
  • the code word is divided into a prefix lO and a suffix l l.
  • the suffix 11 is a bit string obtained by removing the prefix 10 from the codeword.
  • the bit string common to the plurality of prefixes 10 is the common part 12, the common part 12 is removed from the prefix 10, and the bit string is the individual part 13.
  • Figure 1 (B) shows one common part prefix_common and n prefix individual parts prefix_part [0] -prefix_part [n-1].
  • the common unit 12 and any one individual unit 13 can be used to configure any prefix among V prefixes and n prefixes. For example, if prefix_common and prefix_part [i] are concatenated, the i-th prefix can be obtained.
  • variable length code has a property that the number of code words including the same bit string at the head of the code word increases as the word length of the code word increases. This is a general property of variable length codes. The present invention uses this property to divide the prefix into the common unit 12 and the individual unit 13, thereby reducing the prefix storage capacity.
  • the plurality of prefixes may be divided into two or more groups, and the common unit 12 and the individual unit 13 described above may be generated for each group prefix. If the number of prefix statuses is N and the number of groups is M, M common parts 12 and N individual parts 13 are obtained for N prefixes. Thus, even when the prefix is divided into a plurality of groups, the storage capacity of the prefix can be reduced.
  • Table 2 Codeword and prefix correspondence table
  • codewords are arranged in ascending order as binary numbers.
  • This process further divides the codeword group into several groups.
  • codewords belonging to the same codeword group have the same word length and the same prefix.
  • the prefix As described above, there is a one-to-one relationship between the prefix and the word length of the code word. This relationship can be used to identify unknown codewords. In other words, the prefix status of the unknown codeword is examined, and the prefix length is also known for the word length of the unknown codeword. Subsequently, the prefix is removed from the unknown codeword, and the suffix is extracted. Can be determined.
  • the size of the symbol table storing the decoded values (symbols) corresponding to the codeword can be very small. This is because when a symbol corresponding to an unknown codeword is extracted from the symbol table, it is specified which codeword is the unknown codeword, so one symbol corresponding to each codeword is assigned to the symbol table. This is because it is only necessary to store it in.
  • variable-length codes have the property that the number of codewords that contain similar bit strings at the beginning of the codeword increases as the word length of the codeword increases.
  • the prefix common unit 12 is a bit string common to a plurality of prefixes. As shown in Table 2, the 4 bits on the left side of all prefixes match as shown in the component. Actually, the power of the left 5 bits of the five prefixes in Table 2 is common. If the left 5 bits are used as a common part, the individual part of the codeword "01010 0" is lost, so the left 4 bits of the prefix are used. adopt. Thus, the left 4 bits “0101” common to the five prefixes in Table 2 are used as the common part 12. The prefixes shown in Table 2 are classified into common part 12 and individual part 13, and the results compiled as prefix information are shown in Table 3.
  • a variable-length code word is decoded from an input bit string including an unknown code word using this prefix-related information.
  • Prefix-related information used in the decoding method according to the embodiment of the present invention is the following (1) to (5), and (6) is an input bit string to be decoded.
  • n 8.
  • FIG. 2 is a functional block diagram showing a variable length code decoding apparatus according to an embodiment of the present invention.
  • the decoding device according to the present embodiment can be realized by the program control processor 100.
  • the register value 101 in the processor 100 is used, and the bit matching unit 102, the codeword length calculation unit 103, and the index calculation unit 104 are used to decode the decoded value index boljndex can be calculated at high speed.
  • Bit matching unit 102, codeword length calculation unit 103, and index calculation unit 104 are controlled by a control signal from instruction decoder 105.
  • the processor 100 also registers the register file according to the control signal from the instruction decoder 105.
  • the prefix related information and the input bit string to be stored in the file 101 are input through the input / output unit 106 and stored.
  • a configuration example of the decoding device in the present embodiment is as follows.
  • the register file 101 has 16 64-bit registers, and prefix-related information and an input bit string necessary for decoding a codeword of a variable length code, that is,
  • the bit matching unit 102 receives the above four types of prefix-related information (1) to (4) and the input bit string (6) from the register file 101, and uses the prefix-related information (1) to (4) to make a prefix. Is generated. The generated prefix power is searched for a prefix that matches the input bit string (6), and the matched prefix number matchedjndex is output to the codeword length calculation unit 103 and the index calculation unit 104.
  • the codeword length calculation unit 103 reads from the register file 101 the word length clen of each common part of the prefix-related information (2), the word length plen [i] of each individual part of (4), and (5 ) Is used to calculate the codeword word length codewordjength using the matched prefix number matchedj ndex output by the bit matching unit 102.
  • the codeword length codewordjength which is the calculation result is stored in the register file 101.
  • the index calculation unit 104 receives the suffix word length slen [i] of the prefix-related information (5) from the register file 101, and uses the matched prefix number output from the bit matching unit 102 as a decoded value index. Calculate symboljndex and store in register file 101.
  • the decoded value index symboljndex is a symbol in the symbol table 107 that stores a symbol (decoded value of the codeword) corresponding to the codeword. The position (index) of. Therefore, the decoded value obtained from the symbol table 107 can be stored in the decoded value memory 108 by referring to the symbol table 107 using the decoded value index symbol jndex by the control signal from the instruction decoder 105.
  • the instruction decoder 105 decodes a program instruction read from the program memory 109. Specifically, the instruction decoder 105 operates the bit matching unit 102, the codeword length calculation unit 103, and the index calculation unit 104 in response to an instruction for decoding the variable length code read from the program memory 109, and The codeword word length codewordjength which is the calculation result of the codeword length calculation unit 103 and the decoded value index symbol jndex which is the calculation result of the index calculation unit 104 are stored in the register file 101.
  • the bit matching unit 102, the codeword length calculation unit 103, the index calculation unit 104, the instruction decoder 105, and the input / output unit 106 are each configured as a functional circuit.
  • a process having the same function may be realized by executing a decryption program on the processor. Therefore, the block diagram in Figure 2 should be understood as a functional representation.
  • an unknown codeword is decoded using a prefix.
  • Decoding of the code word is executed by the instruction decoder 105 decoding the bit matching instruction and controlling the operations of the bit matching unit 102, the code word length calculation unit 103, and the index calculation unit 104. Specifically, when the instruction decoder 105 decodes the bit matching instruction, the bit matching unit 102, the code word length calculation unit 103, and the index calculation unit 104 are operated using the operand specified by the bit matching instruction.
  • prefix-related information and an input bit string must be stored in the register file 101.
  • storing prefix-related information and decoding using the same will be described in detail.
  • FIG. 3 is a schematic diagram showing information regarding prefixes and an input bit string stored in the register file 101 used in the decoding device of FIG.
  • prefix-related information and input bit strings are stored in five 64-bit registers Xs, Xp, Xc, Xd, and Xi in register file 101, and one 64-bit register Xn (not shown) is stored. Used to store the retrieved decrypted value.
  • the register Xc stores the prefix common part prefix_common and the prefix common part word length clen
  • the input bit string input_bits is stored in the register Xi.
  • Ob represents a binary number
  • x represents an unused bit. The actual value of X is 0.
  • prefix_part [i] there are five types of prefix-related information.
  • the prefix individual part prefix_part [i], the prefix individual part word length plen [i], and the suffix word length slen [i] are Determined as shown in Table 4.
  • prefix_part [5], prefix_part [6] and prefix_part [7]! To indicate, set the word length plen of the corresponding prefix individual part and the word length slen of the suffix to 0.
  • the instruction decoder 105 decodes the bit matching instruction, and operates the bit matching unit 102, the codeword length calculation unit 103, and the index calculation unit 104 using the operand specified by the bit matching instruction.
  • the operation of the bit matching instruction is shown below.
  • the bit matching unit 102, the codeword length calculation unit 103, and the index calculation unit 104 receive the contents of the 64-bit registers Xs, Xp, Xc, Xd, and Xi from the register file 101.
  • Registers Xs, Xp, and Xc store information about prefixes and suffixes as shown in Figure 3.
  • Register Xi stores an input bit string including an unknown code word. The initial value of the index corresponding to the unknown codeword is stored on the upper side of the register Xd.
  • the bit matching unit 102 matches the eight prefixes with the input bit string, and outputs the prefix number matchedjndex that matches the input bit string to the codeword length calculation unit 103 and the index calculation unit 104. .
  • the codeword length calculation unit 103 performs matching prefix number matchedjndex, prefix common part prefix_common word length clen, prefix individual part word length plen [i], and suffix word length slen [i ] Is used to calculate the word length codewordjength of the unknown codeword, and the calculated word length codewordjength of the unknown codeword is substituted into the lower bits of the 64-bit register Xd.
  • the index calculation unit 104 uses the matched prefix number matched_index, the suffix word length slen [i], and the unknown codeword word length codewordjength to decode the decoded value index symbol jndex And the calculated index symbol jndex is assigned to the upper part of the 64-bit register Xd.
  • the decoded value can be obtained from the symbol table 107 using the index symb oljndex after execution of the bit matching instruction. Subsequently, only the codeword decoded this time is removed from the input bit string input_bits stored in the register XI, and a new bit string is added to the register Xi.
  • the unknown codeword is sequentially extracted from the input bit string input_bits stored in the register Xi, and the obtained decoded value is sequentially stored in the decoded value memory 108 while referring to the symbol table 107. Can be stored.
  • FIG. 4 is a schematic diagram showing eight prefixes generated by the bit matching unit 102.
  • the bit matching unit 102 generates the prefix common part, the prefix individual part, and the power prefix.
  • the bit matching unit 102 extracts the prefix common part prefix_comm on (24 bits) and the word length clen (8 bits) of the prefix common part from the register Xc.
  • bit matching unit 102 starts from the left side of the prefix common unit prefix_common.
  • the bit string of the packet is taken out and is changed to the prefix common part prefix_common.
  • the plen [i] -bit bit string is extracted from the left side of [], and is changed to the prefix individual part prefi x_part [i].
  • the bit matching unit 102 generates eight prefixes (prenx—common + prenx—part
  • the bit matching unit 102 matches the generated eight prefixes with the head part of the input bit string input_bits, and checks which prefix matches the input bit string. The matching procedure is shown below.
  • the bit matching unit 102 obtains an exclusive logical story (XOR) between the extracted (clen + plen [i]) bit string and the i-th prefix, and determines whether XOR results matching is appropriate. To do. Here, if the XOR result is “0”, it is determined that the i-th prefix matches the input bit.
  • XOR exclusive logical story
  • bit matching unit 102 substitutes the number i of the prefix matching the input bit string into matchedjndex.
  • the codeword length calculation unit 103 uses the matching prefix number matchecLindex obtained from the bit matching unit 102 to calculate the word length of the unknown codeword included in the input bit string as follows.
  • the codeword length calculation unit 103 extracts, from the register Xs, the word length plen [matched_index] of the prefix individual unit corresponding to matchedjndex and the word length slen [matched_index] of the suffix.
  • the codeword length calculation unit 103 extracts the word length clen of the prefix common part as well as the register Xc force.
  • the codeword length calculation unit 103 calculates the word length clen of the prefix common part, the word length of the prefix individual part plen [matched_index] And the suffix word length slen [matched_index] is calculated to obtain the unknown codeword word length codewordjength. However, if matchedjndex is 8 or more, there is no matching prefix, so the codeword length calculation unit 103 substitutes 0 for codeword-length.
  • the word length codewordjength of the unknown codeword obtained in this way is stored in the register file 101 and is output to the index calculation unit 104.
  • the symbol table 107 stores decoded values for codewords as shown in Table 1, for example.
  • the position where the decoded value is stored is specified by the index symbol jndex.
  • the index calculation unit 104 obtains the decoded value index symboljndex as follows.
  • FIG. 5 is an explanatory diagram showing a procedure for obtaining the decoded value index symboljndex.
  • matchedjndex is the prefix number that matches the input bit string
  • codewordjength is the word length of the unknown codeword included in the input bit string.
  • the index calculation unit 104 extracts the initial value of the symbol symboljndex from the register Xd.
  • the index calculation unit 104 takes out the bit string corresponding to the suffix for the input bit string force and adds the bit string to symboljndex.
  • the codewordjeng th bit on the left side of the input bit string is an unknown codeword, and the slen [matchedjndex] bit on the right side in the unknown codeword is a suffix.
  • variable length code decoding procedure using the bit matching instruction described in 5.2) above will be described with reference to the drawings.
  • FIG. 6 is a flowchart showing a decoding method according to an embodiment of the present invention. A program created according to this flow is executed on the processor 100 shown in FIG. Here, a decoding procedure using the register file 101 shown in FIG. 3 will be described.
  • Step S201 First, data necessary for decoding processing is set in the next register.
  • Step S202 Subsequently, 0 is substituted as the initial value of the index symboljndex of the decoded value and 0 is substituted as the initial value of the word length codewordjength of the unknown codeword.
  • the index symboljndex is placed in the upper part of register Xd (bits 63-32 of Xd), and the word length codewordjength of the unknown codeword is placed in the lower part of register Xd (bits 7-0 of Xd) , Respectively.
  • register Xd is initialized to 0.
  • Step S203 Matching of 8 prefixes and input bit string is performed using a bit matching instruction.
  • the bit matching instruction generates eight prefixes from the registers Xc, Xp, and Xs, and searches for a prefix that matches the input bit string of the register Xi. Further, the word length codewordjength of the unknown codeword of the input bit string is calculated, and an index symboljndex representing the position of the decoded value in the symbol table 107 is calculated. Index symboljndex is assigned to the upper side of register Xd (bits 63-32 of Xd). If there is a prefix that matches the unknown codeword, the word length codewordjength of the unknown codeword is assigned to the lower part of register Xd (bits 7-0 of Xd).
  • Step S204 Next, the symbol table 107 is referred to using the index symbol jndex calculated by the bit matching instruction, and the decoded value is extracted.
  • the extracted decoded value is stored in the lower side (31-0 bits of Xn) of register Xn (not shown).
  • Step S205 The decoded value stored in the register Xn is transferred to and stored in the decoded value memory 108 through the input / output unit 106.
  • Step S206 If the word length codewordjength of the unknown codeword is greater than 0, the decoded codeword is removed from the input bit string of the register X i and a new input bit string is replenished.
  • Step S207 If the decoded value means the end of the decoding process (YES in step S207), the decoding process is ended. If the word length of the unknown codeword codewordjength is 0 or less, it means that the codeword has not been decoded and the decoding process is terminated. If there is a bit string to be decoded (NO in step S207), the process returns to step S202, and steps S202 to S207 are repeated until the process is completed, and the input bit string is sequentially decoded.
  • the components of the processor 100 shown in FIG. 1 can be applied in various ways without departing from the content power already described. Specific application examples and modifications will be described below.
  • the power exemplified by 8 prefixes Generally, there are more than 8 prefix types corresponding to codewords. When decoding codewords with 8 or more prefixes, it is sufficient to divide the prefixes into 8 pieces and match them with unknown codewords. For example, in step S203 in Fig. 6, there are 23 prefix types. If there are, match by dividing into 8, 8, and 7. In other words, 23 prefixes can be matched with unknown codewords by executing the above bit-matching instruction three times. By controlling in this way, even if the number of prefix types is arbitrary, the same processing can be performed.
  • the maximum word length of the codeword prefix may be 8 bits or less.
  • the word length of the prefix common part is regarded as 0 and a bit matching instruction is used. Since the word length of the prefix common part is regarded as 0, processing for storing the prefix common part in the register file 101 can be omitted.
  • the bit matching instruction has the ability to match eight prefixes with unknown codewords. If the number of prefixes that match at one time is increased, the number of times the bit matching instruction is executed is reduced. Can do. On the other hand, if the number of prefixes matched at a time is reduced, the circuit scale can be reduced, leading to high-speed operation and low power consumption. Therefore, it is possible to change the number of prefixes that match at one time according to the user's request.
  • the register file 101 of the processor 100 has 16 64-bit registers, but as described above, this configuration is an example, and a bit matching instruction operates.
  • the range can be changed. For example, a configuration with 128 8-bit registers, 64 16-bit registers, 32 32-bit registers, etc. can be considered.
  • the present invention can be applied to an apparatus for decoding general information encoded using variable-length encoding.
  • the present invention can be applied to a decoder that decodes information such as images and music encoded using variable length codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

 本発明の目的は、プリフィックスに関する情報をコンパクトに格納し、種々の方式の可変長符号に対応可能な復号装置を提供することである。復号装置は、プリフィックス共通部、その語長、プリフィックス個別部、その語長、サフィックスの語長及び入力ビット列を格納するレジスタファイル101と、プリフィックス共通部及び個別部から生成されたプリフィックスから入力ビット列に含まれるプリフィックスを判定するビットマッチング部102と、判定されたプリフィックスに対応するプリフィックス共通部、個別部及びサフィックスの各語長を用いて入力ビット列に含まれる符号語の語長を計算する符号語長計算部103と、対応するサフィックス及び符号語の各語長を用いてシンボルテーブル107のインデックスを計算するインデックス計算部104と、を有する。

Description

明 細 書
可変長符号の復号装置および復号方法
技術分野
[0001] 本発明は圧縮符号化された信号の復号技術に係り、特に可変長符号の復号装置 及び方法に関する。
背景技術
[0002] 画像や音楽を圧縮するために可変長符号化が広く使用されている。可変長符号化 は出現確率の高 、シンボルに短 、符号語を優先的に割り当てる符号ィ匕方法である。 可変長符号ィ匕には符号語の平均語長を小さくできるという特徴がある。このような可 変長符号ィ匕により符号化された情報を復号する方法は、次の 4つに分類することがで きる: (a)シンプル 'テーブル 'ルックアップ法; (b)リーディング ·サイン 'カウント法; (c)バ イナリ ·ツリー法; (d)プリフィックス ·グルーピング法。なお、これらは一般的な復号方法 の名称ではないが、本明細書ではこれらの名称を使う。以下、簡単に説明する。
[0003] (a) シンプル ·テーブル 'ルックアップ法は最も単純な方法である。最も長い符号語 の語長を Nビットとし、入力ビット列の先頭から Nビットを取り出し、その Nビットをインデ ックスとして 2N個の要素をもつテーブルから要素を取り出す。テーブルから取り出さ れた要素が符号語に対応するシンボルである。テーブルのサイズが大き 、と 、う欠点 がある。
[0004] (b) リーディング ·サイン'カウント法は入力ビット列の先頭側の連続する 1や 0(sign ビット)の数をもとにして符号語のグループを解読する。入力ビット列の先頭にある sign ビットに続く M個のビットを取り出し、それを使って符号語を解読する。 Mは 4とか 5な どで、符号語の構成によって変化する。ただし、 M個のうち一部だけしか意味をもた ない場合が多い。テーブルの中には少なからず無駄なデータがある。(a)のシンプル' テーブル 'ルックアップ法よりもテーブルは小さいが、符号語の構成によっては 2種類 のテーブル (符号長、シンボル)が必要になることもある。ソフトウェアの可変長復号器 はほとんどこの方法を用いて 、る。
[0005] (c) ノイナリ 'ツリー法は、 1ビットずつ、符号語を表すバイナリ 'ツリーをたどる復号 方法である。ツリーのリーフに達したら、テーブル参照などでシンボルをデコードする
。他の復号方法に比べてスループットが低い(1ビット Zサイクル)という欠点があるが 、ハードウェア実装には向いている。
[0006] (d) プリフィックス 'グルーピング法は、「符号語はプリフィックスとサフィックスに分か れる」 t 、う事実にもとづ 、た復号方法である。入力ビット列を全ての符号語のプリフ イツタスと比較し、どのプリフィックスかを調べる。プリフィックスと符号長とが一対一に 対応しているので、プリフィックスを特定できたら符号長も自動的にわかる。入力ビット 列のプリフィックスがわかったら、入力ビット列からサフィックスを取り出す。プリフィック スとサフィックスを特定できたら、それら力 テーブル参照のためのオフセットが得られ る。そのオフセットを使ってテーブルをサーチし、符号語に対応するシンボルを取り出 す。このプリフィックス 'グルーピング法に関しては、特許文献 1および 2、非特許文献 1および 2がある。
[0007] プリフィックス 'グルーピング法は、(b)のリーディング'サイン'カウント法よりもテープ ルサイズは小さぐテーブルサイズはほぼシンボルの数に等し 、。入力ビット列とプリ フィックスの比較処理と、プリフィックスとサフィックス力 オフセットを計算する処理とを ソフトウェアで実行するのが通常困難なので、この方法はハードウェア実装向きであ る。
[0008] 特許文献 1 :特開平 7— 235878号公報
特許文献 2 :特表 2002— 516501号公報
非特干文献 1 : Bai- Jue Shieh et al., A New Approach of uroup-Based VLC codec S ystem with Full Table Programmability, " IEEE Transactions onし ireuits and Systems for Video Technology, Vol.11, No.2, Feb. 2001.
非特許文献 2 : Cheng- Teh Hsieh et al., "A Concurrent Memory-efficient VLC Deco der for MPEG Applications, lEEE Transactions on Consumer Electronics, Vol.42, Aug. 1996.
[0009] 上記の特許文献、非特許文献の全記載は、引用をもって本書に繰り込み記載され ているものとみなす。
発明の開示 発明が解決しょうとする課題
[0010] 以下、本発明による関連技術の分析を示す。
しかしながら、上記プリフィックス ·グルーピング法は、シンボルを格納するテーブル の他に、(1)プリフィックス、(2)プリフィックスを含む符号語の語長、および、(3)プリフィ ッタスに対応するサフィックスの語長を格納するためのテーブルが必要である。したが つて、プリフィックス ·グルーピング法はシンボルを格納するテーブルサイズが非常に 小さいという特長をもつ反面、プリフィックスの種類が多いときには上記 (1)、(2)および ( 3)を格納するテーブルのサイズが大きくなつてしまうという課題がある。
[0011] さらに、上記プリフィックス ·グルーピング法は、通常、ハードウェアで実装されるので 種々の方式に適用できな 、と 、う課題もある。符号ィ匕方式によって可変長符号の構 成が異なるため、様々な方式に使える効率の良い汎用的な可変長符号復号器を作 ることは一般的に困難である。例えば、特許文献 2に開示された可変長符号復号器 は、プリフィックス ·グルーピング法を使ったメモリ使用量が少な!/、効率の良 ヽ復号器 であるが、 MPEG-2の符号ィ匕方式に強く依存している。したがって、この復号器の原 理を他の符号ィヒ方式に適用することは可能であるものの新たに復号器を設計する必 要がある。
[0012] そこで、本発明の目的は、プリフィックスに関する情報をコンパクトに格納するため の可変長符号の復号装置および復号方法を提供することにある。
[0013] さらに、本発明の他の目的は、さまざまな方式の可変長符号に対応可能な可変長 符号の復号方法および装置を提供することにある。
[0014] さらに、他の目的は、明細書及びクレームの全開示事項から、明ら力となる。
課題を解決するための手段
[0015] 本発明の第 1の側面によれば、可変長符号化された符号語に含まれるプリフィック スを用いて符号語を復号する復号装置であって、復号に使用される複数のプリフイツ タスに共通するプリフィックス共通部と、各プリフィックスにおいて前記プリフィックス共 通部以外のプリフィックス個別部と、可変長符号の未知符号語を含む入力ビット列と 、を格納する記憶手段と、前記記憶手段に格納された各プリフィックス共通部および 当該プリフィックス共通部に対応する複数のプリフィックス個別部力 生成された複数 のプリフィックスのうち、どのプリフィックスが前記記憶手段に格納された入力ビット列 に含まれるカゝ否かを判定するプリフィックス識別手段と、を有することを特徴とする。
[0016] 本発明の第 2の側面によれば、可変長符号化された符号語を復号値テーブルを用 いて復号する復号装置であって、復号に使用される複数の符号語およびそれらの語 長と、可変長符号の未知符号語を含む入力ビット列と、を格納する記憶手段と、前記 複数の符号語およびそれらの語長を用いて、前記複数の符号語のうち、どの符号語 が前記入力ビット列に含まれる力否かを判定する識別手段と、前記判定結果に基づ いて、前記入力ビット列に含まれる未知符号語の語長を計算する語長計算手段と、 前記判定結果に基づ ヽて、前記復号値テーブルを参照するためのインデックスを計 算するインデックス計算手段と、前記前記入力ビット列に含まれる未知符号語の語長 およびインデックスを生成するように、前記識別手段、前記語長計算手段および前記 インデックス計算手段を制御する制御手段と、を有することを特徴とする。
[0017] 本発明の第 3の側面によれば、可変長符号化された符号語に含まれるプリフィック スを用いて符号語を復号する可変長符号の復号方法が提供される。この復号方法は 、復号に使用される複数のプリフィックスに共通するプリフィックス共通部を記憶手段 に格納し、各プリフィックスにお!/、て前記プリフィックス共通部以外のプリフィックス個 別部を前記記憶手段に格納し、可変長符号の未知符号語を含む入力ビット列を前 記記憶手段に格納し、前記記憶手段に格納された各プリフィックス共通部および当 該プリフィックス共通部に対応する複数のプリフィックス個別部力 複数のプリフィック スを生成し、前記複数のプリフィックスのうちの 1つのプリフィックスが前記入力ビット列 に含まれるか否かを判定する、各ステップを有することを特徴とする。
[0018] 本発明の第 4の側面によれば、第 1及び第 2の側面にかかる復号装置を作動するた めのプログラム並びに第 3の側面に係る上記復号方法を実施するためのコンピュータ に命令するプログラム(プロダクト)が提供される。プログラムは、第 3の側面の復号方 法の各ステップを実行する処理ステップを有すること、あるいは、第 2の側面の復号装 置の各手段を作動させることを特徴とする。
[0019] 本発明の一実施形態によれば、可変長符号化された符号語に含まれるプリフィック スを用いて符号語を復号する復号装置であって、復号に使用される複数のプリフイツ タスに共通するプリフィックス共通部およびその語長と、各プリフィックスにおいて前記 プリフィックス共通部以外のプリフィックス個別部およびその語長と、複数の符号語の 各々において前記プリフィックスを除いたサフィックスの語長と、可変長符号の未知符 号語を含む入力ビット列と、を格納する記憶手段と、前記プリフィックス共通部および 複数のプリフィックス個別部から生成された複数のプリフィックスのうち、どのプリフイツ タスが前記入力ビット列に含まれる力否かを判定するプリフィックス識別手段と、前記 判定結果に基づいて特定される、前記プリフィックス共通部の語長、前記プリフィック ス個別部の語長、および前記サフィックスの語長を用いて、前記入力ビット列に含ま れる未知符号語の語長を計算する語長計算手段と、前記判定結果に基づ!、て特定 されるサフィックスの語長および前記未知符号語の語長を用いて復号用テーブルの インデックスを計算するインデックス計算手段と、前記入力ビット列に含まれる未知符 号語の語長および復号用テーブルのインデックスを生成するための命令に従って、 前記プリフィックス識別手段、前記語長計算手段および前記インデックス計算手段を 制御する制御手段と、を有することを特徴とする。
[0020] 上記復号装置はプログラム制御プロセッサ上に実装可能であり、その場合、前記記 憶手段はレジスタファイルであり、前記制御手段は、復号プログラムの前記命令に従 つて、前記プリフィックス識別手段、前記語長計算手段および前記インデックス計算 手段を制御し、前記計算された未知符号語の語長および復号用テーブルのインデッ タスを前記レジスタファイルに格納する命令デコーダである。
[0021] 上記一実施形態による可変長符号復号装置は、可変長符号化された符号語に含 まれるプリフィックスを使って可変長符号を復号する可変長符号復号器として動作可 能なプロセッサ(図 2の参照番号 100)であって、次のように構成することができる。
[0022] レジスタファイル(図 2の参照番号 101)に、複数のプリフィックスに共通のビット列( 共通部)、前記の共通部の語長、前記の共通部以外の各プリフィックスのビット列 (個 別部)、前記の個別部の語長、プリフィックスを除いた符号語のビット列 (サフィックス) の語長、可変長符号の符号語を含む入力ビット列、符号語に対応するシンボルを格 納したテーブルのインデックス、および、復号した符号語の語長を格納するための記 憶領域あるいはレジスタを用意し、プリフィックス共通部およびその語長、プリフィック ス個別部およびその語長、サフィックスの語長、および、可変長符号の符号語を含む 入力ビット列をそれぞれ格納する。
[0023] プリフィックス識別手段(図 2のビットマッチング部 102)は、前記プリフィックス共通 部および複数のプリフィックス個別部力も生成された複数のプリフィックスのうち、どの プリフィックスが入力ビット列に含まれる力否かを判定する。語長計算手段(図 2の符 号語長計算部 103)は、判定結果に基づいて特定されるプリフィックス共通部の語長 、プリフィックス個別部の語長およびサフィックスの語長を用いて、入力ビット列に含ま れる未知符号語の語長を計算する。インデックス計算手段(図 2のインデックス計算 部 104)は、判定結果に基づいて特定されるサフィックスの語長および未知符号語の 語長を用いて復号用テーブルのインデックスを計算する。
[0024] さらに、制御手段(図 2の命令デコーダ 105、およびプログラムメモリ 109)は、プロ セッサへ与えられた命令に応答して、識別手段とインデックス計算手段と語長計算手 段とを動作させ、インデックス計算手段が計算したインデックスおよび語長計算手段 が計算した符号語の語長をレジスタファイルへ格納する。
発明の効果
[0025] (1)本発明の第 1の効果はプリフィックスを格納しておく記憶領域のサイズを小さく できることである。
[0026] 従来は、 N個のプリフィックスをそのままメモリやレジスタなどの記憶手段へ格納して いた。プリフィックスの長さは 1ビットから数 10ビットまで、プリフィックスの数 Nは 10個 未満から 30個程度までと、さまざまである。例えば、ビデオ符号ィ匕方式 MPEG-2のィ ントラ AC係数の符号ィ匕に使用される可変長符号に含まれるプリフィックスは 23個であ り、プリフィックスの語長は 2ビットから 12ビットまでである。ただし、プリフィックスの切り 出し方によってプリフィックスの種類や語長は多少変化する。また、従来は、プリフイツ タスをそのまま格納するので、仮に 16ビット幅のレジスタを使うとすると、 23個のプリ フィックスを格納するのに 23 X 2 =46バイト分のレジスタが必要となる。
[0027] これに対して、本発明によれば、プリフィックスを共通部と個別部に分けて格納する したがって、例えば 23個のプリフィックスの場合には、 8個、 8個、 7個の 3つのグルー プに分け、 3つのグループに対して 3個の共通部と 23個のプリフィックスに対応する 個別部とを格納する。この場合、共通部と個別部とをそれぞれ 8ビット幅のレジスタに 格納できるので、合計で 3 + 23 = 26バイト分のレジスタが必要になる。従来は 46バ イト分のレジスタが必要であつたのであるから、本発明によりプリフィックスを格納する レジスタのサイズは半分になる。
[0028] 他の例として音楽符号化方式 MPEG— 2 AAC(advanced audio coding)の scalefactor 用の可変長符号について考える。 scalefactor用の可変長符号に含まれるプリフィック スは 37個である。プリフィックスの語長は 2ビット〜 18ビットまでである。仮に 24ビット 幅のレジスタをつ力うとすると、従来では 37個のプリフィックスを格納するのに 37 X 3 = 111バイト分のレジスタが必要である。
[0029] これに対して、本発明によれば、 37個のプリフィックスを 8個、 8個、 8個、 8個、 5個 の 5つのグループに分け、 5つの共通部と、 37個のプリフィックスに対応する個別部と を格納する。共通部を 16ビットレジスタで、個別部を 8ビットレジスタでそれぞれ格納 すると、 5 X 2 + 37=47バイト分のレジスタが必要である。この例においても、本発明 によれば、従来の約半分の容量でプリフィックスを格納することができる。
[0030] (2)本発明の第 2の効果はさまざまな符号ィ匕方式の可変長符号を高速に復号でき ることである。すなわち、プロセッサへ与えられた命令に応答して、識別手段、インデ ックス計算手段および語長計算手段を動作させ、インデックスおよび未知符号語の 語長を計算することができ、プリフィックスの個数が多くなつてもそれらを複数グルー プに分割し同様の処理を繰り返すことで、種々の符号化方式に対しても柔軟に対応 することができる。また、プロセッサ内のレジスタファイルに従来より容量が少ないデー タをロードすることで高速な復号処理が可能となる。 図面の簡単な説明
[0031] [図 1] (A)は符号語をプリフィックスとサフィックスとに分けた符号語の模式図であり、 ( B)は本発明による可変長符号の復号方法で用いられるプリフィックスの共通部およ び個別部を示す模式図である。
[図 2]本発明の一実施形態による可変長符号の復号装置を示す機能的ブロック図で ある。 [図 3]図 2の復号装置に用いられるレジスタファイル 101にプリフィックスに関する情報 と入力ビット列とを格納したようすを示す模式図である。
[図 4]ビットマッチング部 102により生成された 8個のプリフィックスを示す模式図であ る。
[図 5]復号値インデックス symboljndexを求める手順を示す説明図である。
[図 6]本発明の一実施例による復号方法を示すフローチャートである。
符号の説明
[0032] 100 プロセッサ
101 レジスタファイル
102 ビットマッチング部
103 符号語長計算部
104 インデックス計算部
105 命令デコーダ
106 入出力部
107 シンポノレテープノレ
108 復号値メモリ
109 プログラムメモリ
発明を実施するための最良の形態
[0033] 図 1 (A)は符号語をプリフィックスとサフィックスとに分けた符号語の模式図であり、 図 1 (B)は本発明による可変長符号の復号方法で用いられるプリフィックスの共通部 および個別部を示す模式図である。
[0034] 図 1 (A)に示すように、符号語をプリフィックス (prefix)lOとサフィックス (suffix)l lとに 分ける。言い換えれば、符号語からプリフィックス 10を取り除いたビット列がサフィック ス 11である。
[0035] そしてプリフィックス 10に関して、図 1 (B)に示すように、複数のプリフィックス 10に 共通なビット列を共通部 12とし、共通部 12をプリフィックス 10から取り除 、たビット列 を個別部 13とする。図 1 (B)では 1個の共通部 prefix_commonと n個のプリフィックス個 別部 prefix_part[0]-prefix_part[n- 1]とを示している。 [0036] 共通部 12と任意の 1つの個別部 13とを用 V、て n個のプリフィックスのなかの任意の プリフィックスを構成することができる。たとえば、 prefix_commonと prefix_part[i]とを連 結すれば i番目のプリフィックスが得られる。
[0037] 可変長符号には符号語の語長が長くなるにつれて符号語の先頭に同じようなビット 列を含む符号語の数が増えるという性質がある。これは可変長符号の一般的な性質 である。本発明は、この性質を利用してプリフィックスを共通部 12と個別部 13とに分 けることで、プリフィックスの格納容量を縮小する。
[0038] なお、複数のプリフィックスを 2以上のグループに分割し、それぞれのグループのプ リフィックスにつ 、て上述した共通部 12および個別部 13を生成してもよ 、。プリフイツ タスの数を N個、グループの数を M個とすると、 N個のプリフィクスについて、 M個の 共通部 12と N個の個別部 13が得られる。このようにプリフィックスを複数のグループ へ分割する場合もプリフィックスの格納容量を縮小することができる。
[0039] 以下、説明を簡単にするために、あくまでも一例として、表 1に示す 8種類の符号語 があり、それぞれに対応する復号値 (シンボル)が存在するものとする。
[0040] [表 1] 符号語と復号値の対応表
Figure imgf000011_0001
[0041] 表 1の例を用いて、まず符号語とプリフィックスとの関係について説明した後、どのよ うにしてプリフィックスを用いて符号語を復号できるの力 につ 、て簡単に説明する。
[0042] 1.符号語とプリフィックとの関係
表 1に示す 8種類の符号語は、表 2に示すような 5種類のプリフィックスに分類される [0043] [表 2] 表 2 : 符号語とプリフィックスの対応表
Figure imgf000012_0001
[0044] 表 1から表 2を得るためには、次のステップ a)〜d)の方法を用レ、ることができる。
a)同じ語長をもつ符号語ごとに符号語をグループに分ける。
b)各符号語グループにおいて、符号語を 2進数として昇順に並べる。
c)各符号語グループの隣り合う二つの符号語の組合せ全てにつ 1、て、 2つの符号語 の 2進数としての差が 1でないならば、それらを別々の符号語グループとする処理を 行なう。
この処理によって符号語グループはさらにいくつかに分かれる。
d)各符号語グループに属する符号語に共通するビット列をプリフィックスとする。これ により各符号語グループに一つのプリフィックスが決まる。
[0045] 表 2から分力るように、同じ符号語グループに属する符号語は同じ語長で、かつ、 同じプリフィックスを有する。
[0046] 2.プリフィックスを用いた符号語の復号
上述したように、プリフィックスと符号語の語長との間には一対一の関係がある。この 関係を使って未知の符号語を特定することができる。すなわち、未知符号語のプリフ イツタスを調べ、プリフィックス力も未知符号語の語長がわかる。続いて未知符号語か らプリフィックスを取り除いてサフィックスを取り出し、サフィックス力も未知符号語を特 定できる。
[0047] また、符号語の種類が増えてもプリフィックスの種類はそれほど増加しな ヽと 、う性 質がある。したがって、全ての符号語を未知符号語とマッチングするよりもプリフィック スを未知符号語とマッチングする方がマッチングの回数が少なく高速マッチングが可 能となる。
[0048] また、プリフィックスを使って未知符号語を特定するので、符号語に対応する復号 値 (シンボル)を格納するシンボルテーブルのサイズを非常に小さくすることができる 。なぜなら、シンボルテーブルカゝら未知符号語に対応するシンボルを取り出す際には 未知符号語はどの符号語であるかが特定されて ヽるので、各符号語に対応する一つ のシンボルをシンボルテーブルに格納しておけば良いからである。
[0049] 3.プリフィックス共通部 Z個別部
既に述べたように、可変長符号は符号語の語長が長くなるにつれて、符号語の先 頭に同じようなビット列を含む符号語の数が増えるという性質がある。この性質を利用 して、図 1 (B)に示すように、プリフィックス 10を共通部 12と個別部 13とに分けること で、プリフィックスを特定する情報を小さくすることができる。
[0050] プリフィックス共通部 12は、複数のプリフィックスに共通なビット列である。表 2をみ ると分力るように、全てのプリフィックスの左側の 4ビットが一致している。実際には表 2 の 5個のプリフィックスの左側の 5ビットが共通ではある力 左側 5ビットを共通部として しまうと符号語" 0101 0"の個別部が無くなってしまうので、プリフィックスの左側 4ビット を採用する。こうして、表 2の 5個のプリフィックスに共通な左側の 4ビット" 0101"を共通 部 12とする。表 2のプリフィックスを共通部 12と個別部 13に分類し、プリフィックス情 報としてまとめた結果を表 3に示す。
[0051] [表 3]
Figure imgf000014_0001
[0052] 後述するように、このプリフィックス関連情報を用いて未知の符号語を含む入力ビッ ト列から可変長符号の符号語を復号する。本発明の実施形態による復号方法で使 用されるプリフィックス関連情報は次に示す (1)-(5)であり、(6)は復号されるべき入力ビ ット列である。ただし、表 3の例では n= 8である。
[0053] (1) 複数のプリフィックスに共通のビット列 (共通部) prefix_common
(2) 共通部の語長 clen
(3) 共通部以外の各プリフィックスのビット列 (個別部) prefix_part[i], ί=0,1 ·η- 1 (4) 各個別部の語長 plen[i], i=0,l,〜n- 1
(5) 符号語からプリフィックスを取り除いた残りのビット列 (サフィックス)の語長 slen[i] , ί=0,1,· · ·η— 1
(6) 未知の符号語を含む入力ビット列 input_bits
[0054] 4.復号装置の構成
図 2は本発明の一実施形態による可変長符号の復号装置を示す機能的ブロック図 である。本実施形態による復号装置はプログラム制御プロセッサ 100により実現する ことができ、プロセッサ 100内のレジスタファイル 101を用い、ビットマッチング部 102 、符号語長計算部 103およびインデックス計算部 104により、復号値インデックス sym boljndexを高速計算することができる。ビットマッチング部 102、符号語長計算部 103 およびインデックス計算部 104は命令デコーダ 105からの制御信号により制御される 。また、プロセッサ 100は、命令デコーダ 105からの制御信号に従って、レジスタファ ィル 101に格納すべきプリフィックス関連情報および入力ビット列を入出力部 106を 通して入力し格納する。本実施形態における復号装置の一構成例は次の通りである
[0055] レジスタファイル 101は 16本の 64ビットレジスタを有し、可変長符号の符号語を復 号するために必要なプリフィックス関連情報および入力ビット列、すなわち、
(1) 複数のプリフィックスに共通のビット列 (共通部) prefix_common
(2) 共通部の語長 clen
(3) 共通部以外の各プリフィックスのビット列 (個別部) prefix_part[i], ί=0,1 ·η- 1 (4) 各個別部の語長 plen[i], i=0,l,〜n- 1
(5) 符号語からプリフィックスを取り除いた残りのビット列 (サフィックス)の語長 slen[i] , ί=0,1,· · ·η— 1
(6) 未知の符号語を含む入力ビット列 input_bits
を格納する。
[0056] ビットマッチング部 102は、レジスタファイル 101から上記 4種類のプリフィックス関連 情報 (1)-(4)および入力ビット列 (6)を受けとり、プリフィックス関連情報 (1)ー(4)を用いて プリフィックスを生成する。生成したプリフィックス力も入力ビット列 (6)に一致するプリフ イツタスを探索し、一致したプリフィックスの番号 matchedjndexを符号語長計算部 103 およびインデックス計算部 104へ出力する。
[0057] 符号語長計算部 103は、レジスタファイル 101からプリフィックス関連情報 (2)の各共 通部の語長 clen、(4)の各個別部の語長 plen[i]、および、(5)のサフィックス語長 slen[i] を受けとり、ビットマッチング部 102が出力した一致したプリフィックスの番号 matchedj ndexを使って符号語の語長 codewordjengthを計算する。その計算結果である符号 語長 codewordjengthはレジスタファイル 101に格納される。
[0058] インデックス計算部 104は、レジスタファイル 101からプリフィックス関連情報(5)の サフィックス語長 slen[i]を受け取り、ビットマッチング部 102が出力した一致したプリフ イツタスの番号 matchedjndexを使って復号値インデックス symboljndexを計算してレ ジスタファイル 101に格納する。復号値インデックス symboljndexは、符号語に対応 するシンボル (符号語の復号値)を格納したシンボルテーブル 107におけるシンボル の位置 (インデックス)である。したがって、命令デコーダ 105からの制御信号により、 復号値インデックス symbol jndexを用いてシンボルテーブル 107を参照し、シンボル テーブル 107から得られた復号値を復号値メモリ 108に保存することができる。
[0059] 命令デコーダ 105は、プログラムメモリ 109から読み出されたプログラムの命令をデ コードする。具体的には、命令デコーダ 105は、プログラムメモリ 109から読み出され た可変長符号を復号する命令に応答して、ビットマッチング部 102、符号語長計算部 103およびインデックス計算部 104を動作させ、符号語長計算部 103の計算結果で ある符号語の語長 codewordjengthとインデックス計算部 104の計算結果である復号 値インデックス symbol jndexとをレジスタファイル 101に格納する。
[0060] 本実施形態による可変長符号の復号装置では、ビットマッチング部 102、符号語長 計算部 103、インデックス計算部 104、命令デコーダ 105、および、入出力部 106が それぞれ機能回路として構成されていても良いし、プロセッサ上で復号プログラムを 実行することにより同じ機能のプロセスを実現しても良い。したがって、図 2のブロック 図は機能的な表現として理解されるべきである。
[0061] 5.動作
本発明によればプリフィックスを使って未知の符号語を復号する。符号語の復号は 、命令デコーダ 105がビットマッチング命令をデコードし、ビットマッチング部 102、符 号語長計算部 103およびインデックス計算部 104の動作を制御することで実行され る。具体的には、命令デコーダ 105がビットマッチング命令をデコードすると、ビットマ ツチング命令によって指定されたオペランドを使ってビットマッチング部 102、符号語 長計算部 103およびインデックス計算部 104を動作させる。
[0062] このような符号語の復号を行うには、まずプリフィックス関連情報および入力ビット列 をレジスタファイル 101に格納する必要がある。以下、プリフィックス関連情報の格納 およびそれを用いた復号動作を詳細に説明する。
[0063] 5. 1)プリフィックス関連情報の格納
まずレジスタファイル 101に格納されるべき情報の一例は次の通りである。
[0064] (1) 複数のプリフィックスに共通のビット列 (共通部) prefix_common (符号無し 24ビッ ト整数) (2) 共通部の語長 clen (符号無し 8ビット整数)
(3) 共通部以外の各プリフィックスのビット列 (個別部) prefix_part[i], i=0,l , · · ·7 (符号 無し 8ビット整数)
(4) 各個別部の語長 plen[i], ί=0,1,· ··7 (符号無し 4ビット整数)
(5) 符号語からプリフィックスを取り除いた残りのビット列 (サフィックス)の語長 slen[i] , i=0,l,〜7 (符号無し 4ビット整数)
(6) 未知の符号語を含む入力ビット列 input_bits (符号無し 32ビット整数)
[0065] 図 3は、図 2の復号装置に用いられるレジスタファイル 101にプリフィックスに関する 情報と入力ビット列とを格納したようすを示す模式図である。ここでは、レジスタフアイ ル 101にある 5本の 64ビットレジスタ Xs、 Xp、 Xc, Xdおよび Xiに、プリフィックス関連 情報および入力ビット列を格納し、また 1本の 64ビットレジスタ Xn (図示せず)を取り 出された復号値を格納するために使用する。
[0066] 具体的には、図 3に示すように、レジスタ Xcには、プリフィックス共通部 prefix_commo nとプリフィックス共通部の語長 clenとが格納され、レジスタ Xpにはプリフィックス個別 部 prefix_part[i] (ί=0,1,· ··7)が格納され、レジスタ Xsには、プリフィックス個別部の語長 plen[i]およびサフィックスの語長 slen[i] (ί=0,1,· ··7)が格納され、レジスタ Xiには入力ビ ット列 input_bitsが格納される。一つの 64ビットレジスタに格納できるプリフィックス個別 部 prefix_part[i]は 8種類である。なお、 Obは二進数であることを表し、 xは使用されな いビットを表す。 Xの実際の値は 0である。
[0067] 表 3によれば 5種類のプリフィックス関連情報がある力 プリフィックス個別部 prefix_p art[i]、プリフィックス個別部の語長 plen[i]およびサフィックスの語長 slen[i]のそれぞれ の値は表 4に示すように定める。表 3にはプリフィックスが 5種類しかないので、存在し な ヽ 3個の個別プリフィックス prefix_part[5]、 prefix_part[6]および prefix_part[7]につ!/ヽ ては、それらが確かに存在しないことを示すために、対応するプリフィックス個別部の 語長 plenとサフィックスの語長 slenとを 0に設定する。
[0068] [表 4] 表 4:プリフィックス番号とプリフィックス個別部ノサフィックス語長との対応表
Figure imgf000018_0001
[0069] 5. 2)ビットマッチング命令
まず、命令デコーダ 105は、ビットマッチング命令をデコードし、そのビットマツチン グ命令によって指定されたオペランドを使ってビットマッチング部 102、符号語長計 算部 103およびインデックス計算部 104を動作させる。ビットマッチング命令の動作を 以下に示す。
[0070] al)ビットマッチング部 102、符号語長計算部 103およびインデックス計算部 104は 、レジスタファイル 101から 64ビットレジスタ Xs、 Xp、 Xc, Xdおよび Xiの内容を受け とる。レジスタ Xs、 Xp、 Xcにはプリフィックスとサフィックスに関する情報が図 3に示す ように格納されて 、る。レジスタ Xiには未知の符号語を含む入力ビット列が格納され て 、る。レジスタ Xdの上位側には未知符号語に対応するインデックスの初期値が格 納されている。
[0071] a2)ビットマッチング部 102は、プリフィックス共通部 prefix_common、プリフィックス共 通部の語長 clen、プリフィックス個別部 prefix_part[i]、および、プリフィックス個別部の 語長 plen[i](i=0,l," '7)を使って 8個のプリフィックスを生成する(詳しくは後述する。図 3参照)。
[0072] a3)さらに、ビットマッチング部 102は、 8個のプリフィックスを入力ビット列とマツチン グし、入力ビット列に適合するプリフィックスの番号 matchedjndexを符号語長計算部 1 03およびインデックス計算部 104へ出力する。 [0073] a4)符号語長計算部 103は、マッチングしたプリフィックスの番号 matchedjndexと、 プリフィックス共通部 prefix_commonの語長 clen、プリフィックス個別部の語長 plen[i]、 および、サフィックスの語長 slen[i]を使って未知符号語の語長 codewordjengthを計算 し、計算された未知符号語の語長 codewordjengthを 64ビットレジスタ Xdの下位へ代 入する。
[0074] a5)インデックス計算部 104は、マッチングしたプリフィックスの番号 matched_index、 サフィックスの語長 slen[i]、および、未知符号語の語長 codewordjengthを使ってシン ボルテーブル 107における復号値のインデックス symbol jndexを計算し、計算したィ ンデッタス symbol jndexを 64ビットレジスタ Xdの上位へ代入する。
[0075] このビットマッチング命令を使うことにより、シンボルテーブル 107における未知符号 語に対する復号値の位置 (インデックス) symboljndexと、未知符号語の語長 codewor djengthとがわかる。したがって、ビットマッチング命令の実行後に、インデックス symb oljndexを使ってシンボルテーブル 107から復号値を得ることができる。続いて、レジ スタ XIに格納された入力ビット列 input_bitsから今回復号された符号語分だけを取り 除き、新たなビット列をレジスタ Xiに補充する。
[0076] このような処理を繰り返すことで、レジスタ Xiに格納された入力ビット列 input_bitsか ら未知符号語を順次切り出しながら、シンボルテーブル 107を参照し、得られた復号 値を復号値メモリ 108に順次格納することができる。
[0077] 以下、ビットマッチング部 102によるプリフィックスの生成およびマッチング処理、符 号語長計算部 103による未知符号語の語長計算、インデックス計算部 104によるシ ンボルインデックス計算につ 、てそれぞれ詳述する。
[0078] 5. 3)プリフィックスの生成
図 4は、ビットマッチング部 102により生成された 8個のプリフィックスを示す模式図 である。以下、ビットマッチング部 102がプリフィックス共通部とプリフィックス個別部と 力 プリフィックスを生成する手順を例示する。
[0079] bl)まず、ビットマッチング部 102はレジスタ Xcからプリフィックス共通部 prefix_comm on(24ビット)とプリフィックス共通部の語長 clen(8ビット)とを取り出す。
[0080] b2)ビットマッチング部 102はプリフィックス共通部 prefix_commonの左側から clenビ ットのビット列を取り出し、それを改めてプリフィックス共通部 prefix_commonとする。
[0081] b3)ビットマッチング部 102はレジスタ Xpから各 8ビットのプリフィックス個別部 prefix_ part[i], ί=0,1,· ··7を取り出す。
[0082] b4)ビットマッチング部 102は、 ί=0,1,· ··7について、プリフィックス個別部 prefix_part[i
]の左側から plen[i]ビットのビット列を取り出し、それを改めてプリフィックス個別部 prefi x_part[i]とする。
[0083] b5)ビットマッチング部 102は、 ί=0,1,· ··7について、 plen[i]ビットの長さに切り出した プリフィックス個別部 prefix_part[i]の左側に clenビットの長さに切り出したプリフィックス 共通部 prefix— commonを連結する。
[0084] 以上 bl)〜b5)の手順によって、ビットマッチング部 102は図 4に示す 8個のプリフィ ックス (prenx— common + prenx— part|_i」)を生成す 。
[0085] 5. 4)マッチング
ビットマッチング部 102は、生成された 8個のプリフィックスと入力ビット列 input_bits の先頭部分とのマッチングを行 、、どのプリフィックスが入力ビット列に一致するかを 調べる。マッチングの手順を以下に示す。
[0086] cl)ビットマッチング部 102は、各プリフィックス (ί=0,1 ·7)について、入力ビット列の 左側から (clen+plen[i])ビットを取り出す。
[0087] c2)ビットマッチング部 102は、取り出した (clen+plen[i])ビット列と i番目のプリフィック スとの排他的論理話 (XOR)を求め、 XORの結果力 マッチングの適否を判定する。こ こでは、 XORの結果が" 0"ならば当該 i番目のプリフィックスが入力ビットに適合する と判断する。
[0088] c3)適合するプリフィックスが存在すれば、ビットマッチング部 102は入力ビット列に 適合したプリフィックスの番号 iを matchedjndexに代入する。
[0089] c4)適合するプリフィックスが存在しなければ、ビットマッチング部 102は matchedjn dexへ範囲外の数値(ここでは i=0〜7であるから、この範囲外の数値、たとえば" 8") を代入する。
[0090] こうして適合したプリフィックスの番号 iを matchedjndexとして符号語長計算部 103 およびインデックス計算部 104へ出力する。 [0091] 5. 5)符号語の語長
符号語長計算部 103は、ビットマッチング部 102から得られた適合プリフィックスの 番号 matchecLindexを用いて、入力ビット列に含まれる未知符号語の語長 codewordje ngthを以下のようにして計算する。
[0092] dl)符号語長計算部 103は、レジスタ Xsから、 matchedjndexに対応するプリフイツ タス個別部の語長 plen[matched_index]およびサフィックスの語長 slen[matched_index] を取り出す。
[0093] d2)符号語長計算部 103は、レジスタ Xc力もプリフィックス共通部の語長 clenを取り 出す。
[0094] d3) matchedjndexが 8未満ならば(すなわち、適合するプリフィックスが存在した場 合)、符号語長計算部 103は、プリフィックス共通部の語長 clen、プリフィックス個別部 の語長 plen[matched_index]およびサフィックスの語長 slen[matched_index]の和を計算 し、未知符号語の語長 codewordjengthを求める。ただし、 matchedjndexが 8以上なら ば、適合するプリフィックスが存在しな力つたのであるから、符号語長計算部 103は co deword—lengthへ 0を代入する。
[0095] こうして得られた未知符号語の語長 codewordjengthは、レジスタファイル 101に格 納され、またインデックス計算部 104へ出力される。
[0096] 5. 6)復号値インデックス計算
上述したように、シンボルテーブル 107には、たとえば表 1のような符号語に対する 復号値が格納されている。シンボルテーブル 107において、復号値が格納されてい る位置がインデックス symbol jndexによって特定される。インデックス計算部 104はこ の復号値インデックス symboljndexを以下のようにして求める。
[0097] 図 5は復号値インデックス symboljndexを求める手順を示す説明図である。ここで、 matchedjndexは入力ビット列に適合したプリフィックスの番号、 codewordjengthは入 力ビット列に含まれる未知符号語の語長である。
[0098] el)インデックス計算部 104はレジスタ Xdからインデックスの初期値 symboljndex を取り出す。
[0099] e2)インデックス計算部 104はレジスタ Xsからサフィックス slen[i] , i=0, 1 ,… 7を取り出 す。
[0100] e3)インデックス計算部 104は、 i=0,l," ',(matched_index- 1)について、 "1"を slen[i] ビット左シフトした値 (1〈く slen[i])を symboljndexへ加算する。つまり、(1〈く slen[0])、 (1< く slen[l])、 · · '(1〈く slen[matched_index- 1])を symboljndexへ順次加算する。
[0101] e4) matchedjndexが 8未満ならば(すなわち、適合するプリフィックスが存在した場 合)、インデックス計算部 104は入力ビット列力もサフィックスに該当するビット列を取 り出し、そのビット列を symboljndexへ加算する。入力ビット列の左側の codewordjeng thビットが未知符号語であり、未知符号語の中の右側の slen[matchedjndex]ビットが サフィックスである。
[0102] 5. 7)可変長符号の復号
上記 5. 2)で説明したビットマッチング命令を用いた可変長符号の復号手順につ!ヽ て図面を参照しながら説明する。
[0103] 図 6は、本発明の一実施例による復号方法を示すフローチャートである。このフロー に従って作成されたプログラムは、図 1に示すプロセッサ 100上で実行される。ここで は、図 3に示すレジスタファイル 101を用いた復号手順を説明する。
[0104] ステップ S201 :まず、次のレジスタに対して復号処理に必要なデータを設定する。
レジスタ Xcの下位側(Xcの 31-8ビット目 )にプリフィックス共通部 prefix_commonを代 入する。レジスタ Xcの下位 8ビット(Xcの 7-0ビット目 )にプリフィックス共通部の語長 cl enを代入する。レジスタ Xp (Xpの 63-0ビット目 )へ 8個のプリフィックス個別部 prefix_pa rt[i] (ί=0,1 ·7)を代入する。レジスタ Xsの上位側(Xsの 63- 32ビット目)にプリフィック ス個別部の語長 plen[i] (ί=0,1,· · ·7)を代入する。レジスタ Xsの下位側(Xsの 31- 0ビット 目)にサフィックスの語長 slen[i] (ί=0,1,· · ·7)を代入する。
レジスタ Xiの上位側(Xiの 63- 32ビット目)に入力ビット列 input_bitsを代入する。
[0105] ステップ S202:続、て、復号値のインデックス symboljndexの初期値として 0を、未 知符号語の語長 codewordjengthの初期値として 0を、それぞれ代入する。なお、図 3 に示すように、レジスタ Xdの上位(Xdの 63- 32ビット目)にインデックス symboljndexを 、レジスタ Xdの下位(Xdの 7-0ビット目 )に未知符号語の語長長 codewordjengthを、 それぞれ配置する。言 、換えればレジスタ Xdを 0に初期化する。 [0106] ステップ S203:ビットマッチング命令を用いて 8個のプリフィックスと入力ビット列との マッチングを行なう。ビットマッチング命令は、上述したように、レジスタ Xc、 Xpおよび Xsから 8個のプリフィックスを生成し、レジスタ Xiの入力ビット列に適合するプリフィック スをサーチする。さらに、入力ビット列の未知符号語の語長 codewordjengthを計算し 、シンボルテーブル 107における復号値の位置を表すインデックス symboljndexを計 算する。インデックス symboljndexはレジスタ Xdの上位側(Xdの 63- 32ビット目)へ代 入される。未知符号語に適合するプリフィックスが存在するならば、未知符号語の語 長 codewordjengthはレジスタ Xdの下位(Xdの 7-0ビット目 )へ代入される。
[0107] ステップ S204:続、て、ビットマッチング命令が計算したインデックス symbol jndexを 用いてシンボルテーブル 107が参照され、復号値が取り出される。取り出された復号 値はレジスタ Xn (図示せず)の下位側(Xnの 31-0ビット目 )へ格納される。
[0108] ステップ S205:レジスタ Xnに格納された復号値は、入出力部 106を通して復号値 メモリ 108へ転送され保存される。
[0109] ステップ S206 :未知符号語の語長 codewordjengthが 0より大きいならば、レジスタ X iの入力ビット列から復号された符号語を除去し、新たな入力ビット列を補充する。
[0110] ステップ S207 :復号値が復号処理の終了を意味するならば (ステップ S 207の YES )、復号処理を終了する。また、未知符号語の語長 codewordjengthが 0以下である場 合は符号語が復号されな力つたことを表すので復号処理を終了する。復号すべきビ ット列が存在する場合は (ステップ S207の NO)、ステップ S202へ戻り、終了するま でステップ S202〜S207が繰り返され、入力ビット列が順次復号される。
[0111] 6.応用例 Z変形例
図 1に示すプロセッサ 100の構成要素は既に説明した内容力も逸脱しない範囲で 種々の応用が可能である。以下では具体的な適用例あるいは変形例について述べ る。
[0112] 6. 1)上述した実施例では 8個のプリフィックスを例示した力 一般に、符号語に対 応するプリフィックスの種類は 8個より多い。 8個以上のプリフィックスをもつ符号語を 復号する場合には、プリフィックスを 8個ずつ分けて未知符号語とマッチングする方法 をとればよい。例えば、図 6のステップ S203〖こおいて、プリフィックスの種類が 23個で あれば、 8個、 8個、 7個にわけてマッチングを行なう。つまり、上述したビットマツチン グ命令を 3回実行することによって 23個のプリフィックスを未知符号語とマッチングす ることができる。このように制御することで、プリフィックスの種類が任意の個数であつ ても同様に処理することができる。
[0113] 6. 2)逆に、種類が比較的少ない符号語を復号する場合には、プリフィックスを使わ ずに符号語そのものを使って未知符号語とのマッチングを行なうこともできる。符号語 そのものを使ってマッチングを行なう場合、サフィックスの語長を 0とみなしてビットマツ チング命令を使う。ただし、一般にはプリフィックスを使う方がマッチングの回数が少 なくなる。
[0114] 6. 3)符号語のプリフィックスの最大語長が 8ビット以下であることも考えられる。
そのようなプリフィックスを使って符号語を復号する場合には、プリフィックス共通部の 語長を 0とみなしてビットマッチング命令を使う。プリフィックス共通部の語長を 0とみな すので、プリフィックス共通部をレジスタファイル 101へ格納するための処理を省略で きる。
[0115] 6. 4)上記実施例では、ビットマッチング命令は 8個のプリフィックスを未知符号語と マッチングする力 一度にマッチングするプリフィックスの数を増やせば、ビットマッチ ング命令を実行する回数を減らすことができる。他方、一度にマッチングするプリフィ ッタスの数を減らせば、回路規模を縮小でき高速動作や低消費電力などにつながる 。したがって、使用者の要求に応じて、一度にマッチングするプリフィックスの数を変 更してちよい。
[0116] 6. 5)上記実施例では、プロセッサ 100のレジスタファイル 101は 16本の 64ビットレ ジスタをもつが、既に述べたように、この構成は一つの例であり、ビットマッチング命令 が動作する範囲で変更可能である。例えば、 8ビットレジスタ 128本、 16ビットレジスタ 64本、 32ビットレジスタ 32本、などの構成が考えられる。
[0117] 6. 6)上記実施例では、図 3に示すように、符号語を復号するために必要な情報 (プ リフィックスに関する情報、サフィックスの語長、入力ビット列など)をレジスタファイル 1 01へ格納している力 この格納方法も一つの例であり、ビットマッチング命令が動作 する範囲で変更可能である。例えば、これらの情報をレジスタファイル 101の中のど のレジスタに格納する力、そのレジスタのどの位置に格納する力 各情報のサイズを 何ビットにする力、などについては変更可能である。
産業上の利用可能性
[0118] 本発明は可変長符号化を使って符号化された情報一般を復号する装置に適用で きる。例えば、可変長符号を使って符号化された画像や音楽などの情報を復号する 復号器に適用可能である。
[0119] 本発明の全開示 (請求の範囲を含む)の枠内において、さらにその基本的技術思 想に基づいて、実施形態ないし実施例の変更 '調整が可能である。また、本発明の 請求の範囲の枠内において種々の開示要素の多様な組み合わせないし選択が可 能である。

Claims

請求の範囲
[1] 可変長符号化された符号語に含まれるプリフィックスを用いて符号語を復号する復 号装置において、
復号に使用される複数のプリフィックスに共通するプリフィックス共通部と、各プリフ イツタスにぉ 、て前記プリフィックス共通部以外のプリフィックス個別部と、可変長符号 の未知符号語を含む入力ビット列と、を格納する記憶手段と、
前記記憶手段に格納された各プリフィックス共通部および当該プリフィックス共通部 に対応する複数のプリフィックス個別部から生成された複数のプリフィックスのうち、ど のプリフィックスが前記記憶手段に格納された入力ビット列に含まれる力否かを判定 するプリフィックス識別手段と、
を有することを特徴とする可変長符号の復号装置。
[2] 可変長符号化された符号語に含まれるプリフィックスを用いて符号語を復号する復 号装置において、
復号に使用される複数のプリフィックスに共通するプリフィックス共通部およびその 語長と、各プリフィックスにお 、て前記プリフィックス共通部以外のプリフィックス個別 部およびその語長と、複数の符号語の各々において前記プリフィックスを除いたサフ イツタスの語長と、可変長符号の未知符号語を含む入力ビット列と、を格納する記憶 手段と、
前記プリフィックス共通部および複数のプリフィックス個別部から生成された複数の プリフィックスのうち、どのプリフィックスが前記入力ビット列に含まれるか否かを判定 するプリフィックス識別手段と、
前記判定結果に基づいて特定される、前記プリフィックス共通部の語長、前記プリ フィックス個別部の語長および前記サフィックスの語長を用いて、前記入力ビット列に 含まれる未知符号語の語長を計算する語長計算手段と、
前記判定結果に基づいて特定されるサフィックスの語長および前記未知符号語の 語長を用いて復号用テーブルのインデックスを計算するインデックス計算手段と、 前記入力ビット列に含まれる未知符号語の語長および復号用テーブルのインデッ タスを生成するための命令に従って、前記プリフィックス識別手段、前記語長計算手 段および前記インデックス計算手段を制御する制御手段と、
を有することを特徴とする可変長符号の復号装置。
[3] 請求項 2に記載の復号装置を実装するプログラム制御プロセッサにお 、て、
前記記憶手段はレジスタファイルであり、
前記制御手段は、復号プログラムの前記命令に従って、前記プリフィックス識別手 段、前記語長計算手段および前記インデックス計算手段を制御し、前記計算された 未知符号語の語長および復号用テーブルのインデックスを前記レジスタファイルに格 納する命令デコーダである、
ことを特徴とするプログラム制御プロセッサ。
[4] 可変長符号化された符号語を復号値テーブルを用いて復号する復号装置にお!、 て、
復号に使用される複数の符号語およびそれらの語長と、可変長符号の未知符号語 を含む入力ビット列と、を格納する記憶手段と、
前記複数の符号語およびそれらの語長を用いて、前記複数の符号語のうち、どの 符号語が前記入力ビット列に含まれる力否かを判定する識別手段と、
前記判定結果に基づいて、前記入力ビット列に含まれる未知符号語の語長を計算 する語長計算手段と、
前記判定結果に基づ ヽて、前記復号値テーブルを参照するためのインデックスを 計算するインデックス計算手段と、
前記前記入力ビット列に含まれる未知符号語の語長およびインデックスを生成する ように、前記識別手段、前記語長計算手段および前記インデックス計算手段を制御 する制御手段と、
を有することを特徴とする可変長符号の復号装置。
[5] 請求項 4に記載の復号装置を実装するプログラム制御プロセッサにお 、て、
前記記憶手段はレジスタファイルであり、
前記制御手段は、復号プログラムの前記命令に従って、前記識別手段、前記語長 計算手段および前記インデックス計算手段を制御し、前記計算された未知符号語の 語長およびインデックスを前記レジスタファイルに格納する命令デコーダである、 ことを特徴とするプログラム制御プロセッサ。
[6] 可変長符号化された符号語に含まれるプリフィックスを用いて符号語を復号する方 法において、
復号に使用される複数のプリフィックスに共通するプリフィックス共通部を記憶手段 に格納し、
各プリフィックスにおいて前記プリフィックス共通部以外のプリフィックス個別部を前 記記憶手段に格納し、
可変長符号の未知符号語を含む入力ビット列を前記記憶手段に格納し、 前記記憶手段に格納された各プリフィックス共通部および当該プリフィックス共通部 に対応する複数のプリフィックス個別部から複数のプリフィックスを生成し、 前記複数のプリフィックスのうちの 1つのプリフィックスが前記入力ビット列に含まれ るカゝ否かを判定する、
ことを特徴とする可変長符号の復号方法。
[7] 可変長符号化された符号語に含まれるプリフィックスを用いて符号語を復号する方 法において、
復号に使用される複数のプリフィックスに共通するプリフィックス共通部およびその 語長と、各プリフィックスにお 、て前記プリフィックス共通部以外のプリフィックス個別 部およびその語長と、複数の符号語の各々において前記プリフィックスを除いたサフ イツタスの語長と、可変長符号の未知符号語を含む入力ビット列と、を記憶手段に格 納し、
前記プリフィックス共通部および複数のプリフィックス個別部から生成された複数の プリフィックスのうち、どのプリフィックスが前記入力ビット列に含まれるか否かを判定し 前記判定結果に基づいて特定される、前記プリフィックス共通部の語長、前記プリ フィックス個別部の語長および前記サフィックスの語長を用いて、前記入力ビット列に 含まれる未知符号語の語長を計算し、
前記判定結果に基づいて特定されるサフィックスの語長および前記未知符号語の 語長を用いて復号用テーブルのインデックスを計算し、 前記インデックスを用いて前記復号用テーブルを参照し復号値を取り出す、 ことを特徴とする可変長符号の復号方法。
[8] 可変長符号化された符号語を復号値テーブルを用いて復号する方法にぉ ヽて、 復号に使用される複数の符号語およびそれらの語長と、可変長符号の未知符号語 を含む入力ビット列と、を格納するステップと、
前記複数の符号語およびそれらの語長を用いて、前記複数の符号語のうち、どの 符号語が前記入力ビット列に含まれる力否かを判定するステップと、
前記判定結果に基づいて、前記入力ビット列に含まれる未知符号語の語長を計算 するステップと、
前記判定結果に基づ ヽて、前記復号値テーブルを参照するためのインデックスを 計算するステップと、
前記インデックスを用いて前記復号用テーブルを参照し復号値を取り出すステップ と、 を含むことを特徴とする可変長符号の復号方法。
[9] 可変長符号化された符号語に含まれるプリフィックスを用いて符号語を復号する復 号装置を構成するコンピュータに、
復号に使用される複数のプリフィックスに共通するプリフィックス共通部を記憶手段 に格納する処理と、
各プリフィックスにおいて前記プリフィックス共通部以外のプリフィックス個別部を前 記記憶手段に格納する処理と、
可変長符号の未知符号語を含む入力ビット列を前記記憶手段に格納する処理と、 前記記憶手段に格納された各プリフィックス共通部および当該プリフィックス共通部 に対応する複数のプリフィックス個別部から複数のプリフィックスを生成する処理と、 前記複数のプリフィックスのうちの 1つのプリフィックスが前記入力ビット列に含まれ るか否かを判定する処理と、
を実行させる可変長符号の復号プログラム。
[10] 可変長符号化された符号語に含まれるプリフィックスを用いて符号語を復号する復 号装置を構成するコンピュータに、
復号に使用される複数のプリフィックスに共通するプリフィックス共通部およびその 語長と、各プリフィックスにお 、て前記プリフィックス共通部以外のプリフィックス個別 部およびその語長と、複数の符号語の各々において前記プリフィックスを除いたサフ イツタスの語長と、可変長符号の未知符号語を含む入力ビット列と、を記憶手段に格 納する処理と、
前記プリフィックス共通部および複数のプリフィックス個別部から生成された複数の プリフィックスのうち、どのプリフィックスが前記入力ビット列に含まれるか否かを判定 する処理と、
前記判定結果に基づいて特定される、前記プリフィックス共通部の語長、前記プリ フィックス個別部の語長、および前記サフィックスの語長を用いて、前記入力ビット列 に含まれる未知符号語の語長を計算する処理と、
前記判定結果に基づいて特定されるサフィックスの語長および前記未知符号語の 語長を用いて復号用テーブルのインデックスを計算する処理と、
前記インデックスを用いて前記復号用テーブルを参照し復号値を取り出す処理と、 を実行させる可変長符号の復号プログラム。
可変長符号化された符号語を復号値テーブルを用いて復号する復号装置を構成 するコンピュータに、
復号に使用される複数の符号語およびそれらの語長と、可変長符号の未知符号語 を含む入力ビット列と、を格納する処理と、
前記複数の符号語およびそれらの語長を用いて、前記複数の符号語のうち、どの 符号語が前記入力ビット列に含まれる力否かを判定する処理と、
前記判定結果に基づいて、前記入力ビット列に含まれる未知符号語の語長を計算 する処理と、
前記判定結果に基づ ヽて、前記復号値テーブルを参照するためのインデックスを 計算する処理と、
前記インデックスを用いて前記復号用テーブルを参照し復号値を取り出す処理と、 を実行させる可変長符号の復号プログラム。
PCT/JP2007/055221 2006-03-23 2007-03-15 可変長符号の復号装置および復号方法 WO2007108395A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US12/225,422 US7924179B2 (en) 2006-03-23 2007-03-15 Variable-length code determining device and variable-length code decoding method
JP2008506268A JPWO2007108395A1 (ja) 2006-03-23 2007-03-15 可変長符号の復号装置および復号方法

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2006-079978 2006-03-23
JP2006079978 2006-03-23

Publications (1)

Publication Number Publication Date
WO2007108395A1 true WO2007108395A1 (ja) 2007-09-27

Family

ID=38522425

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2007/055221 WO2007108395A1 (ja) 2006-03-23 2007-03-15 可変長符号の復号装置および復号方法

Country Status (3)

Country Link
US (1) US7924179B2 (ja)
JP (1) JPWO2007108395A1 (ja)
WO (1) WO2007108395A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009268100A (ja) * 2008-04-25 2009-11-12 Thomson Licensing 整数シーケンス符号化方法、符号化された整数シーケンスを担持する記憶装置及び信号並びに整数シーケンス復号化方法
US8941515B1 (en) 2013-09-17 2015-01-27 Kabushiki Kaisha Toshiba Encoder, decoder and data processing system

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010041488A1 (ja) * 2008-10-10 2010-04-15 株式会社東芝 動画像符号化装置
US9626184B2 (en) * 2013-06-28 2017-04-18 Intel Corporation Processors, methods, systems, and instructions to transcode variable length code points of unicode characters
CN109614148B (zh) * 2018-12-11 2020-10-02 中科驭数(北京)科技有限公司 数据逻辑运算方法、监测方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000307433A (ja) * 1999-04-16 2000-11-02 Sharp Corp 復号化装置および復号化方法、並びに、プログラム記録媒体
JP2001508993A (ja) * 1997-10-27 2001-07-03 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ 可変長デコーダ用コントローラ
JP2005101731A (ja) * 2003-09-22 2005-04-14 Toshiba Corp 可変長符号復号化装置および可変長符号復号化方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5604499A (en) * 1993-12-28 1997-02-18 Matsushita Electric Industrial Co., Ltd. Variable-length decoding apparatus
JPH07235878A (ja) 1993-12-28 1995-09-05 Matsushita Electric Ind Co Ltd 可変長復号化器
US6704361B2 (en) 1998-05-18 2004-03-09 Sony Corporation Variable length decoder for decoding digitally encoded video signals
US6934338B1 (en) * 1998-05-18 2005-08-23 Sony Corporation Variable length decoder for decoding digitally encoded video signals

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001508993A (ja) * 1997-10-27 2001-07-03 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ 可変長デコーダ用コントローラ
JP2000307433A (ja) * 1999-04-16 2000-11-02 Sharp Corp 復号化装置および復号化方法、並びに、プログラム記録媒体
JP2005101731A (ja) * 2003-09-22 2005-04-14 Toshiba Corp 可変長符号復号化装置および可変長符号復号化方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009268100A (ja) * 2008-04-25 2009-11-12 Thomson Licensing 整数シーケンス符号化方法、符号化された整数シーケンスを担持する記憶装置及び信号並びに整数シーケンス復号化方法
US8941515B1 (en) 2013-09-17 2015-01-27 Kabushiki Kaisha Toshiba Encoder, decoder and data processing system

Also Published As

Publication number Publication date
US20100225508A1 (en) 2010-09-09
JPWO2007108395A1 (ja) 2009-08-06
US7924179B2 (en) 2011-04-12

Similar Documents

Publication Publication Date Title
US8988257B2 (en) Data compression utilizing variable and limited length codes
JP3278297B2 (ja) データ圧縮方法及びデータ復元方法並びにデータ圧縮装置及びデータ復元装置
CN100576753C (zh) 静态赫夫曼解码的系统和方法
US7492290B1 (en) Alternative encoding for LZSS output
US20130307709A1 (en) Efficient techniques for aligned fixed-length compression
JP3778087B2 (ja) データ符号化装置及びデータ復号装置
CN112514270B (zh) 数据压缩
JPH0869370A (ja) データ圧縮方法およびシステム
US20130021178A1 (en) Using variable length code tables to compress an input data stream to a compressed output data stream
JP5656593B2 (ja) 符号化データを復号する装置及び方法
WO2007108395A1 (ja) 可変長符号の復号装置および復号方法
JP2007043595A (ja) 可変長符号復号化方法および装置ならびにデータ伸長装置
US7068192B1 (en) System and method for encoding and decoding variable-length data
US7002494B2 (en) Low memory and MIPS efficient technique for decoding Huffman codes using multi-stage, multi-bits lookup at different levels
US7185041B1 (en) Circuit and method for high-speed execution of modulo division
Goel A compression algorithm for DNA that uses ASCII values
KR20220054651A (ko) 다중 심볼 디코더
US7167115B1 (en) Method, apparatus, and computer-readable medium for data compression and decompression utilizing multiple dictionaries
JP4758494B2 (ja) ビット長を符号に変換する回路及び方法
Selva et al. SRComp: short read sequence compression using burstsort and Elias omega coding
CN103312338B (zh) 用于解码的设备和方法
US9787323B1 (en) Huffman tree decompression
JP2016052046A (ja) 圧縮装置、伸長装置およびストレージ装置
JP2018195956A (ja) 符号化プログラム、符号化装置および符号化方法
US6765513B2 (en) Decoding bit streams compressed with compression techniques employing variable length codes

Legal Events

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

Ref document number: 07738671

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2008506268

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 12225422

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 07738671

Country of ref document: EP

Kind code of ref document: A1