US20060202874A1 - System and method for decoding a variable-length codeword while updating the variable-length codeword - Google Patents

System and method for decoding a variable-length codeword while updating the variable-length codeword Download PDF

Info

Publication number
US20060202874A1
US20060202874A1 US11/166,174 US16617405A US2006202874A1 US 20060202874 A1 US20060202874 A1 US 20060202874A1 US 16617405 A US16617405 A US 16617405A US 2006202874 A1 US2006202874 A1 US 2006202874A1
Authority
US
United States
Prior art keywords
codeword
decoding
variable
buffer circuit
length
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
US11/166,174
Other versions
US7102550B1 (en
Inventor
Kiwamu Watanabe
Shuji Michinaka
Akihiro Oue
Tatsuhiro Suzumura
Satoshi Takekawa
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Assigned to KABUSHIKI KAISHA TOSHIBA reassignment KABUSHIKI KAISHA TOSHIBA ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: MICHINAKA, SHUJI, OUE, AKIHIRO, SUZUMURA, TATSUHIRO, TAKEKAWA, SATOSHI, WATANABE, KIWAMU
Application granted granted Critical
Publication of US7102550B1 publication Critical patent/US7102550B1/en
Publication of US20060202874A1 publication Critical patent/US20060202874A1/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

Definitions

  • the present invention relates to a system for decoding a variable-length codeword and a method for the same.
  • a variable-length codeword having a prefix portion and a suffix portion is used.
  • the code length of the suffix portion is determined by the number of bits of the prefix portion.
  • the decoding result is determined by the number of zeros in the prefix portion and the codeword of the suffix portion.
  • variable-length codeword is decoded by use of a general-purpose processor having a zero detection command.
  • the processor executes the following steps:
  • each of the steps listed above requires an execution time corresponding to at least one cycle of the processor. Moreover, also in the case of a short codeword within the capacity of the buffer circuit, the codeword is decoded using the above steps. Accordingly, in the case of the short codeword, a period of approximately 5 to 10 cycles is required to decode the exp-golomb codeword.
  • An aspect of the present invention inheres in a system for decoding a variable-length codeword.
  • the system includes a buffer circuit configured to store at least a part of the variable-length codeword; a detection circuit configured to detect the number of bits of a prefix portion of the variable-length codeword by use of a detection table while updating the variable-length codeword; an extraction circuit configured to extract a codeword of a suffix portion of the variable-length codeword based on the number of bits of the prefix portion while updating the variable-length codeword; and a first decoding circuit configured to decode the variable-length codeword based on the number of bits of the prefix portion and the codeword of the suffix portion.
  • Another aspect of the present invention inheres in a computer implemented method for decoding a variable-length codeword.
  • the method includes storing at least a part of the variable-length codeword in a buffer circuit; detecting the number of bits of a prefix portion of the variable-length codeword by use of a detection table while updating the variable-length codeword; extracting a codeword of a suffix portion of the variable-length codeword based on the number of bits of the prefix portion while updating the variable-length codeword; and decoding the variable-length codeword based on the number of bits of the prefix portion and the codeword of the suffix portion.
  • FIG. 1 is a schematic diagram showing a configuration of a system for decoding a variable-length codeword according to a first embodiment of the present invention.
  • FIG. 2 is a table showing an example of a decoding result by the system for decoding a variable-length codeword according to the first embodiment of the present invention.
  • FIG. 3 is an example of a detection table used in the decoding system according to the first embodiment of the present invention.
  • FIGS. 4A to 4 E show examples of states of the bit strings stored in a buffer circuit of the system for decoding a variable-length codeword according to the first embodiment of the present invention.
  • FIG. 5 is a schematic diagram showing a configuration of a system for decoding a variable-length codeword according to a second embodiment of the present invention.
  • FIG. 6 is an example of a first decoding table used in the system for decoding a variable-length codeword according to the second embodiment of the present invention.
  • FIG. 7 is an example of a first codeword length table used in the system for decoding a variable-length codeword according to the second embodiment of the present invention.
  • FIG. 8 is a schematic diagram showing a configuration of a system for decoding a variable-length codeword according to a third embodiment of the present invention.
  • FIG. 9 is an example of a second decoding table used in the system for decoding a variable-length codeword according to the third embodiment of the present invention.
  • FIG. 10 is an example of a second codeword length table used in the system for decoding a variable-length codeword according to the third embodiment of the present invention.
  • FIG. 11 is a table showing an example of the variable-length codeword to be decoded by the system for decoding a variable-length codeword according to the third embodiment of the present invention.
  • a system for decoding a variable-length codeword includes a buffer circuit 10 , a detection circuit 20 , an extraction circuit 30 and a first decoding circuit 40 .
  • the buffer circuit 10 stores at least a part of a variable-length codeword.
  • the detection circuit 20 detects the number of bits of the prefix portion of the variable-length codeword by use of a detection table Ta while updating the variable-length codeword.
  • the extraction circuit 30 extracts the codeword of the suffix portion of the variable-length codeword on the basis of the number of bits of the prefix portion while updating the variable-length codeword.
  • the first decoding circuit 40 decodes the variable-length codeword on the basis of the number of bits of the prefix portion and the codeword of the suffix portion.
  • “updating the variable-length codeword” means storing, in the buffer circuit 10 , the remaining portion of the variable-length codeword, a part of which was stored in the buffer circuit 10 .
  • the detection table Ta is a table for looking up the number of bits of the variable-length codeword stored in the buffer circuit 10 .
  • variable-length codeword decoded by the system shown in FIG. 1 is an exp-golomb codeword, for example.
  • a decoding result is determined by the number of zeros in the prefix portion and the codeword of the suffix portion.
  • a description will be given below of a case where the variable-length codeword is an exp-golomb codeword, as an example.
  • a variable-length codeword (hereinafter referred to as “the codeword”) SA is fed to the decoding system shown in FIG. 1 . If the number of bits of the codeword SA is larger than the number of bits B 1 which can be stored in the buffer circuit 10 , the first B 1 -bit part of the codeword SA is stored in the buffer circuit 10 . As shown in FIG. 1 , a decoding result SB of the codeword SA is transmitted as an output from the first decoding circuit 40 .
  • the exp-golomb codeword has a prefix portion and a suffix portion, the code length of which is determined by the number of zeros in the prefix portion. For example, when the codeword SA is the bit string “00110”, the first bit string “00” is the prefix portion. The next bit “1” is the bit (hereinafter referred to as “the boundary bit”) indicating the boundary between the prefix portion and the suffix portion. Since there are two zeros included in the prefix portion, the code length of the suffix portion is two. That is, the bit string “10” following the boundary bit “1” is the suffix portion.
  • [1 ⁇ Ra] represents a bit string having the number of bits Ra of “0”s after “1”. For example, if the codeword SA is the bit string “00110”, the number of bits Ra is two, and the codeword Rb is the bit string “10”. Accordingly, [1 ⁇ Ra] is the bit string “100”.
  • the decoding results similarly obtained from various codewords by use of the expression (1) are shown in FIG. 2 .
  • the detection circuit 20 includes a bit-number detection circuit 21 , a detection shifting circuit 22 , a detection register 23 , and an adder 24 .
  • the buffer circuit 10 , the detection shifting circuit 22 , and the adder 24 are connected to the bit-number detection circuit 21 .
  • the bit-number detection circuit 21 detects the number of zeros in a line from the top of the codeword SA stored in the buffer circuit 10 with reference to the detection table Ta.
  • the detection register 23 stores the number of bits Ra of the prefix portion of the codeword SA.
  • the bit-number detection circuit 21 and an adder 50 are connected to the detection shifting circuit 22 .
  • the detection shifting circuit 22 updates the buffer circuit 10 by the number of zeros detected by the bit-number detection circuit 21 .
  • the detection table Ta is a table for looking up the number of zeros in a line from the top of a codeword, as shown in FIG. 3 , for example.
  • “x” is an arbitrary bit, that is, “0” or “1”.
  • the number of zeros in a line from the top of the codeword is three.
  • the number of bits Ra of the prefix portion of the codeword “0001xxx” is three.
  • the bit-number detection circuit 21 transmits the number of bits B 1 to the detection shifting circuit 22 .
  • the detection shifting circuit 22 update uses the adder 50 to the codeword SA, stored in the buffer circuit 10 , by the number of bits B 1 . That is, the following bits of the prefix portion of the codeword SA are stored in the buffer circuit 10 .
  • the number of bits B 1 is stored in the detection register 23 . If the codeword newly stored in the buffer circuit 10 includes “0”s only, the above steps are repeated.
  • the buffer circuit 10 is updated by the number of bits B 1 . Then, the number of bits B 1 is added to the detection register 23 .
  • the bit-number detection circuit 21 detects the number of zeros in a line from the top of the codeword stored in the buffer circuit 10 by use of the detection table Ta. The detected number of zeros is added to the detection register 23 .
  • the number of 0 in the prefix portion of the codeword SA detected by the bit-number detection circuit 21 is added to the detection register 23 by the adder 24 . Therefore, even if the number of bits Ra of the prefix portion of the codeword SA is larger than the number of bits B 1 which can be stored in the buffer circuit 10 , the number of bits Ra is stored in the detection register 23 .
  • the extraction circuit 30 shown in FIG. 1 includes an extraction shifting circuit 31 , an extraction register 32 , an adder 33 , a bit-number register 34 and a subtracter 35 .
  • the extraction register 32 , the adder 33 and the bit-number register 34 are connected to the extraction shifting circuit 31 .
  • the buffer circuit 10 and the extraction register 32 are connected to the adder 33 .
  • the subtracter 35 and the detection register 23 are connected to the bit-number register 34 .
  • the extraction circuit 30 extracts the codeword Rb of the suffix portion of the codeword SA from the buffer circuit 10 .
  • the extracted codeword Rb is stored in the extraction register 32 .
  • the code length of the codeword Rb of the suffix portion is the number of bits Ra of the prefix portion. Therefore, the extraction circuit 30 extracts the codeword Rb of the suffix portion as the bit string of the bit length of Ra. If the number of bits of the codeword Rb is larger than the number of bits B 1 , the entire codeword Rb cannot be stored in the buffer circuit 10 . In this case, the extraction circuit 31 updates the buffer circuit 10 and sequentially extracts the codeword Rb. Then, the extraction circuit 30 stores the codeword Rb of the suffix portion in the extraction register 32 .
  • the bit-number register 34 stores the number of bits Ra.
  • the detection register 23 and the extraction register 32 are connected to the first decoding circuit 40 .
  • the first decoding circuit 40 obtains the decoding result SB by use of the expression (1) on the basis of the number of bits Ra of the prefix portion received from the detection resistor 23 , and the codeword Rb of the suffix portion received from the extraction register 32 .
  • the codeword SA is fed to the decoding system shown in FIG. 1 , and stored in the buffer circuit 10 .
  • the number of bits B 1 which can be stored in the buffer circuit 10 is 8 bits
  • the codeword SA is the nineteen-bit string “0000000001010010110”, as shown in FIG. 4A
  • the bit string “00000000”, which is the first eight bits of the codeword SA is stored in the buffer circuit 10 .
  • “eight” is stored in the detection register 23 .
  • the detection shifting circuit 22 updates the buffer circuit 10 by eight bits, and, as shown in FIG.
  • the bit string “01010010” is stored in the buffer circuit 10 .
  • the bit-number detection circuit 21 detects that the number of zeros in a line from the top of the bit string “01010010”, stored in the buffer circuit 10 , is one with reference to the detection table Ta. The detected number of zeros is added to the detection register 23 .
  • the detection shifting circuit 22 updates the buffer circuit 10 by one bit. Accordingly, as shown in FIG. 4C , the bit string “10100101” is stored in the buffer circuit 10 . In addition, the detection shifting circuit 22 updates the buffer circuit 10 by one bit in order to eliminate the boundary bit “1” from the buffer circuit 10 . As a result, as shown in FIG. 4D , the bit string “01001011” is stored in the buffer circuit 10 . In other words, the first eight bits of the bit string “010010110”, which is the codeword Rb, are stored in the buffer circuit 10 from the first bit thereof.
  • the extraction circuit 30 acquires the codeword Rb of the suffix portion of the codeword SA from the buffer circuit 10 with reference to the number of bits Ra stored in the bit-number register 34 . As is shown in the above example, if the number of bits of the codeword Rb is larger than the number of bits B 1 , the entire codeword Rb cannot be stored in the buffer circuit 10 . In this case, the extraction circuit 31 updates the buffer circuit 10 and acquires the codeword Rb.
  • the extraction circuit 30 acquires the bit string “01001011”, that is, “75”, stored in the buffer circuit 10 with reference to the number of bits Ra stored in the bit-number register 34 .
  • the extraction shifting circuit 31 updates the buffer circuit 10 by the number of bits of the acquired bit string, that is, by eight bits.
  • the bit string “0xxxxxxx” is stored in the buffer circuit 10 .
  • “x” is a bit of a codeword stored in the buffer circuit 10 next to the codeword SA.
  • the eight bits, by which the extraction shifting circuit 31 updates the buffer circuit 10 is subtracted from the bit-number register 34 by the subtracter 35 . As a result, one is stored in the bit-number register 34 .
  • the first decoding circuit 40 decodes the codeword SA by use of the expression (1) on the basis of the number of bits Ra of the prefix portion and the codeword Rb of the suffix portion, and transmits the decoding result SB.
  • the decoding result SB 661.
  • the detection shifting circuit 22 updates the buffer circuit 10 on the basis of the number of bits Ra, and stores the next codeword to be decoded in the buffer circuit 10 from the first bit thereof.
  • the system for decoding a variable-length codeword detects the number of bits Ra of the prefix portion of the received codeword SA while updating the buffer circuit 10 .
  • the system extracts the codeword Rb of the suffix portion while updating the buffer circuit 10 . Accordingly, even if the number of bits of the codeword SA is larger than the number of bits B 1 which can be stored in the buffer circuit 10 , it is possible to perform decoding.
  • the system detects the number of bits Ra of the prefix portion of the codeword SA by comparing the codeword stored in the buffer circuit 10 and the detection table Ta. Accordingly, it is possible to reduce the number of cycles required to decode the codeword SA, as compared to the case where the number of bits Ra are detected by use of a zero detection command of a general purpose processor.
  • a system for decoding a variable-length codeword according to a second embodiment of the present invention is different from the system of FIG. 1 in that the system of this embodiment further includes a second decoding circuit 41 , a selector 60 , a decoding table Tb and a codeword length table Tc. Otherwise, the configuration is similar to that of the first embodiment shown in FIG. 1 .
  • the second decoding circuit 41 decodes the codeword SA by use of the decoding table Tb.
  • the selector 60 transmits one of the decoding result SBa determined by a first decoding circuit 40 and the decoding result SBb determined by the second decoding circuit 41 as the decoding result SB of the codeword SA.
  • the decoding table Tb is a table for looking up the decoding result of the codeword stored in the buffer circuit 10 as shown in FIG. 6 , for example.
  • the second decoding circuit 41 compares the codeword stored in the buffer circuit 10 and the bit strings in the decoding table Tb. If there is a bit string matching the codeword stored in the buffer circuit 10 among the bit strings in the decoding table Tb, the second decoding circuit 41 acquires, from the decoding table Tb, the decoding result corresponding to the bit string which matches the codeword. If there is no bit string matching the codeword in the decoding table Tb, the decoding table Tb returns “0” as the decoding result.
  • the decoding table Tb If the number of bits of the codeword to be decoded is larger than the number of bits B 1 which can be stored in the buffer circuit 10 , there is no bit string matching the codeword in the decoding table Tb, and the decoding table Tb therefore returns “0” as the decoding result.
  • a codeword SA to be decoded is fed to the decoding system shown in FIG. 5 , and is stored in the buffer circuit 10 . If there is a bit string matching the codeword SA stored in the buffer circuit 10 among the bit strings in the decoding table Tb, the second decoding circuit 41 acquires the corresponding decoding result SBb from the decoding table Tb. For example, when the codeword “00010101” is stored in the buffer circuit 10 , the second decoding circuit 41 acquires the decoding result “9”. The acquired decoding result SBb is transmitted from the second decoding circuit 41 to the selector 60 .
  • a bit-number detection circuit 21 detects the code length of the codeword stored in the buffer circuit 10 with reference to the codeword length table Tc.
  • the codeword length table Tc is a table for looking up the code length of the codeword stored in the buffer circuit 10 as shown in FIG. 7 , for example.
  • “x” is an arbitrary bit, that is, “0” or “1”.
  • the bit string “00010101” stored in the buffer circuit 10 matches the bit string “0001xxx” in the codeword length table Tc. Accordingly, the code length of the codeword stored in the buffer circuit 10 is seven bits.
  • a detection shifting circuit 22 updates the buffer circuit 10 by seven bits, and stores the next codeword to be decoded in the buffer circuit 10 from the first bit thereof.
  • the codeword is decoded by the method described in the first embodiment. Specifically, a detection circuit 20 detects the number of bits Ra of the prefix portion of the codeword SA. Next, an extraction circuit 30 extracts the codeword Rb of the suffix portion. Then, the first decoding circuit 40 acquires the decoding result SBa by use of the expression (1) on the basis of the number of bits Ra of the prefix portion and the codeword Rb of the suffix portion. The acquired decoding result SBa is transmitted to the selector 60 .
  • One of the decoding result SBa and the decoding result SBb is transmitted to the selector 60 .
  • the selector 60 transmits one of the decoding result SBa and the decoding result SBb as the decoding result SB of the codeword SA.
  • the decoding table Tb for looking up the decoding result of the codeword stored in the buffer circuit 10 is used. Accordingly, if the number of bits of the codeword SA is smaller than the number of bits B 1 which can be stored in the buffer circuit 10 , it is possible to decode the codeword SA in one cycle. In the decoding system shown in FIG. 1 , since each of detection of the number of bits Ra of the prefix portion and the extraction of the codeword Rb of the suffix portion requires at least one cycle, at least two cycles are required to decode the codeword SA.
  • the system for decoding a variable-length codeword according to the second embodiment, it is possible to reduce the number of cycles required to decode the codeword SA.
  • the second embodiment is substantially similar to the first embodiment, and a redundant description is omitted.
  • a decoding system is different from the system of FIG. 5 in that the system of this embodiment further includes a third decoding circuit 42 , a second codeword decoding table Td and a second codeword length table Te. Otherwise, the configuration is similar to that of the second embodiment shown in FIG. 5 .
  • the third decoding circuit 42 decodes the second codeword stored in the buffer circuit 10 by use of the second codeword decoding table Td.
  • the second codeword decoding table Td is a table for looking up the decoding result of the second codeword stored in the buffer circuit 10 , as shown in FIG. 9 , for example.
  • “x” is an arbitrary bit, that is, “0” or “1”.
  • the third decoding circuit 42 compares the bit string stored in the buffer circuit 10 and the bit strings in the second codeword decoding table Td. If there is a bit string matching the bit string stored in the buffer circuit 10 among the bit strings in the second codeword decoding table Td, the third decoding circuit 42 acquires, from the second codeword decoding table Td, the decoding result corresponding to the bit string which matches the bit string stored in the buffer circuit 10 .
  • a bit-number detection circuit 21 detects the code length of the second codeword stored in the buffer circuit 10 , with reference to the second codeword length table Te.
  • the second codeword length table Te is a table for looking up the code length of the second codeword stored in the buffer circuit 10 , as shown in FIG. 10 , for example.
  • “x” is an arbitrary bit, that is, “0” or “1”. If there is no second codeword stored in the buffer circuit 10 in the second codeword length table Te, the second codeword length table Te returns “0” as the code length of the codeword.
  • the codewords SA 1 and SA 2 to be decoded are fed to the decoding system shown in FIG. 8 , and the bit string “01100110” is stored in the buffer circuit 10 as shown in FIG. 11 .
  • a detection circuit 20 detects three bits of the code length of the first codeword SA 1 stored in the buffer circuit 10 , with reference to the codeword length table Tc shown in FIG. 7 .
  • the detection circuit 20 detects the code length of the second codeword SA 2 stored in the buffer circuit 10 , with reference to the second codeword length table Te shown in FIG. 10 .
  • the bit string “01100110” matches the bit string “01x001xx” in the second codeword length table Te shown in FIG. 10 . Accordingly, the detection circuit 20 detects five bits as the code length of the codeword SA 2 stored in the buffer circuit 10 the second.
  • the third decoding circuit 42 acquires the decoding result of the second codeword SA 2 stored in the buffer circuit 10 , with reference to the second codeword decoding table Td shown in FIG. 9 .
  • the bit string stored in the buffer circuit 10 matches the bit string “01x00110” in the second codeword decoding table Td shown in FIG. 9 . Accordingly, the third decoding circuit 42 acquires “5” as the decoding result SB 2 of the codeword SA 2 of the bit string “00110”. Then, the third decoding circuit 42 transmits the decoding result SB 2 .
  • the third decoding circuit 42 can decode the codeword SA 2 in one cycle.
  • a second decoding circuit 41 decodes the codeword SA stored in the buffer circuit 10 by use of the decoding table Tb. Specifically, the second decoding circuit 41 acquires the detection result “2” corresponding to the bit string “011” which matches the codeword SA 1 by use of the decoding table Tb shown in FIG. 6 . Then the second decoding circuit 41 transmits the acquired decoding result “2” as the decoding result SB of the codeword SA 1 . By using the decoding table Tb, the second decoding circuit 41 can decode the codeword SA 1 in one cycle.
  • the second and third decoding circuits 41 and 42 can operate simultaneously. That is, decoding the codeword SA 1 and the codeword SA 2 can be performed in the same cycle.
  • the detection circuit 20 updates the bit string stored in the buffer circuit 10 by a total of eight bits, which results from three bits of the code length of the codeword SA 1 , and five bits of the code length of the codeword SA 2 .
  • the next codeword to be decoded is stored in the buffer circuit 10 from the first bit thereof.
  • the second decoding circuit 41 decodes the codeword SA 1 by use of the decoding table Tb.
  • the decoding system shown in FIG. 8 transmits the decoding result SB 1 of the codeword SA 1 . No decoding result SB 2 of the codeword SA 2 is transmitted.
  • the case where the code length of the codeword SA 1 detected by use of the codeword length table Tc is zero corresponds to the case where the number of bits of the codeword SA 1 is larger than the number of bits B 1 which can be stored in the buffer circuit 10 .
  • the codeword SA 1 is decoded by the method described in the first embodiment. Specifically, the detection circuit 20 detects the number of bits Ra of the prefix portion of the codeword SA 1 . Next, an extraction circuit 30 extracts the codeword Rb of the suffix portion. Then, a first decoding circuit 40 acquires the decoding result SBa by use of the expression (1) on the basis of the number of bits Ra of the prefix portion and the codeword Rb of the suffix portion.
  • the decoding system shown in FIG. 8 transmits the decoding result SBa as the decoding result SB 1 of the codeword SA 1 . No decoding result SB 2 of the codeword SA 2 is transmitted.
  • the decoding system shown in FIG. 8 decodes only the codeword SA 1 stored in the buffer circuit 10 , as in the method described in the second embodiment.
  • the system for decoding a variable-length codeword according to the third embodiment of the present invention performs decoding by use of the decoding table Tb for looking up the decoding result of the first codeword stored in the buffer circuit 10 , and the second codeword decoding table Td for looking up the decoding result of the second codeword stored in the buffer circuit 10 . Accordingly, when a plurality of codewords are stored in the buffer circuit 10 , decoding two codewords can be performed in one cycle simultaneously. Therefore, with the system for decoding a variable-length codeword according to the third embodiment, it is possible to reduce the number of cycles required to decode a codeword. Otherwise, the third embodiment is substantially similar to the second embodiment, and a redundant description is omitted.
  • a decoding system for decoding two codewords stored in the buffer circuit 10 in the same cycle uses the decoding table Tb and the second codeword decoding table Td. It is also possible to provide a decoding system which includes a decoding circuit for decoding a third codeword stored in the buffer circuit 10 , a decoding circuit for decoding a fourth codeword stored in the buffer circuit 10 , and the like, so that the system decodes at least three codewords in the same cycle.

Abstract

A system for decoding a variable-length codeword includes a buffer circuit storing the codeword, a detection circuit detecting the number of bits of a prefix portion of the codeword by use of a detection table while updating the codeword, an extraction circuit extracting a codeword of a suffix portion of the codeword based on the number of bits of the prefix portion while updating the codeword, and a first decoding circuit decoding the codeword base on the number of bits of the prefix portion and the codeword of the suffix portion.

Description

    CROSS REFERENCE TO RELATED APPLICATIONS AND INCORPORATION BY REFERENCE
  • This application is based upon and claims the benefit of priority from prior Japanese Patent Application P2005-069795 filed on Mar. 11, 2005; the entire contents of which are incorporated by reference herein.
  • BACKGROUND OF THE INVENTION
  • 1. Field of the Invention
  • The present invention relates to a system for decoding a variable-length codeword and a method for the same.
  • 2. Description of the Related Art
  • In data transmission, a variable-length codeword having a prefix portion and a suffix portion is used. The code length of the suffix portion is determined by the number of bits of the prefix portion. For example, with regard to an exp-golomb codeword, the decoding result is determined by the number of zeros in the prefix portion and the codeword of the suffix portion.
  • In the related art, a variable-length codeword is decoded by use of a general-purpose processor having a zero detection command. The processor executes the following steps:
    • (1) The number of zeros located in a line from the top of the variable-length codeword stored in a buffer circuit is counted by the zero detection command.
    • (2) The location of the first bit of the suffix portion of the variable-length codeword stored in the buffer circuit is calculated on the basis of the number of zeros.
    • (3) The suffix portion is stored in the buffer circuit.
    • (4) The decoding result is obtained from the number of zeros in the prefix portion and the codeword of the suffix portion.
  • Each of the steps listed above requires an execution time corresponding to at least one cycle of the processor. Moreover, also in the case of a short codeword within the capacity of the buffer circuit, the codeword is decoded using the above steps. Accordingly, in the case of the short codeword, a period of approximately 5 to 10 cycles is required to decode the exp-golomb codeword.
  • There is a method for decoding a variable-length codeword in which the codeword is divided into halves having a half-length of the maximum code length when the number of bits of the variable-length codeword is larger than the number of bits which can be stored in the buffer circuit. However, in this method, a buffer circuit which can store the codeword having a half-length of the maximum code length is required.
  • SUMMARY OF THE INVENTION
  • An aspect of the present invention inheres in a system for decoding a variable-length codeword. The system includes a buffer circuit configured to store at least a part of the variable-length codeword; a detection circuit configured to detect the number of bits of a prefix portion of the variable-length codeword by use of a detection table while updating the variable-length codeword; an extraction circuit configured to extract a codeword of a suffix portion of the variable-length codeword based on the number of bits of the prefix portion while updating the variable-length codeword; and a first decoding circuit configured to decode the variable-length codeword based on the number of bits of the prefix portion and the codeword of the suffix portion.
  • Another aspect of the present invention inheres in a computer implemented method for decoding a variable-length codeword. The method includes storing at least a part of the variable-length codeword in a buffer circuit; detecting the number of bits of a prefix portion of the variable-length codeword by use of a detection table while updating the variable-length codeword; extracting a codeword of a suffix portion of the variable-length codeword based on the number of bits of the prefix portion while updating the variable-length codeword; and decoding the variable-length codeword based on the number of bits of the prefix portion and the codeword of the suffix portion.
  • BRIEF DESCRIPTION OF DRAWINGS
  • FIG. 1 is a schematic diagram showing a configuration of a system for decoding a variable-length codeword according to a first embodiment of the present invention.
  • FIG. 2 is a table showing an example of a decoding result by the system for decoding a variable-length codeword according to the first embodiment of the present invention.
  • FIG. 3 is an example of a detection table used in the decoding system according to the first embodiment of the present invention.
  • FIGS. 4A to 4E show examples of states of the bit strings stored in a buffer circuit of the system for decoding a variable-length codeword according to the first embodiment of the present invention.
  • FIG. 5 is a schematic diagram showing a configuration of a system for decoding a variable-length codeword according to a second embodiment of the present invention.
  • FIG. 6 is an example of a first decoding table used in the system for decoding a variable-length codeword according to the second embodiment of the present invention.
  • FIG. 7 is an example of a first codeword length table used in the system for decoding a variable-length codeword according to the second embodiment of the present invention.
  • FIG. 8 is a schematic diagram showing a configuration of a system for decoding a variable-length codeword according to a third embodiment of the present invention.
  • FIG. 9 is an example of a second decoding table used in the system for decoding a variable-length codeword according to the third embodiment of the present invention.
  • FIG. 10 is an example of a second codeword length table used in the system for decoding a variable-length codeword according to the third embodiment of the present invention.
  • FIG. 11 is a table showing an example of the variable-length codeword to be decoded by the system for decoding a variable-length codeword according to the third embodiment of the present invention.
  • DETAILED DESCRIPTION OF THE INVENTION
  • Various embodiments of the present invention will be described with reference to the accompanying drawings. It is to be noted that the same or similar reference numerals are applied to the same or similar parts and elements throughout the drawings, and the description of the same or similar parts and elements will be omitted or simplified.
  • In the following descriptions, numerous specific details are set forth such as specific signal values, etc., to provide a thorough understanding of the present invention. However, it will be obvious to those skilled in the art that the present invention may be practiced without such specific details. In other instances, well-known circuits have been shown in block diagram form in order not to obscure the present invention in unnecessary detail.
  • (FIRST EMBODIMENT)
  • As shown in FIG. 1, a system for decoding a variable-length codeword according to a first embodiment of the present invention includes a buffer circuit 10, a detection circuit 20, an extraction circuit 30 and a first decoding circuit 40. The buffer circuit 10 stores at least a part of a variable-length codeword. The detection circuit 20 detects the number of bits of the prefix portion of the variable-length codeword by use of a detection table Ta while updating the variable-length codeword. The extraction circuit 30 extracts the codeword of the suffix portion of the variable-length codeword on the basis of the number of bits of the prefix portion while updating the variable-length codeword. The first decoding circuit 40 decodes the variable-length codeword on the basis of the number of bits of the prefix portion and the codeword of the suffix portion. Herein, “updating the variable-length codeword” means storing, in the buffer circuit 10, the remaining portion of the variable-length codeword, a part of which was stored in the buffer circuit 10. As a result, the variable-length codeword stored in the buffer circuit 10 is updated. The detection table Ta is a table for looking up the number of bits of the variable-length codeword stored in the buffer circuit 10.
  • The variable-length codeword decoded by the system shown in FIG. 1 is an exp-golomb codeword, for example. As described above, in the exp-golomb codeword, a decoding result is determined by the number of zeros in the prefix portion and the codeword of the suffix portion. A description will be given below of a case where the variable-length codeword is an exp-golomb codeword, as an example. A variable-length codeword (hereinafter referred to as “the codeword”) SA is fed to the decoding system shown in FIG. 1. If the number of bits of the codeword SA is larger than the number of bits B1 which can be stored in the buffer circuit 10, the first B1-bit part of the codeword SA is stored in the buffer circuit 10. As shown in FIG. 1, a decoding result SB of the codeword SA is transmitted as an output from the first decoding circuit 40.
  • An example of the codeword SA is shown in FIG. 2. The exp-golomb codeword has a prefix portion and a suffix portion, the code length of which is determined by the number of zeros in the prefix portion. For example, when the codeword SA is the bit string “00110”, the first bit string “00” is the prefix portion. The next bit “1” is the bit (hereinafter referred to as “the boundary bit”) indicating the boundary between the prefix portion and the suffix portion. Since there are two zeros included in the prefix portion, the code length of the suffix portion is two. That is, the bit string “10” following the boundary bit “1” is the suffix portion.
  • On the basis of the number of bits Ra of the prefix portion and the codeword Rb of the suffix portion of the exp-golomb codeword, the decoding result SB is obtained by use of an expression (1):
    SB=([1<<Ra]−1)+Rb   (1)
    In the expression (1), [1<<Ra] represents a bit string having the number of bits Ra of “0”s after “1”. For example, if the codeword SA is the bit string “00110”, the number of bits Ra is two, and the codeword Rb is the bit string “10”. Accordingly, [1<<Ra] is the bit string “100”. The decoding result SB is the bit string “101”, which is obtained as follows: “1” is subtracted from the bit string “100” to obtain the bit string “011”; the bit string “10”, which is the codeword Rb of the suffix portion, is added to the bit string “011” to obtain the bit string “101”. That is, SB=5. The decoding results similarly obtained from various codewords by use of the expression (1) are shown in FIG. 2.
  • The detection circuit 20 includes a bit-number detection circuit 21, a detection shifting circuit 22, a detection register 23, and an adder 24. The buffer circuit 10, the detection shifting circuit 22, and the adder 24 are connected to the bit-number detection circuit 21. The bit-number detection circuit 21 detects the number of zeros in a line from the top of the codeword SA stored in the buffer circuit 10 with reference to the detection table Ta. The detection register 23 stores the number of bits Ra of the prefix portion of the codeword SA. The bit-number detection circuit 21 and an adder 50 are connected to the detection shifting circuit 22. The detection shifting circuit 22 updates the buffer circuit 10 by the number of zeros detected by the bit-number detection circuit 21.
  • The detection table Ta is a table for looking up the number of zeros in a line from the top of a codeword, as shown in FIG. 3, for example. In the bit strings of FIG. 3, “x”is an arbitrary bit, that is, “0” or “1”. For example, when the codeword “0001xxx” is stored in the buffer circuit 10, the number of zeros in a line from the top of the codeword is three. In other words, the number of bits Ra of the prefix portion of the codeword “0001xxx” is three.
  • If the number of bits Ra of the prefix portion of the codeword SA is larger than the number of bits B1 which can be stored in the buffer circuit 10, only “0” is stored in the buffer circuit 10. In this case, the bit-number detection circuit 21 transmits the number of bits B1 to the detection shifting circuit 22. Then, the detection shifting circuit 22 update uses the adder 50 to the codeword SA, stored in the buffer circuit 10, by the number of bits B1. That is, the following bits of the prefix portion of the codeword SA are stored in the buffer circuit 10. In addition, the number of bits B1 is stored in the detection register 23. If the codeword newly stored in the buffer circuit 10 includes “0”s only, the above steps are repeated. That is, until the boundary bit “1” of the codeword SA is detected, the buffer circuit 10 is updated by the number of bits B1. Then, the number of bits B1 is added to the detection register 23. When the boundary bit “1” of the codeword SA is detected, the bit-number detection circuit 21 detects the number of zeros in a line from the top of the codeword stored in the buffer circuit 10 by use of the detection table Ta. The detected number of zeros is added to the detection register 23.
  • As described above, the number of 0 in the prefix portion of the codeword SA detected by the bit-number detection circuit 21 is added to the detection register 23 by the adder 24. Therefore, even if the number of bits Ra of the prefix portion of the codeword SA is larger than the number of bits B1 which can be stored in the buffer circuit 10, the number of bits Ra is stored in the detection register 23.
  • The extraction circuit 30 shown in FIG. 1 includes an extraction shifting circuit 31, an extraction register 32, an adder 33, a bit-number register 34 and a subtracter 35. The extraction register 32, the adder 33 and the bit-number register 34 are connected to the extraction shifting circuit 31. The buffer circuit 10 and the extraction register 32 are connected to the adder 33. The subtracter 35 and the detection register 23 are connected to the bit-number register 34.
  • The extraction circuit 30 extracts the codeword Rb of the suffix portion of the codeword SA from the buffer circuit 10. The extracted codeword Rb is stored in the extraction register 32. As described above, the code length of the codeword Rb of the suffix portion is the number of bits Ra of the prefix portion. Therefore, the extraction circuit 30 extracts the codeword Rb of the suffix portion as the bit string of the bit length of Ra. If the number of bits of the codeword Rb is larger than the number of bits B1, the entire codeword Rb cannot be stored in the buffer circuit 10. In this case, the extraction circuit 31 updates the buffer circuit 10 and sequentially extracts the codeword Rb. Then, the extraction circuit 30 stores the codeword Rb of the suffix portion in the extraction register 32. The bit-number register 34 stores the number of bits Ra.
  • The detection register 23 and the extraction register 32 are connected to the first decoding circuit 40. The first decoding circuit 40 obtains the decoding result SB by use of the expression (1) on the basis of the number of bits Ra of the prefix portion received from the detection resistor 23, and the codeword Rb of the suffix portion received from the extraction register 32.
  • A description will be given below of a method for decoding a variable-length codeword by use of the decoding system shown in FIG. 1. The codeword SA is fed to the decoding system shown in FIG. 1, and stored in the buffer circuit 10. For example, if the number of bits B1 which can be stored in the buffer circuit 10 is 8 bits, and the codeword SA is the nineteen-bit string “0000000001010010110”, as shown in FIG. 4A, the bit string “00000000”, which is the first eight bits of the codeword SA, is stored in the buffer circuit 10. Accordingly, “eight” is stored in the detection register 23. Then, the detection shifting circuit 22 updates the buffer circuit 10 by eight bits, and, as shown in FIG. 4B, the bit string “01010010” is stored in the buffer circuit 10. Accordingly, the bit-number detection circuit 21 detects that the number of zeros in a line from the top of the bit string “01010010”, stored in the buffer circuit 10, is one with reference to the detection table Ta. The detected number of zeros is added to the detection register 23. As a result, the bit number Ra=9 of the prefix portion of the codeword SA is stored in the detection register 23. In addition, the number of bits Ra is transferred from the detection register 23 to the bit-number register 34, and the bit number Ra=9 is stored in the bit-number register 34.
  • On the basis of the number of zeros detected from the bit string “01010010”, the detection shifting circuit 22 updates the buffer circuit 10 by one bit. Accordingly, as shown in FIG. 4C, the bit string “10100101” is stored in the buffer circuit 10. In addition, the detection shifting circuit 22 updates the buffer circuit 10 by one bit in order to eliminate the boundary bit “1” from the buffer circuit 10. As a result, as shown in FIG. 4D, the bit string “01001011” is stored in the buffer circuit 10. In other words, the first eight bits of the bit string “010010110”, which is the codeword Rb, are stored in the buffer circuit 10 from the first bit thereof.
  • After the number of bits Ra are detected, the extraction circuit 30 acquires the codeword Rb of the suffix portion of the codeword SA from the buffer circuit 10 with reference to the number of bits Ra stored in the bit-number register 34. As is shown in the above example, if the number of bits of the codeword Rb is larger than the number of bits B1, the entire codeword Rb cannot be stored in the buffer circuit 10. In this case, the extraction circuit 31 updates the buffer circuit 10 and acquires the codeword Rb.
  • A description will be given by use of the above-described example. The extraction circuit 30 acquires the bit string “01001011”, that is, “75”, stored in the buffer circuit 10 with reference to the number of bits Ra stored in the bit-number register 34. Next, the extraction shifting circuit 31 updates the buffer circuit 10 by the number of bits of the acquired bit string, that is, by eight bits. As a result, as shown in FIG. 4E, the bit string “0xxxxxxx” is stored in the buffer circuit 10. Here, “x” is a bit of a codeword stored in the buffer circuit 10 next to the codeword SA. In addition, the eight bits, by which the extraction shifting circuit 31 updates the buffer circuit 10, is subtracted from the bit-number register 34 by the subtracter 35. As a result, one is stored in the bit-number register 34.
  • Next, the extraction circuit 30 acquires “0”, which is the first one bit of the bit string “0xxxxxxx” stored in the buffer circuit 10 with reference to the one bit stored in the bit-number register 34. Then, “0” acquired by the extraction circuit 30 and the value obtained by updating the previously acquired “75” by one bit are added by the adder 33, and the addition result is stored in the extraction register 32. As a result, the codeword Rb=150 of the suffix portion of the codeword SA is stored in the extraction register 32.
  • Next, the first decoding circuit 40 decodes the codeword SA by use of the expression (1) on the basis of the number of bits Ra of the prefix portion and the codeword Rb of the suffix portion, and transmits the decoding result SB. In the above-described example, the decoding result SB=661. Thereafter, the detection shifting circuit 22 updates the buffer circuit 10 on the basis of the number of bits Ra, and stores the next codeword to be decoded in the buffer circuit 10 from the first bit thereof.
  • As described above, the system for decoding a variable-length codeword according to the first embodiment of the present invention detects the number of bits Ra of the prefix portion of the received codeword SA while updating the buffer circuit 10. In addition, the system extracts the codeword Rb of the suffix portion while updating the buffer circuit 10. Accordingly, even if the number of bits of the codeword SA is larger than the number of bits B1 which can be stored in the buffer circuit 10, it is possible to perform decoding. In addition, the system detects the number of bits Ra of the prefix portion of the codeword SA by comparing the codeword stored in the buffer circuit 10 and the detection table Ta. Accordingly, it is possible to reduce the number of cycles required to decode the codeword SA, as compared to the case where the number of bits Ra are detected by use of a zero detection command of a general purpose processor.
  • (SECOND EMBODIMENT)
  • As shown in FIG. 5, a system for decoding a variable-length codeword according to a second embodiment of the present invention is different from the system of FIG. 1 in that the system of this embodiment further includes a second decoding circuit 41, a selector 60, a decoding table Tb and a codeword length table Tc. Otherwise, the configuration is similar to that of the first embodiment shown in FIG. 1. When an entire codeword SA is stored in a buffer circuit 10, that is, when the number of bits of the codeword SA is smaller than the number of bits B1 which can be stored in the buffer circuit 10, the second decoding circuit 41 decodes the codeword SA by use of the decoding table Tb. The selector 60 transmits one of the decoding result SBa determined by a first decoding circuit 40 and the decoding result SBb determined by the second decoding circuit 41 as the decoding result SB of the codeword SA.
  • The decoding table Tb is a table for looking up the decoding result of the codeword stored in the buffer circuit 10 as shown in FIG. 6, for example. The second decoding circuit 41 compares the codeword stored in the buffer circuit 10 and the bit strings in the decoding table Tb. If there is a bit string matching the codeword stored in the buffer circuit 10 among the bit strings in the decoding table Tb, the second decoding circuit 41 acquires, from the decoding table Tb, the decoding result corresponding to the bit string which matches the codeword. If there is no bit string matching the codeword in the decoding table Tb, the decoding table Tb returns “0” as the decoding result. If the number of bits of the codeword to be decoded is larger than the number of bits B1 which can be stored in the buffer circuit 10, there is no bit string matching the codeword in the decoding table Tb, and the decoding table Tb therefore returns “0” as the decoding result.
  • With reference to the decoding system shown in FIG. 5, a description will be given of a method for decoding a variable-length codeword. A codeword SA to be decoded is fed to the decoding system shown in FIG. 5, and is stored in the buffer circuit 10. If there is a bit string matching the codeword SA stored in the buffer circuit 10 among the bit strings in the decoding table Tb, the second decoding circuit 41 acquires the corresponding decoding result SBb from the decoding table Tb. For example, when the codeword “00010101” is stored in the buffer circuit 10, the second decoding circuit 41 acquires the decoding result “9”. The acquired decoding result SBb is transmitted from the second decoding circuit 41 to the selector 60.
  • A bit-number detection circuit 21 detects the code length of the codeword stored in the buffer circuit 10 with reference to the codeword length table Tc. The codeword length table Tc is a table for looking up the code length of the codeword stored in the buffer circuit 10 as shown in FIG. 7, for example. In the bit strings shown in FIG. 7, “x” is an arbitrary bit, that is, “0” or “1”. For example, the bit string “00010101” stored in the buffer circuit 10 matches the bit string “0001xxx” in the codeword length table Tc. Accordingly, the code length of the codeword stored in the buffer circuit 10 is seven bits. A detection shifting circuit 22 updates the buffer circuit 10 by seven bits, and stores the next codeword to be decoded in the buffer circuit 10 from the first bit thereof.
  • On the other hand, if there is no bit string matching the codeword stored in the buffer circuit 10 among the bit strings in the decoding table Tb, the codeword is decoded by the method described in the first embodiment. Specifically, a detection circuit 20 detects the number of bits Ra of the prefix portion of the codeword SA. Next, an extraction circuit 30 extracts the codeword Rb of the suffix portion. Then, the first decoding circuit 40 acquires the decoding result SBa by use of the expression (1) on the basis of the number of bits Ra of the prefix portion and the codeword Rb of the suffix portion. The acquired decoding result SBa is transmitted to the selector 60.
  • One of the decoding result SBa and the decoding result SBb is transmitted to the selector 60. The selector 60 transmits one of the decoding result SBa and the decoding result SBb as the decoding result SB of the codeword SA.
  • In the system for decoding a variable-length codeword according to the second embodiment of the present invention, the decoding table Tb for looking up the decoding result of the codeword stored in the buffer circuit 10 is used. Accordingly, if the number of bits of the codeword SA is smaller than the number of bits B1 which can be stored in the buffer circuit 10, it is possible to decode the codeword SA in one cycle. In the decoding system shown in FIG. 1, since each of detection of the number of bits Ra of the prefix portion and the extraction of the codeword Rb of the suffix portion requires at least one cycle, at least two cycles are required to decode the codeword SA. In other words, with the system for decoding a variable-length codeword according to the second embodiment, it is possible to reduce the number of cycles required to decode the codeword SA. Otherwise, the second embodiment is substantially similar to the first embodiment, and a redundant description is omitted.
  • (THIRD EMBODIMENT)
  • As shown in FIG. 8, a decoding system according to a third embodiment of the present invention is different from the system of FIG. 5 in that the system of this embodiment further includes a third decoding circuit 42, a second codeword decoding table Td and a second codeword length table Te. Otherwise, the configuration is similar to that of the second embodiment shown in FIG. 5. When a plurality of codewords are stored in a buffer circuit 10, the third decoding circuit 42 decodes the second codeword stored in the buffer circuit 10 by use of the second codeword decoding table Td.
  • The second codeword decoding table Td is a table for looking up the decoding result of the second codeword stored in the buffer circuit 10, as shown in FIG. 9, for example. In the bit strings shown in FIG. 9, “x” is an arbitrary bit, that is, “0” or “1”. The third decoding circuit 42 compares the bit string stored in the buffer circuit 10 and the bit strings in the second codeword decoding table Td. If there is a bit string matching the bit string stored in the buffer circuit 10 among the bit strings in the second codeword decoding table Td, the third decoding circuit 42 acquires, from the second codeword decoding table Td, the decoding result corresponding to the bit string which matches the bit string stored in the buffer circuit 10.
  • A bit-number detection circuit 21 detects the code length of the second codeword stored in the buffer circuit 10, with reference to the second codeword length table Te. The second codeword length table Te is a table for looking up the code length of the second codeword stored in the buffer circuit 10, as shown in FIG. 10, for example. In the bit strings shown in FIG. 10, “x” is an arbitrary bit, that is, “0” or “1”. If there is no second codeword stored in the buffer circuit 10 in the second codeword length table Te, the second codeword length table Te returns “0” as the code length of the codeword.
  • With reference to the decoding system shown in FIG. 8, a description will be given of a method for decoding a variable-length codeword. Hereinafter, a description will be given of the case where a codeword SA1 of the bit string “011” and a codeword SA2 of the bit string “00110” are stored in the buffer circuit 10, as shown in FIG. 11. Specifically, this is the case where neither the code length of the codeword SA1 detected by use of a codeword length table Tc nor the code length of the codeword SA2 detected by use of the second codeword length table Te is zero.
  • The codewords SA1 and SA2 to be decoded are fed to the decoding system shown in FIG. 8, and the bit string “01100110” is stored in the buffer circuit 10 as shown in FIG. 11. A detection circuit 20 detects three bits of the code length of the first codeword SA1 stored in the buffer circuit 10, with reference to the codeword length table Tc shown in FIG. 7. In addition, the detection circuit 20 detects the code length of the second codeword SA2 stored in the buffer circuit 10, with reference to the second codeword length table Te shown in FIG. 10. The bit string “01100110” matches the bit string “01x001xx” in the second codeword length table Te shown in FIG. 10. Accordingly, the detection circuit 20 detects five bits as the code length of the codeword SA2 stored in the buffer circuit 10 the second.
  • If the code length of the codeword SA2 detected by use of the second codeword length table Te is not zero, the third decoding circuit 42 acquires the decoding result of the second codeword SA2 stored in the buffer circuit 10, with reference to the second codeword decoding table Td shown in FIG. 9. The bit string stored in the buffer circuit 10 matches the bit string “01x00110” in the second codeword decoding table Td shown in FIG. 9. Accordingly, the third decoding circuit 42 acquires “5” as the decoding result SB2 of the codeword SA2 of the bit string “00110”. Then, the third decoding circuit 42 transmits the decoding result SB2. By using the second codeword decoding table Td, the third decoding circuit 42 can decode the codeword SA2 in one cycle.
  • As in the method described in the second embodiment, a second decoding circuit 41 decodes the codeword SA stored in the buffer circuit 10 by use of the decoding table Tb. Specifically, the second decoding circuit 41 acquires the detection result “2” corresponding to the bit string “011” which matches the codeword SA1 by use of the decoding table Tb shown in FIG. 6. Then the second decoding circuit 41 transmits the acquired decoding result “2” as the decoding result SB of the codeword SA1. By using the decoding table Tb, the second decoding circuit 41 can decode the codeword SA1 in one cycle.
  • The second and third decoding circuits 41 and 42 can operate simultaneously. That is, decoding the codeword SA1 and the codeword SA2 can be performed in the same cycle.
  • Thereafter, the detection circuit 20 updates the bit string stored in the buffer circuit 10 by a total of eight bits, which results from three bits of the code length of the codeword SA1, and five bits of the code length of the codeword SA2. As a result, the next codeword to be decoded is stored in the buffer circuit 10 from the first bit thereof.
  • On the other hand, if the code length of the codeword SA2 detected by use of the second codeword length table Te is zero, and the code length of the codeword SA1 detected by use of the codeword length table Tc is not zero, one codeword SA1 is stored in the buffer circuit 10. In this case, as in the method described in the second embodiment, the second decoding circuit 41 decodes the codeword SA1 by use of the decoding table Tb. The decoding system shown in FIG. 8 transmits the decoding result SB1 of the codeword SA1. No decoding result SB2 of the codeword SA2 is transmitted.
  • The case where the code length of the codeword SA1 detected by use of the codeword length table Tc is zero corresponds to the case where the number of bits of the codeword SA1 is larger than the number of bits B1 which can be stored in the buffer circuit 10. In this case, the codeword SA1 is decoded by the method described in the first embodiment. Specifically, the detection circuit 20 detects the number of bits Ra of the prefix portion of the codeword SA1. Next, an extraction circuit 30 extracts the codeword Rb of the suffix portion. Then, a first decoding circuit 40 acquires the decoding result SBa by use of the expression (1) on the basis of the number of bits Ra of the prefix portion and the codeword Rb of the suffix portion. The decoding system shown in FIG. 8 transmits the decoding result SBa as the decoding result SB1 of the codeword SA1. No decoding result SB2 of the codeword SA2 is transmitted.
  • If a setting to decode one codeword is chosen, the decoding system shown in FIG. 8 decodes only the codeword SA1 stored in the buffer circuit 10, as in the method described in the second embodiment.
  • The system for decoding a variable-length codeword according to the third embodiment of the present invention performs decoding by use of the decoding table Tb for looking up the decoding result of the first codeword stored in the buffer circuit 10, and the second codeword decoding table Td for looking up the decoding result of the second codeword stored in the buffer circuit 10. Accordingly, when a plurality of codewords are stored in the buffer circuit 10, decoding two codewords can be performed in one cycle simultaneously. Therefore, with the system for decoding a variable-length codeword according to the third embodiment, it is possible to reduce the number of cycles required to decode a codeword. Otherwise, the third embodiment is substantially similar to the second embodiment, and a redundant description is omitted.
  • (OTHER EMBODIMENTS)
  • In the above description of the third embodiment, a decoding system for decoding two codewords stored in the buffer circuit 10 in the same cycle uses the decoding table Tb and the second codeword decoding table Td. It is also possible to provide a decoding system which includes a decoding circuit for decoding a third codeword stored in the buffer circuit 10, a decoding circuit for decoding a fourth codeword stored in the buffer circuit 10, and the like, so that the system decodes at least three codewords in the same cycle.
  • Various modifications will become possible for those skilled in the art after receiving the teachings of the present disclosure without departing from the scope thereof.

Claims (20)

1. A system for decoding a variable-length codeword comprising:
a buffer circuit configured to store at least a part of the variable-length codeword;
a detection circuit configured to detect the number of bits of a prefix portion of the variable-length codeword by use of a detection table while updating the variable-length codeword;
an extraction circuit configured to extract a codeword of a suffix portion of the variable-length codeword based on the number of bits of the prefix portion while updating the variable-length codeword; and
a first decoding circuit configured to decode the variable-length codeword based on the number of bits of the prefix portion and the codeword of the suffix portion.
2. The system of claim 1, wherein the detection circuit comprises:
a bit-number detection circuit configured to detect the number of zeros in a line from the top of the variable-length codeword stored in the buffer circuit; and
a detection shifting circuit configured to update the buffer circuit by the number of zeros.
3. The system of claim 1, wherein the detection table is used to look up the number of zeros in a line from the top of the variable-length codeword stored in the buffer circuit.
4. The system of claim 1, further comprising: a detection register configured to store the number of bits of the prefix portion.
5. The system of claim 1, wherein the extraction circuit comprises an extraction shifting circuit configured to update the buffer circuit and sequentially extract the codeword of the suffix portion.
6. The system of claim 5, wherein the extraction shifting circuit updates the buffer circuit by the number of bits of the prefix portion.
7. The system of claim 1, further comprising: a second decoding circuit configured to decode the variable-length codeword by use of a decoding table when the entirety of the variable-length codeword is stored in the buffer circuit.
8. The system of claim 7, wherein the decoding table is used to look up the decoding result of the variable-length codeword stored in the buffer circuit.
9. The system of claim 7, further comprising: a codeword length table configured to look up the code length of the variable-length codeword stored in the buffer circuit.
10. The system of claim 1, further comprising: a third decoding circuit configured to decode a second variable-length codeword stored in the buffer circuit by use of a second codeword decoding table, when a plurality of variable-length codewords are stored in the buffer circuit.
11. The system of claim 10, wherein the second codeword decoding table is used to look up the decoding result of the variable-length codeword stored in the buffer circuit the second.
12. The system of claim 10, further comprising: a second codeword length table configured to look up the code length of the variable-length codeword stored in the buffer circuit the second.
13. A computer implemented method for decoding a variable-length codeword comprising:
storing at least a part of the variable-length codeword in a buffer circuit;
detecting the number of bits of a prefix portion of the variable-length codeword by use of a detection table while updating the variable-length codeword;
extracting a codeword of a suffix portion of the variable-length codeword based on the number of bits of the prefix portion while updating the variable-length codeword; and
decoding the variable-length codeword based on the number of bits of the prefix portion and the codeword of the suffix portion.
14. The method of claim 13, wherein detecting the number of bits of the prefix portion comprises:
detecting the number of zeros in a line from the top of the variable-length codeword stored in the buffer circuit; and
updating the buffer circuit by the number of 0.
15. The method of claim 13, wherein the detection table is used to look up the number of zeros in a line from the top of the variable-length codeword stored in the buffer circuit.
16. The method of claim 13, wherein extracting the codeword of the suffix portion comprises: updating the buffer circuit by the number of bits of the prefix portion and sequentially extracting the codeword of the suffix portion.
17. The method of claim 13, further comprising: decoding the variable-length codeword by use of a decoding table when the entirety of the variable-length codeword is stored in the buffer circuit.
18. The method of claim 17, wherein the decoding table is used to look up the decoding result of the variable-length codeword stored in the buffer circuit.
19. The method of claim 13, further comprising: decoding a second variable-length codeword stored in the buffer circuit, by use of a second codeword decoding table, when a plurality of variable-length codewords are stored in the buffer circuit.
20. The method of claim 19, wherein the second codeword decoding table is used to look up the decoding result of the variable-length codeword stored in the buffer circuit the second.
US11/166,174 2005-03-11 2005-06-27 System and method for decoding a variable-length codeword while updating the variable-length codeword Expired - Fee Related US7102550B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JPP2005-069795 2005-03-11
JP2005069795A JP2006254225A (en) 2005-03-11 2005-03-11 Apparatus and method for decoding variable length code

Publications (2)

Publication Number Publication Date
US7102550B1 US7102550B1 (en) 2006-09-05
US20060202874A1 true US20060202874A1 (en) 2006-09-14

Family

ID=36939474

Family Applications (1)

Application Number Title Priority Date Filing Date
US11/166,174 Expired - Fee Related US7102550B1 (en) 2005-03-11 2005-06-27 System and method for decoding a variable-length codeword while updating the variable-length codeword

Country Status (2)

Country Link
US (1) US7102550B1 (en)
JP (1) JP2006254225A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100156680A1 (en) * 2008-12-23 2010-06-24 Heo Se-Wan Method of driving bit stream processor

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4502384B2 (en) * 2004-11-25 2010-07-14 キヤノン株式会社 Variable length code decoding apparatus and variable length code decoding method
JP4825644B2 (en) * 2006-11-14 2011-11-30 ルネサスエレクトロニクス株式会社 Image decoding apparatus, image encoding apparatus, and system LSI
JP2008199100A (en) 2007-02-08 2008-08-28 Toshiba Corp Device for decoding variable length code
JP2008252230A (en) * 2007-03-29 2008-10-16 Toshiba Corp Image decoding device, and image decoding method
US8813143B2 (en) * 2008-02-26 2014-08-19 Time Warner Enterprises LLC Methods and apparatus for business-based network resource allocation
JP5083579B2 (en) * 2008-06-23 2012-11-28 日本電気株式会社 Decoding processing device, processor, electronic device, decoding processing method, and decoding processing program

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5173695A (en) * 1990-06-29 1992-12-22 Bell Communications Research, Inc. High-speed flexible variable-length-code decoder
US5245338A (en) * 1992-06-04 1993-09-14 Bell Communications Research, Inc. High-speed variable-length decoder
US5717394A (en) * 1993-02-10 1998-02-10 Ricoh Company Ltd. Method and apparatus for encoding and decoding data
US6414608B1 (en) * 1999-06-09 2002-07-02 Matsushita Electric Industrial Co., Ltd. Variable length code decoding device, digital broadcast receiving apparatus, and DVD reproducing apparatus
US6433709B1 (en) * 1999-09-10 2002-08-13 Kabushiki Kaisha Toshiba Decoding method and decoding apparatus for variable length code words, and computer readable recording medium for storing decoding program for variable length code words
US20050174270A1 (en) * 2002-05-17 2005-08-11 Koo Bon T. Programmable variable length decoder including interface of cpu processor
US6975253B1 (en) * 2004-08-06 2005-12-13 Analog Devices, Inc. System and method for static Huffman decoding

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2697301B2 (en) * 1990-11-26 1998-01-14 松下電器産業株式会社 Decryption device
JPH07502632A (en) * 1991-12-23 1995-03-16 インテル コーポレイシヨン Circuit for Huffman code decoding
JP2968112B2 (en) * 1991-12-27 1999-10-25 株式会社ピーエフユー Code conversion method
JPH05235781A (en) * 1992-02-19 1993-09-10 Fujitsu Ltd Decoding memory control system for code data
JP3136796B2 (en) * 1992-09-24 2001-02-19 ソニー株式会社 Variable length code decoder
JPH07235878A (en) * 1993-12-28 1995-09-05 Matsushita Electric Ind Co Ltd Variable length decoder
KR0178201B1 (en) * 1995-08-31 1999-05-01 배순훈 Variable length decoding apparatus
JPH09246988A (en) * 1996-03-05 1997-09-19 Canon Inc Decoder and method therefor
JP4877449B2 (en) * 2004-11-04 2012-02-15 カシオ計算機株式会社 Moving picture coding apparatus and moving picture coding processing program
JP4502384B2 (en) * 2004-11-25 2010-07-14 キヤノン株式会社 Variable length code decoding apparatus and variable length code decoding method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5173695A (en) * 1990-06-29 1992-12-22 Bell Communications Research, Inc. High-speed flexible variable-length-code decoder
US5245338A (en) * 1992-06-04 1993-09-14 Bell Communications Research, Inc. High-speed variable-length decoder
US5717394A (en) * 1993-02-10 1998-02-10 Ricoh Company Ltd. Method and apparatus for encoding and decoding data
US6414608B1 (en) * 1999-06-09 2002-07-02 Matsushita Electric Industrial Co., Ltd. Variable length code decoding device, digital broadcast receiving apparatus, and DVD reproducing apparatus
US6433709B1 (en) * 1999-09-10 2002-08-13 Kabushiki Kaisha Toshiba Decoding method and decoding apparatus for variable length code words, and computer readable recording medium for storing decoding program for variable length code words
US20050174270A1 (en) * 2002-05-17 2005-08-11 Koo Bon T. Programmable variable length decoder including interface of cpu processor
US6975253B1 (en) * 2004-08-06 2005-12-13 Analog Devices, Inc. System and method for static Huffman decoding

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100156680A1 (en) * 2008-12-23 2010-06-24 Heo Se-Wan Method of driving bit stream processor
US7956773B2 (en) * 2008-12-23 2011-06-07 Electronics And Telecommunications Research Institute Method of driving bit stream processor

Also Published As

Publication number Publication date
US7102550B1 (en) 2006-09-05
JP2006254225A (en) 2006-09-21

Similar Documents

Publication Publication Date Title
US7102550B1 (en) System and method for decoding a variable-length codeword while updating the variable-length codeword
US10846218B2 (en) Methods, devices and systems for compressing and decompressing data
KR100318780B1 (en) Method and apparatus for switching between data compression modes
US7411529B2 (en) Method of decoding bin values using pipeline architecture and decoding device therefor
CN101809871A (en) optimized cabac decoder
CN108702160B (en) Method, apparatus and system for compressing and decompressing data
KR102381999B1 (en) Method and system for decoding variable length coded input and method for modifying codebook
US8947272B2 (en) Decoding encoded data
US6778109B1 (en) Method for efficient data encoding and decoding
US9419646B2 (en) Hardware compression to find backward references with multi-level hashes
US20020015533A1 (en) Variable-length encoding and decoding apparatus
EP2975771B1 (en) A method for selecting starting positions in parallel decoding of a compressed image
US6919827B2 (en) Method and apparatus for effectively decoding Huffman code
US7567189B2 (en) Variable length code decoding apparatus and variable length code decoding method
JP2003111021A (en) Coded image data decoder, coded image data decoding method and program
KR100923948B1 (en) H.264 CAVLC Decoding Method based on Application-Specific Instruction-set Processor
US20010030615A1 (en) Variable length decoding system and method
US8854235B1 (en) Decompression circuit and associated compression method and decompression method
JP5567155B2 (en) Method and apparatus for improved multimedia decoder
US6144321A (en) Microprocessor dedicated to processing of bit streams in a system of compression/decompression of animated images
US7612692B2 (en) Bidirectional context model for adaptive compression
KR100462060B1 (en) UVLC Multiple Decoding Method
US6622279B1 (en) Computer for data processing and method for data processing using a computer
CN111342844B (en) LZW coding and improved run-length coding-based radar data lossless compression and decompression method
US20050275570A1 (en) Parallel leading bit detection for Exp-Golomb decoding

Legal Events

Date Code Title Description
AS Assignment

Owner name: KABUSHIKI KAISHA TOSHIBA, JAPAN

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:WATANABE, KIWAMU;MICHINAKA, SHUJI;OUE, AKIHIRO;AND OTHERS;REEL/FRAME:016970/0976

Effective date: 20050826

REMI Maintenance fee reminder mailed
LAPS Lapse for failure to pay maintenance fees
STCH Information on status: patent discontinuation

Free format text: PATENT EXPIRED DUE TO NONPAYMENT OF MAINTENANCE FEES UNDER 37 CFR 1.362

FP Expired due to failure to pay maintenance fee

Effective date: 20100905