Variable length decoding method and apparatus

Abstract: A variable length decoding apparatus is composed of a memory (22) for storing variable length coded bit data, shifting N-bit data which is previously output according to a control signal by a value of the control signal from the initial bit of the N-bit data, and outputting new N-bit data from a newly initial bit formed due to the shift of the previous N-bit data, a controller (23) for comparing code state values for discriminating a plurality of groups with each other in correspondence to the plurality of the groups for discriminating variable length codes in a variable length code table with each other, with N-bit data which is currently input from the memory (22), determining a group corresponding to the currently output N-bit data, and outputting a control signal for representing the number of bits of the bit data used for the determination of the group according to the determination result, a select signal for representing the determined group and N-bit data just preceding the current N-bit data, a combination logic portion (25) including a plurality of input combinations of which the values are determined by current N-bit data output from the controller (23) and previous N-bit data output from the memory (22) individually corresponding to the plurality of the groups, and generating a plurality of symbols individually corresponding to each group according to values of the individual input combinations and a multiplexer (26) receiving a plurality of the symbols generated by the logic combination portion (25) and outputting symbols selected by a select signal, which can be constituted by simple hardware and give an effect of maintaining a required processing speed for a variable length decoding operation.

Description: The present invention relates to a method and apparatus for decoding variable length coded data. In a high-definition television (HD-TV), a high-definition video cassette recorder (HD-VCR), a digital VCR, a digital camcorder or a multimedia system, both a video signal and an audio signal are digitally processed and the digitally processed signals are recorded on a recording medium, or transmitted to another reproducing apparatus. There are a prediction coding method, an orthogonal transform coding method, and a variable length coding method as proposed methods for digitally processing video information. Typical coding systems which use the above coding techniques perform an orthogonal transform coding operation, a quantization operation and a variable length coding operation with respect to blocks due to image division, in order to effectively compress video information. Such systems perform a prediction coding operation between frames or fields in order to further enhance a data compression rate. The above-described variable length coding apparatus compresses information based on statistics of symbols. A variable length code table is stored for variable length coding input symbols. The variable length coding table is made according to a Huffman coding technique. As is well known, according to the Huffman coding technique, a shorter code is assigned to a symbol having a relatively higher frequency of occurrence and a longer code is assigned to a symbol having a relatively lower frequency of occurrence. In a typical coding system, symbols which are input to the variable length coding apparatus are [run, level] symbols which are generally obtained by a run-length coding operation. The [run, level] symbols are obtained by a well-known zig-zag scan, in which the "run" represents the number of "0s" which sequentially exist between non-zero transform coefficients obtained by the zig-zag scan, and the "level" represents a value of the non-zero transform coefficient. The variable length code table made by the Huffman coding technique is divided into an escape region for a case that even one of the "run" or "level" has a large value and a regular region for the other cases. The [run, level] symbols in the regular region are assigned with codes according to the Huffman coding technique. On the contrary, since the [run, level] symbols in the escape region are extremely low statistically in their frequency of occurrence, escape (ESC) codes for representing a [run, level] symbol in the escape region are assigned together with a longer code. Codewords generated by the variable length coding method are transmitted to a decoding system in the form of a bitstream in which additional information such as the ESC code and an end of block (EOB) representing a block end is added. The decoding system performs a process reverse to a signal processing of the coding system, which comprises a variable length decoder, an inverse quantizer, an inverse orthogonal transformer to decode the coded information. If a bitstream is input to the conventional variable length decoder shown in Figure 1, a barrel shifter 11 outputs bit data within a window shifted by a code length received from a ROM 15 to address data ADDR of ROM 15. ROM 15 outputs the [run, level] symbols which are stored in positions designated by the address data applied from barrel shifter 11, to the inverse quantizer (not shown) which is located in the rear end. ROM 15 supplies also a length possessed by a codeword used for outputting the [run, level] symbols, that is, a code length corresponding to the variable length decoded [run, level] symbol, to barrel shifter 11. Barrel shifter 11 outputs the bit data within the window shifted by a newly applied code length to ROM 15 again. Barrel shifter 11 and ROM 15 repeat such operations and perform a variable length decoding operation continuously. Since the Figure 1 apparatus can generate a single [run, level] symbol with a single shift operation and a single reading operation (usually two clock pulse periods) irrespective of a code length, the apparatus can operate consistently and at a constant speed, and can operate at a high operation frequency. However, the variable length decoding apparatus requires ROM 15 for storing the variable length coding table and a barrel shifter 11. Thus, when such a variable length decoding apparatus is manufactured as an application specific integrated circuit (ASIC), complexity of the hardware increases and the cost rises due to the size increase. European Patent Application published under number 0589682 describes a decoder for decoding a Huffman code into data, comprising a barrel shifter, first and second decoder circuits each for receiving an output from the barrel shifter, a selector circuit for selectively outputting one of the decoded outputs from the decoder circuits, a shift controller for shifting the barrel shifter when signalled to do so by the first or second decoder output, and a controller for controlling the selector circuit so as to selectively output the decoded output of the first or second decoder to a data output terminal. Therefore, with a view to solving or alleviating the above problems, it is an aim of preferred embodiments of the present invention to provide a method for performing a variable length decoding operation on the basis of similarity of data possessed by variable length codes constituting a variable length code table proposed by the Moving Picture Experts Group (MPEG) II. Another aim of the preferred embodiments is to provide an apparatus for performing a variable length decoding operation at a processing speed required in the variable length decoding operation with simple hardware on the basis of similarity of data possessed by variable length codes constituting a variable length code table proposed by the Moving Picture Experts Group (MPEG) II. According to a first aspect of. the present invention there is provided a variable length decoding apparatus comprising: memory means for storing variable length coded bit data, shifting N-bit data which is previously output according to a control signal, produced from a control means, by a value of the control signal from the initial bit of the N-bit data, and outputting new N-bit data from a newly initial bit formed due to the shift of the previous N-bit data, characterised in that; the control means is for comparing code state values for discriminating a plurality of groups with each other in correspondence to the plurality of the groups for discriminating variable length codes in a variable length code table with each other, with N-bit data which is currently input from the memory means, determining a group corresponding to the currently output N-bit data, and outputting a control signal for representing the number of bits of the bit data used for the determination of the group according to the determination result, a select signal for representing the determined group and N-bit data just preceding the current N-bit data, and in that the apparatus also includes; combination logic means including a plurality of input combinations of which the values are determined by current N-bit data output from the control means and previous N-bit data output from the memory means individually corresponding to the plurality of the groups, and generating a plurality of symbols individually corresponding to the respective group according to values of the individual input combinations; and a multiplexer for receiving the plurality of the symbols generated by the logic combination means and outputting symbols selected by a select signal of the control means. Preferably, said N-bit data length is determined by a pattern of the bit data possessed by variable length codes constituting the variable length code table. Said N-bit data is preferably 4-bit data. Preferably, said groups are identified with each other on the basis of the most significant bits having the identical values to each other. Said variable length code table is preferably a table for transformation coefficients obtained by a discrete cosine transform method. Said memory means preferably comprises: a circular queue memory including a reading window having an N-bit data size, for outputting the N-bit data in the reading window region of which the position is designated by the reading pointer among the stored data to said control means and said combinational logic means; and an input and output controller for altering a value of the reading pointer according to the control signal generated by said control means. Said circular queue memory preferably further comprises a register for storing the variable length coded data and outputs the N-bit data whenever a data request signal is applied thereto, and wherein said circular queue memory is divided into a plurality of sections each of which storage region has N-bit data size, generates said data request signal whenever the section designated by said reading pointer value is altered into another section, and stores the N-bit data supplied from said register in response to said data request signal. Preferably said control means generates the control signal comprising code length information representing the number of significant bits used for determining the group among the currently input N-bit data and first information representing whether a sign bit is contained in the currently input N-bit data, when the specific group corresponding to the currently input N-bit data is determined by the determination result. Said control signal preferably represents the number of bits determined by said code length information and said first information. Preferably, said control means generates the control signal comprising second information representing that the specific group is not determined on the basis of the currently input N-bit data, when the specific group corresponding to the currently input N-bit data is not determined by the determination result. Said second information preferably represents the number (N) of bits of the N-bit data. Preferably said combinational logic means comprises a plurality of combinational logic circuits for outputting run data and run level corresponding to corresponding input combinational values on the basis of the minimum bit values which can identify the variable length codes belonging to the respective groups with each other. According to a second aspect of the present invention, there is provided a variable length decoding method comprising the steps of: (a) establishing code state values for discriminating a plurality of groups with each other in correspondence to the plurality of the groups for discriminating variable length codes in a variable length code table with each other; (b) establishing a plurality of input combinations of which the values are determined by current N-bit data and previous N-bit data individually corresponding to the plurality of the groups, and a plurality of symbols individually corresponding to values of the individual input combinations; (c) storing variable length coded bit data and outputting N-bit data from a newly first bit by shifting the first bit of the previously output N-bit data by a value of control signal; (d) determining a group corresponding to the current N-bit data on the basis of the comparison of the code state value established by step (a) with the current N-bit data output by step (c), and outputting a control signal for representing the number of bits of the bit data used for the determination of the group according to the determination result, a select signal for representing the determined group and N-bit data just preceding the current N-bit data; and (e) determining symbols according to the N-bit data output from step (c) and the N-bit data output from step (d) on the basis of the plurality of symbols corresponding to the values of the plurality of the input combinations and the individual input combinations. Said step (a) preferably comprises the step of dividing the variable length codes into the plurality of groups on the basis of the most significant bits having the identical values to each other. Said N-bit data length is preferably determined by a pattern of the bit data possessed by variable length codes constituting the variable length code table. Said N-bit data is preferably 4-bit data. Preferably, said step (b) further comprises the step of storing the minimum bit values capable of identifying the variable length codes belonging to the respective groups with each other, and symbols corresponding to the respective minimum bit values. Said step (d) may comprise the step (d1) of generating the control signal comprising code length information representing the number of significant bits used for determining the group among the currently input N-bit data and first information representing whether a sign bit is contained in the currently input N-bit data, when the specific group corresponding to the currently input N-bit data is determined by the determination result. Said step (d1) may further comprise the step of determining a value of the control signal by adding the code length information value and the first information value. Said step (d) may comprise the step (d2) of generating the control signal comprising second information representing that the specific group is not determined on the basis of the currently input N-bit data, when the specific group corresponding to the currently input N-bit data is not determined by the determination result. Said step (d2) may further comprise the step of generating the second information having the number (N) of the bits of the N-bit data as the control signal. Preferably, said step (e) comprises the steps of: (e1)generating a plurality of symbols individually corresponding to the respective groups according to the N-bit data output from said step (c) and the individual values of the plurality of the input combinations based on the N-bit data output from said step (d); and (e2)selecting one of the plurality of the symbols generated in step (e1) as a symbol of the variable length decoding operation. For a better understanding of the invention, and to show how embodiments of the same may be carried into effect, reference will now be made, by way of example, to the accompanying diagrammatic drawings, in which: Figure 1 is a block diagram of a conventional variable length decoder for decoding variable-length-coded data; Figure 2 is a block diagram of a variable length decoder according to a preferred embodiment of the present invention; and Figures 3A through 3C show variable length code tables rearranged for a discrete cosine transform coefficients proposed by the MPEG II in different forms. A preferred embodiment of the present invention will be described below in more detail with reference to the accompanying drawings Figures 2 through 3C. The present invention provides a system for variable-length-decoding input data based on characteristics of variable length code tables. Prior to describing the variable length decoding system proposed, the characteristics of the variable length code tables will be described below with reference to Figures 3A through 3C. The tables shown in Figures 3A through 3C are for variable-length-coding the DCT coefficients. The DCT coefficients are generated by a discrete cosine transform method which is a kind of orthogonal transform coding method, which are generated by orthogonal transform of pixel values contained within a video block composed of NxN pixels. A variable length code table proposed by the MPEG II in connection with the DCT coefficients is composed of [run, level] symbols and variable length codes assigned to the respective [run, level] symbols as shown in Figures 3A through 3C. The variable length code tables shown in Figures 3A through 3C are rearranged in sequence different from those of the variable length code tables proposed by the MPEG II. In other words, the variable length code tables shown in Figures 3A through 3C are rearranged so that the variable length codes having the same values in a plurality of the most significant bits (MSB) among the variable length codes form the same group. The rearranged variable length codes are divided into thirteen groups as shown in Figures 3A through 3C. Each group is discriminated by values (EOB, ESC AND S 0 through S 10 ) of the groups. In Figures 3A through 3C "s" located in the end of each variable length code represents a sign bit of level. If the value of s is "1," the level is positive and if the value of s is "0" the level is negative. Figure 2 shows an apparatus for variable-length-decoding input data on the basis of rearranged variable length code tables shown in Figures 3A through 3C. The Figure 2 apparatus includes a register 21 for receiving 8-bit parallel data and outputting 4-bit parallel data. The 8-bit parallel data input to register 21 is obtained by converting variable length coded data bitstream into parallel data. Such data conversion is accomplished by a serial-to-parallel conversion type first-in-first-out (FIFO) memory (not shown). A circular queue memory 22 for storing the 4-bit parallel data output from register 21 includes four sections each of which has a 4-bit sized storage region. Thus, circular queue memory 22 can store 16-bit data at the same time. Such a circular queue memory 22 generates a data request signal RQST in order to receive 4-bit parallel data from register 21. Circular queue memory 22 stores the 4-bit parallel data output from register 21 in positions of the recording window designated by a write pointer (wp). Circular queue memory 22 outputs 4-bit data A 3 A 2 A 1 A 0 in the window designated by a read pointer (RP) among the stored bit data. The recording window and the reading window have a 4-bit size which has a start position designated by the WP and RP, respectively. The output data A 3 A 2 A 1 A 0 of circular queue memory 22 is applied to a controller 23 and a combinational logic portion 25, respectively. Controller 23 generates signals SIGN, SIGN_OUT, NEXT_SIGN, CL, EOB, ESC or SEL on the basis of input data A 3 A 2 A 1 A 0 . The signals SIGN, SIGN_OUT, NEXT SIGN, CL, EOB, ESC or SEL are supplied to an input and output (I/O) controller 24. Select signal SEL is supplied to a multiplexer 26. Sign signal SIGN, EOB code and ESC code are supplied to a quantizer (not shown) in the succeeding end. Controller 23 also outputs 4-bit data B 3 B 2 B 1 B 0 which has been received just in advance of currently input data A 3 A 2 A 1 A 0 from circular queue memory 22 to combinational logic portion 25. Combinational logic portion 25 includes eleven combinational logic circuits 250, 251, ..., and 260 corresponding to groups S 1 -S 10 . The combinational logic circuits 250 through 260 are represented as abbreviation CLC which are identified with each other by subscripts in Figure 2. The respective combinational circuits 250 through 260 combine data A 3 A 2 A 1 A 0 applied from circular queue memory 22 with data B 3 B 2 B 1 B 0 applied from controller 23, according to an input combinational logic described in Table 2, to then output [run, level] data corresponding to the combined bit data. Multiplexer 26 outputs [run,level] data selected by select signal SEL from controller 23 among eleven [run, level] data supplied from combination logic portion 25. I/O controller 24 which is located between controller 23 and circular queue memory 22 controls data storage and output in or from circular queue memory 22. I/O controller 24 determines values of the RP and WP according to signals SIGN OUT, NEXT_SIGN, CL, EOB and ESC supplied from controller 23. I/O controller 24 determines values of the RP and WP, so that a start position of the recording window designated by the WP always leads to that of the reading window designated by the RP by one section. I/O controller 24 also determines a value of the WP so that the reading window is always shifted by one section interval. The value of the WP is changed by four, every time the start position of the reading window is shifted by the RP to the following section. The value-determined RP and WP are applied to circular queue memory 22. The operation of the Figure 2 apparatus having the above construction will be described below. Register 21 outputs in parallel the firstly input 4-bit data to circular queue memory 22 whenever data request signal RQST is applied from circular queue memory 22. Circular queue memory 22 stores 4-bit data supplied from register 21 in the recording window having the start position designated by the current WP. Circular queue memory 22 generates a new data request signal RQST and applies the generated RQST to register 21 when the RP-designated section is altered. When the RP is applied from I/O controller 24, circular queue memory 22 outputs 4-bit data in the reading window having the start position designated by the current RP value among the stored data to controller 23. Controller 23 determines whether the 4-bit data A 3 A 2 A 1 A 0 applied from circular queue memory 22 belongs to which one of groups EOB, ESC and S 0 -S 10 , on the basis of the following Table 1. Controller 23 generates signals SIGN, SIGN_OUT, NEXT_SIGN, CL, EOB, ESC or SEL according to the determination result of the group. In Table 1, character "X" and bit values in the parentheses represent that a bit value of the place "0" or "1" is a "don't care place" for determining a group to which 4-bit data belongs. The number of the significant bits used for determining the group among the currently input 4-bit data is represented as a code length signal (CL). In groups EOB, S 0 -S 2 and S 4 , the CL is the number of the bits in a first code state excluding the character "X" and the number of the bits in the parentheses. For example, in case of the group EOB, the CL becomes "2" which is the number of bits "10" in "10XX". In groups ESC, S 3 S 5 and S 6 , the CL is the number of the bits in a second code state excluding the character "X". In groups S 7 -S 10 , the CL is the number of the bits in a third code state excluding the character "X". The sign output signal SIGN OUT has a value of "1" when a sign bit "s" is contained in the currently input 4-bit data A 3 A 2 A 1 A 0 while if not, the former has a value of "0". A next sign signal NEXT_SIGN to be described later represents that a group is not determined with respect to the currently input data. A sign signal SIGN represents a sign bit of a level. The EOB and ESC codes have been described referring to Figure 1. Group 1st Code State 2nd Code State 3rd Code State EOB 10XX ESC 0000 01XX S 0 1XXX 11XX 01 (1X) 01(0X) S 1 0011 S 2 0001 S 3 0000 1XXX S 4 0010 (1XXX) 0010 (0XXX) S 5 0000 001X S 6 0000 0001 S 7 0000 0000 1XXX S 8 0000 0000 01XX S 9 0000 0000 001X S 10 0000 0000 0001 The operations of controller 23, I/O controller 24 and circular queue memory 22 will be described in more detail with reference to Table 1, and Figures 3A through 3C. Controller 23 performs a group determination operation with respect to the currently input 4-bit data A 3 A 2 A 1 A 0 . If the currently input 4-bit data A 3 A 2 A 1 A 0 is determined as a specific group, controller 23 generates the EOB, ESC, SIGN OUT, NEXT_SIGM, or CL on the basis of the determined group and corresponding code state of the group. Controller 23 outputs select signal SEL representing the determined group to multiplexer 26. Controller 23 also outputs 4-bit data B 3 B 2 B 1 B 0 just preceding the 4-bit data A 3 A 2 A 1 A 0 used for determining the current group to combinational logic portion 25. In case of the groups EOB, S 0 -S 2 , and S 4 , a corresponding group can be determined by only currently input 4-bit data irrespective of the previously input data. A case that the currently input 4-bit data A 3 A 2 A 1 A 0 is determined as a group S 0 will be described below. When the first code state value is "1XXX", "11XX" or "01(1X)" in Table 1, controller 23 generates sign signal SIGN, sign output signal SIGN_OUT having a value of "1," code length signal (CL) representing the number of significant bits used for the group determination, that is, "1" or "2." Controller also generates select signal SEL representing that group S 0 has been determined by the currently input 4-bit data A 3 A 2 A 1 A 0 . Such a select signal is composed of 4-bit data so that groups S 0 -S 10 can be identified with each other. When the first code state value is "01(0X)", controller 23 generates select signal SEL, code length signal CL representing "2" being the number of the significant bits and next sign signal NEXT_SIGN. As can be seen in Figure 3A, this is because when the first code state value is "01 (0x)", the sign bit "s" is not contained in the currently input 4-bit data A 3 A 2 A 1 A 0 . When it is determined that the EOB code is contained in the currently input 4-bit data A 3 A 2 A 1 A 0 , controller 23 supplies the detected EOB code to I/O controller 24 and succeeding quantizer (not shown). Since the EOB code does not have sign bit "s", controller 23 generates sign output signal SIGN_OUT having a value of "0". When a specific group corresponding to the currently input 4-bit data A 3 A 2 A 1 A 0 is not determined, for example, when the currently input 4-bit data A 3 A 2 A 1 A 0 has the first code state value corresponding to groups Esc, S 3 and S 5 -S 10 , controller 23 stores the first code state value and generates the next sign signal NEXT SIGN. In this case, since the specific group has not been determined, the CL and SEL are not generated. Also, the 4-bit data input from circular queue memory 22 is not supplied to combinational logic portion 25. In the above description, the operation of the controller 23 is not described with respect to the other groups which are determined by the first code state value. However, a person skilled in the art will understand well the operation of controller 23 with respect to the other groups on the basis of the above description. I/O controller 24 determines values of the WP and RP on the basis of the EOB, ESC, NEXT_SIGN, SIGN_OUT, or CL supplied from controller 23. When the SIGN_OUT signal is applied together with the CL signal, I/O controller 24 adds the SIGN_OUT signal and the CL signal and determines a value of the RP. Thus, when sign bit "s" is contained in the currently input 4-bit data A 3 A 2 A 1 A 0 output from circular queue memory 22, the sign bit is excluded from the 4-bit data to be succeedingly output from circular queue memory 22. When the NEXT_SIGN signal is applied together with the CL signal, I/O controller 24 shifts a value of the RP by "4" and shifts a value of the WP by "4" as well. Thus, the positions of the reading and recording windows designated by the RP and WP are shifted to the following sections by one section respectively. For example, when the currently input 4-bit data A 3 A 2 A 1 A 0 in controller 23 has the first code state value of "0000" in group S 3 , 4-bit data to be succeedingly output from circular queue memory 22 becomes "1XXX." If the start position in the reading window is shifted to the following section, circular queue memory 22 generates the RQST signal and register 21 supplies the 4-bit data to circular queue memory 22 in response to the RQST signal. Circular queue memory 22 stores the input 4-bit data in the position designated by the recording window. When the 4-bit data in the reading window of which the position is newly designated by the RP is supplied to controller 23, controller 23 judges whether the 4-bit data A 3 A 2 A 1 A 0 applied from circular queue memory 22 belongs to which one of groups EOB, ESC, and S 1 -S 10 . When a specific group is not determined by the 4-bit data A 3 A 2 A 1 A 0 in the just previous group determination, controller 23 judges whether the newly applied 4-bit data belongs to which one of groups ESC, S 3 , and S 5 - 10 . If the newly applied 4-bit data is determined as one of groups ESC, S 3 , and S 5 -S 10 by the group determination, controller 23 generates the CL, SIGN_OUT, NEXT_SIGN or SEL on the basis of the determined group and the second code state value of Table 1 with respect to the group. Also, controller 23 outputs the 4-bit data input in advance of the 4-bit data used for the group determination to combinational logic portion 25. Determination of the specific group based on the 8-bit is the same as that using only 4-bit data except that the code states used for determination of the CL differ from each other. Accordingly, the detailed description thereof will be omitted. When the specific group is not determined by the 8-bit data, controller 23 determines a specific symbol on the basis of the 12-bit data. That is, controller 23 stores the first and second code state values which are determined on the basis of the previous 4-bit data or the 8-bit data and determines a corresponding group on the basis of the stored first and second code state values and the newly applied 4-bit data. The processes of determining the group based on the 12-bit input data can be understood well with reference to a case that the group is determined with only 4-bit data. In the above description, when the group is not determined on the basis of the currently input 4-bit data, controller 23 stores the corresponding first state value. Since the first and second code state values are identical to each other when the group is not determined as can be seen from Table 1, another embodiment in which the NEXT_SIGN signal is stored instead is possible. Combinational logic portion 25 which receives the 4-bit data A 3 A 2 A 1 A 0 output from circular queue memory 22 and the 4-bit data B 3 B 2 B 1 B 0 output from controller 23 is composed of eleven combination logic circuits 250 through 260 having input combinational logic states represented in the following Table 2. COMBINATIAL LOGIC INPUT COMBINATIAL STATES CLC 0 A 3 A 2 A 1 A 0 CLC 1 A 3 CLC 2 A 3 A 2 CLC 3 A 2 A 1 CLC 4 A 3 A 2 A 1 A 0 CLC 5 B 0 A 3 A 2 CLC 6 A 3 A 2 A 1 A 0 CLC 7 B 2 B 1 B 0 A 3 CLC 8 B 1 B 0 A 3 A 2 CLC 9 B 0 A 3 A 2 A 1 CLC 10 A 3 A 2 A 1 A 0 Combinational logic circuit 250 stores combinational logic CLC 0 in Table 2, and the other combinational logic circuits 251 through 260 also store the corresponding combinational logics CLC 1 through CLC 10 . The combinational logics CLC 0 through CLC 10 stored in combinational circuit 250 through 260 correspond to groups S 0 through S 10 , respectively. That is, combinational logic circuit 250 stores variable length codes belonging to group S 0 and [run, level] data corresponding to the variable length codes. The other combinational logic circuits 251 through 260 store variable length codes belonging to the corresponding groups and [run, level] data corresponding to the variable length codes, respectively. Actually, combinational logic circuits 250 through 260 do not store all bit values of the corresponding variable length codes and store only predetermined code identification bits existing in the front end of the sign bit "s" so that the variable length codes in the same group are identified with each other instead. For example, combinational logic circuit 251 stores part of the variable length codes belonging to group S 1 of Figure 3A, that is, "1" or "0". Combinational logic circuit 253 stores bit information "01," "00," "11" and "01". If the 4-bit data A 3 A 2 A 1 A 0 from circular queue memory 22 and the 4-bit data B 3 B 2 B 1 B 0 from controller 23 are applied to combinational logic portion 25, combinational logic circuits 250 through 260 combine the input bit data according to the corresponding input combinational states represented in Table 2. Here, the 4-bit data B 3 B 2 B 1 B 0 input from controller 23 is data output from circular queue memory 22, earlier than the 4-bit data A 3 A 2 A 1 A 0 which is currently input from circular queue memory 22. For example, combinational logic circuit 250 outputs [run, level] data which is determined by input data "A 3 A 2 A 1 A 0 ". If A 3 A 2 A 1 A 0 equals "011X," combinational logic circuit 250 outputs corresponding [run, level] data as [1, 1] as in Figure 3A. Combinational logic circuit 255 outputs [run, level] data determined by input data B 0 A 3 A 2 ." Thus, when B 0 A 3 A 2 equals "110," [run, level] data is output as [14, 1] as in Figure 3B. The [run, level] data determined by the respective combinational logic circuits 250 through 260 are output to multiplexer 26, multiplexer 26 outputs [run, level] data corresponding to select signal SEL applied from controller 23 among eleven pairs of the [run, level] data applied from the combination logic circuits. The [run, level] data output from multiplexer 26 is used for an inverse quantizer (now shown). As described above, the variable length decoding method and apparatus uses the ROM comprising a barrel shifter and a variable length decoding table, and has simpler hardware construction in comparison to an existing apparatus which decodes variable length coded data into a [run, level] symbol, thereby giving an effect of maintaining a required processing speed.

Claims: A variable length decoding apparatus comprising: memory means (22)for storing variable length coded bit data, shifting N-bit data which is previously output according to a control signal, produced from a control means (23), by a value of the control signal from the initial bit of the N-bit data and outputting new N-bit data from a newly initial bit formed due to the shift of the previous N-bit data, characterised in that ; the control means (23) is for comparing code state values for discriminating a plurality of groups with each other in correspondence to the plurality of the groups for discriminating variable length codes in a variable length code table with each other, with N-bit data which is currently input from said memory means, determining a group corresponding to the currently output N-bit data, and outputting a control signal for representing the number of bits of the bit data used for the determination of the group according to the determination result, a select signal for representing the determined group and N-bit data just preceding the current N-bit data, and in that the apparatus also includes; combination logic means (25) including a plurality of input combinations which individually correspond to the plurality of the groups, and of which the values are determined by current N-bit data output from said control means (23) and previous N-bit data output from said memory means (22), for generating a plurality of symbols individually corresponding to each group according to values of the individual input combinations; and a multiplexer (26) for receiving a plurality of the symbols generated by said logic combination means (25) and outputting symbols selected by a select signal. The variable length decoding apparatus according to claim 1, wherein said N-bit data length is determined by a pattern of the bit data possessed by variable length codes constituting the variable length code table. The variable length decoding apparatus according to claim 1 or 2, wherein said N-bit data is 4-bit data. The variable length decoding apparatus according to any of the preceding claims wherein said groups are identified with each other on the basis of the most significant bits having the identical values to each other. The variable length decoding apparatus according to any of the preceding claims wherein said variable length code table is a table for transformation coefficients obtained by a discrete cosine transform method. The variable length decoding apparatus according to any of the preceding claims wherein said memory means (22) comprises: a circular queue memory including a reading window having an N-bit data size, for outputting the N-bit data in the reading window region of which the position is designated by the reading pointer among the stored data to said control means and said combinational logic means; and an input and output controller (24) for altering a value of the reading pointer according to the control signal generated by said control means. The variable length decoding apparatus according to claim 6, wherein said circular queue memory further comprises a register (21) for storing the variable length coded data and outputs the N-bit data whenever a data request signal is applied thereto, and wherein said circular queue memory is divided into a plurality of sections each of which storage region has N-bit data size, generates said data request signal whenever the section designated by said reading pointer value is altered into another section, and stores the N-bit data supplied from said register (21) in response to said data request signal. The variable length decoding apparatus according to any of the preceding claims wherein said control means (23) generates the control signal comprising code length information representing the number of significant bits used for determining the group among the currently input N-bit data and first information representing whether a sign bit is contained in the currently input N-bit data, when the specific group corresponding to the currently input N-bit data is determined by the determination result. The variable length decoding apparatus according to claim 8, wherein said control signal represents the number of bits determined by said code length information and said first information. The variable length decoding apparatus according to any of the preceding claims , wherein said control means (23) generates the control signal comprising second information representing that the specific group is not determined on the basis of the currently input N-bit data, when the specific group corresponding to the currently input N-bit data is not determined by the determination result. The variable length decoding apparatus according to claim 10, wherein said second information represents the number (N) of bits of the N-bit data. The variable length decoding apparatus according to any of the preceding claims, wherein said combinational logic means (25) comprises a plurality of combinational logic circuits (250-260) for outputting run data and run level corresponding to corresponding input combinational values on the basis of the minimum bit values which can identify the variable length codes belonging to the respective groups with each other. A variable length decoding method comprising the steps of: (a) establishing code state values for discriminating a plurality of groups with each other in correspondence to the plurality of the groups for discriminating variable length codes in a variable length code table with each other; (b) establishing a plurality of input combinations of which the values are determined by current N-bit data and previous N-bit data individually corresponding to the plurality of the groups, and a plurality of symbols individually corresponding to values of the individual input combinations; (c) storing variable length coded bit data and outputting N-bit data from a newly first bit by shifting the first bit of the previously output N-bit data by a value of a control signal; (d) determining a group corresponding to the current N-bit data on the basis of the comparison of the code state value established by step (a) with the current N-bit data output by step (c), and outputting a control signal for representing the number of bits of the bit data used for the determination of the group according to the determination result, a select signal for representing the determined group and N-bit data just preceding the current N-bit data; and (e) determining symbols according to the N-bit data output from step (c) and the N-bit data output from step (d) on the basis of the plurality of symbols corresponding to the values of the plurality of the input combinations and the individual input combinations. The variable length decoding method according to claim 13, wherein said step (a) comprises the step of dividing the variable length codes into the plurality of groups on the basis of the most significant bits having the identical values to each other. The variable length decoding method according to claim 13 or 14, wherein said N-bit data length is determined by a pattern of the bit data possessed by variable length codes constituting the variable length code table. The variable length decoding method according to claim 15, wherein said N-bit data is 4-bit data. The variable length decoding method according to any of claims 13 to 16 wherein said step (b) further comprises the step of storing the minimum bit values capable of identifying the variable length codes belonging to the respective groups with each other, and symbols corresponding to the respective minimum bit values. The variable length decoding method according to any of claims 13 to 17 wherein said step (d) comprises the step (d1) of generating the control signal comprising code length information representing the number of significant bits used for determining the group among the currently input N-bit data and first information representing whether a sign bit is contained in the currently input N-bit data, when the specific group corresponding to the currently input N-bit data is determined by the determination result. The variable length decoding method according to claim 18, wherein said step (d1) further comprises the step of determining a value of the control signal by adding the code length information value and the first information value. The variable length decoding method according to claim 13, wherein said step (d) comprises the step (d2) of generating the control signal comprising second information representing that the specific group is not determined on the basis of the currently input N-bit data, when the specific group corresponding to the currently input N-bit data is not determined by the determination result. The variable length decoding method according to claim 20, wherein said step (d2) further comprises the step of generating the second information having the number (N) of the bits of the N-bit data as the control signal. The variable length decoding method according to any of claims 13 to 21, wherein said step (e) comprises the steps of: (e1)generating a plurality of symbols individually corresponding to the respective groups according to the N-bit data output from said step (c) and the individual values of the plurality of the input combinations based on the N-bit data output from said step (d); and (e2) selecting one of the plurality of the symbols generated in step (e1) as a symbol of the variable length decoding operation.

Inventors: AHN WOOYOUN, CHO MYONG-RAE, AHN, WOOYOUN, CHO, MYONG-RAE
Applicants: SAMSUNG ELECTRONICS CO LTD, SAMSUNG ELECTRONICS CO., LTD.
Application year: 1995
Main classification: H03M7
IPC codes: H04N1, H04N7, H03M7, H03M13