CN103327314A - Variable-length decoding device and method based on general format code tables - Google Patents

Variable-length decoding device and method based on general format code tables Download PDF

Info

Publication number
CN103327314A
CN103327314A CN2012100789738A CN201210078973A CN103327314A CN 103327314 A CN103327314 A CN 103327314A CN 2012100789738 A CN2012100789738 A CN 2012100789738A CN 201210078973 A CN201210078973 A CN 201210078973A CN 103327314 A CN103327314 A CN 103327314A
Authority
CN
China
Prior art keywords
code table
address
decoding
code
state variable
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
CN2012100789738A
Other languages
Chinese (zh)
Other versions
CN103327314B (en
Inventor
沙力
朱磊
兰军强
凌宇轩
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.)
Galaxycore Shanghai Ltd Corp
Original Assignee
SHANGHAI SUANXIN MICROELECTRONICS CO Ltd
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 SHANGHAI SUANXIN MICROELECTRONICS CO Ltd filed Critical SHANGHAI SUANXIN MICROELECTRONICS CO Ltd
Priority to CN201210078973.8A priority Critical patent/CN103327314B/en
Publication of CN103327314A publication Critical patent/CN103327314A/en
Application granted granted Critical
Publication of CN103327314B publication Critical patent/CN103327314B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention relates to a variable-length decoding device and method based on general format code tables. The device comprises an instruction decoder, an address calculator, a code table storer, a table item decoder, an address state register, a grammar state register and a table code assembler. The instruction decoder is used for outputting instruction decoding results. The address calculator can calculate a code table address according to the instruction decoding results or an address state variable returned by the address state register and can read data in input code stream. The code table storer is used for storing code table data and outputting table items in the code tables according to the code table address provided by the address calculator and data in the input code stream. The table item register can receive table items output by the code table storer and can decode the table items to confirm an address state variable and a grammar state variable. The address state register can receive the address state variable and can output the address state variable to the address calculator. The grammar state register can receive the grammar state variable and can output the grammar state variable after decoding finishes. The code table assembler can receive code table data and load the code table data into the code table storer. The code table data comprise a plurality of code tables and have the uniform general format to different video standards.

Description

Variable-length decoder and method based on the general format code table
Technical field
The present invention relates to a kind of variable-length decoder and method, special, the present invention relates to a kind of variable-length decoder based on the general format code table and method.
Background technology
At present, be widely used in the systems such as various Video processing, communication, control take series H.26X as all kinds of variable length video encoding and decoding standards of representative.The performance of the Video Decoder of video receiver has significant impact to systematic function.In existing Video Decoder ASIC (application-specific integrated circuit (ASIC)), for different video encoding and decoding standards, all adopt the code table design of devices at full hardware logic realization, namely provide code table for certain particular video frequency standard with hardware mode, search the decoded result of syntactic element corresponding to code word in the code stream by the method for the coupling of tabling look-up by hardware system, thereby realize the decode procedure of variable length video code word.High and the good advantage of performance is widely adopted this devices at full hardware mechanism because of its efficient of tabling look-up.
Yet there is following shortcoming in the code table design of this devices at full hardware logic:
After the video standard of-Xin occurs, need to add the new hardware logic for this new video standard, and the flow checking is come into operation again, has so just reduced efficiency of research and development, has increased R﹠D costs.
-because scale and the complexity of code table is quite high, directly caused the area of Video Decoder ASIC can be quite large.
The code table that-this hardware logic the is realized advantage that efficient is high, performance is good of tabling look-up only is embodied under the lower condition of code check, under the condition of high code check, main performance bottleneck is the bandwidth of code stream input, and therefore whole decoding performance can not mate the impact of performance of this design anticipation.
Summary of the invention
The present invention proposes a kind of variable-length decoder based on the general format code table and method, its purpose is to overcome the above-mentioned shortcoming of the code table of existing devices at full hardware logic realization, video encoding standard for different-format, define method and the state updating method of abstract unified general code table able to programme, thereby so that the coding structure under the different video standards can both utilize apparatus and method of the present invention to decode, replaced the design of devices at full hardware code table with this, thereby reach the raising efficiency of research and development, reduce the purpose of hardware area and cost.
According to an aspect of the present invention, proposed a kind of variable-length decoder based on the general format code table, this device comprises:
-command decoder, the receipt decoding instruction is also deciphered the output order decode results to decoding instruction;
-address calculator, the address state variable that returns according to described Instruction decoding result or address state register calculate the code table address and read data in the input code flow;
-code table memory is used for storage code table data, and the data in the code table address that described code table memory provides according to described address calculator and the input code flow that reads are exported the list item in the code table;
-list item decoder receives the described list item that the code table memory is exported, and described list item is deciphered, and determines address state variable and grammer state variable by the result who deciphers;
-address state register receives described address state variable and exports to address calculator;
-grammer status register receives described grammer state variable and export this grammer state variable when decoding finishes;
-code table assembler, reception code table data also are loaded in the code table memory, and described code table data comprise a plurality of code tables and have unified general format for different video standards.
Preferably, comprise a plurality of code tables in the described code table data, each code table has specific classification and the code table address of unique correspondence with it, and each code table comprises a plurality of list items, and each list item has the with it call number of unique correspondence.
Preferably, described a plurality of code table is divided into 0bit code table, 1bit code table ... the Nbit code table, and N 〉=0 and N are integer, comprise 2 in the Nbit code table NIndividual list item can be searched the Nbit code table by the Nbit data in the code stream, obtains the list item corresponding with the call number of this Nbit data representation.
Preferably, wherein each described list item comprises one or more in the following information that represents with unified form:
-to the decode value that obtains of decoding of tabling look-up of the Nbit in the code stream;
The sign bit of-decode value;
After-current the tabling look-up, should in code stream, delete what bits;
After-current the tabling look-up, whether code word finishes;
-address and the code table type of next time tabling look-up;
Described list item decoder is determined described address state variable and described grammer state variable according to above information, wherein said address state variable is used to indicate code table address and the code table type that the next one need to be searched, and described grammer state variable comprises the syntactic information of decoded result.
Preferably, wherein the code table in the described code table memory is determined in the code table address that provides of the code table address that provides according to the Instruction decoding result of address calculator or address state variable, and the code table type that the code table type that provides according to the Instruction decoding result or address state variable provide reads the Nbit data from input code flow, and determines list item in the described code table by these Nbit data.
Preferably, also comprising the information that needs what data of deletion in code stream before next time tabling look-up in the described grammer state variable, finish for the decoding of the current data that read and definite legal after, the data of corresponding number are deleted from input code flow.
Preferably, initial code table address and the initial code table type of each code word are provided by decoding instruction, when a codeword decoding is not finished, described address calculator is according to described address state variable look-up table item, when a codeword decoding was finished, described grammer status register was exported described grammer state variable and is again specified initial code table address and the initial code table type of next code word by decoding instruction.
Preferably, described decoding instruction comprises the number of codewords that will decode, after the decoding of finishing each code word, described address calculator automatically calculates start code table address and the code table type of next new code word according to the address state variable that obtains in the decode procedure last time, until the number of codewords of decoding reaches command request or the address state variable shows that quit work without Biao Kecha or decoding device next time.
Preferably, adopt paging mode to deposit described code table data, described code table assembler loads one page code table to the code table memory, if the page address of the page address of described Instruction decoding result indication or the indication of described address state variable and the page address of the code table data in the code table assembler are inconsistent, then by described code table assembler required code table page or leaf is loaded in the described code table memory.
According to a further aspect in the invention, proposed a kind of variable-length decoding method based on the general format code table, the method comprises:
1) receive the code table data by the code table assembler and be loaded in the code table memory, described code table data comprise a plurality of code tables and have unified general format for different video standards;
2) decipher the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction;
3) the address state variable that returns according to described Instruction decoding result or address state register by address calculator calculates the code table address and reads data in the input code flow;
4) list item of the code table in the code table memory is searched and exported to the data in the code table address that provides according to described address calculator and the input code flow that reads;
5) by the list item decoder described list item is deciphered, result by decoding determines address state variable and grammer state variable, by the address state register described address state variable is exported to address calculator, if the result of decoding indicates decoding to finish, then enter step 6), if the result of decoding indicates decoding not finish, then enter step 3);
6) export described grammer state variable by the grammer status register.
According to a further aspect in the invention, proposed a kind of variable-length decoding method based on the general format code table, the method comprises:
1) receive the code table data by the code table assembler and be loaded in the code table memory, described code table data comprise a plurality of code tables and have unified general format for different video standards;
2) decipher the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction, wherein decode results comprises initial code table address and the initial code table type of the current code word that will decode;
3) according to this initial code table address and initial code table type list item is searched and obtained to the code table memory by address calculator;
4) by the list item decoder this list item is deciphered, thereby obtain address state variable and grammer state variable, wherein comprise code table address and the code table type of tabling look-up in the address state variable next time, by the address state register address state variable is offered address calculator, if finished the decoding to a code word, then by grammer status register output grammer state variable, the grammer status register is resetted, and get back to step 2), if do not finish the decoding to a code word, then enter step 5);
5) according to the address state variable list item is searched and obtained to the code table memory by address calculator, and enter step 4).
According to a further aspect in the invention, proposed a kind of variable-length decoding method based on the general format code table, the method comprises:
1) receive the code table data by the code table assembler and be loaded in the code table memory, described code table data comprise a plurality of code tables and have unified general format for different video standards;
2) decipher the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction, wherein decode results comprises the number of the code word that will decode;
3) according to initial code table address and initial code table type list item is searched and obtained to the code table memory by address calculator;
4) by the list item decoder this list item is deciphered, thereby obtain address state variable and grammer state variable, wherein comprise code table address and the code table type of tabling look-up in the address state variable next time, by the address state register address state variable is offered address calculator, if finished the decoding to a code word, then by grammer status register output grammer state variable, the grammer status register is resetted, and enter step 5), if do not finish the decoding to a code word, then enter step 6);
5) if finished decoding to the code word of described number, then the method finishes, if do not finish the decoding to the code word of described number, then enters step 6);
6) according to the address state variable list item is searched and obtained to the code table memory by address calculator, then enter step 4).
Preferably, described initial code table address and initial code table type are provided by the address state variable in the described address state register or are provided or provided by other decoding instructions that are used to indicate this initial code table address and initial code table type by described decoding instruction.
According to a further aspect in the invention, proposed a kind of variable-length decoding method based on the general format code table, the method comprises:
1) receive one page code table data by the code table assembler and be loaded in the code table memory, described code table data comprise a plurality of code tables and have unified general format for different video standards;
2) decipher the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction;
3) the address state variable that returns according to described Instruction decoding result or address state register by address calculator calculates page address and the page or leaf bias internal address of code table, if the page address of the code table data in this page address and the code table assembler is consistent, then read the data in the input code flow and enter step 5), if the page address of the code table data in this page address and the code table assembler is inconsistent, then enter step 4);
4) load another page number table data corresponding with this page address by the code table assembler to the code table memory, and enter step 5);
5) search and export the list item of the code table in the code table memory according to the data in described page address and page or leaf bias internal address and the input code flow that reads;
6) by the list item decoder described list item is deciphered, result by decoding determines address state variable and grammer state variable, by the address state register described address state variable is exported to address calculator, if the result of decoding indicates decoding to finish, then enter step 7), if the result of decoding indicates decoding not finish, then enter step 3);
7) export described grammer state variable by the grammer status register, the method finishes.
According to apparatus and method of the present invention, for the video standard of different-format, only need the static new cover code table able to programme that generates, for different video formats, capable of dynamic is that decoding device is selected the in advance static code table that generates of assembling, thereby has greatly dwindled the area of ASIC hardware logic design.
According to apparatus and method of the present invention, in order to support the constantly video standard of the new form of appearance, need not to add new code table hardware algorithm logic, need not again flow checking, obviously improved the efficient of research and development checkings, greatly saved R﹠D costs.
Description of drawings
Fig. 1 is the block diagram according to an embodiment of the variable-length decoder based on the general format code table of the present invention;
Fig. 2 is the flow chart according to an embodiment of the variable-length decoding method based on the general format code table of the present invention;
Fig. 3 is the flow chart according to another embodiment of the variable-length decoding method based on the general format code table of the present invention;
Fig. 4 is the flow chart according to another embodiment of the variable-length decoding method based on the general format code table of the present invention;
Fig. 5 is the flow chart according to another embodiment of the variable-length decoding method based on the general format code table of the present invention.
Embodiment
The present invention propose based on the variable-length decoder of general format code table and method mainly based on following principle: the variable length encoding and decoding mechanism of video data is analyzed the image that will encode first usually at coding side, obtain syntactic element, again according to the code table based on the particular video frequency standard, by tabling look-up syntactic element is encoded to binary code stream, thereby obtains coding result; In decoding end, then based on the corresponding code table of coding side, by table look-up the coupling method be the value of syntactic element with the codeword decoding in the binary code stream, thereby obtain decoded result.The process of Code And Decode need to repeatedly search to finish to a large amount of code tables usually.The Variable Length Code result generally includes lead data and Back end data, and lead data is mainly used in the indication code table entry, and the start code table that should adopt when namely decoding, Back end data mainly comprise Variable Length Code result's value and symbol.
Based on above-mentioned principle, the present invention has utilized the Variable Length Code result's who obtains abstract rule under the different video standard, all convert the substandard code table of different video to device of the present invention discernible general format, thereby so that can both utilize apparatus and method of the present invention to decode for the coding result under the different video standards.
Fig. 1 is the block diagram according to an embodiment of the variable-length decoder based on the general format code table of the present invention, wherein should comprise based on variable-length decoder of general format code table:
-command decoder 101, the receipt decoding instruction is also deciphered the output order decode results to decoding instruction;
-address calculator 102, the address state variable that returns according to described Instruction decoding result or address state register 106 calculate the code table address and read data in the input code flow;
-code table memory 103 is used for storage code table data, and the data in the code table address that described code table memory 103 provides according to described address calculator and the input code flow that reads are exported the list item in the code table;
-list item decoder 105 receives the described list item that code table memory 103 is exported, and described list item is deciphered, and determines address state variable and grammer state variable by the result who deciphers;
-address state register 106 receives described address state variable and exports to address calculator 102;
-grammer status register 107 receives described grammer state variable and export this grammer state variable when decoding finishes;
-code table assembler 104, reception code table data also are loaded in the code table memory 103, and described code table data comprise a plurality of code tables and have unified general format for different video standards.
In a preferred embodiment, code table assembler 104 receives and is loaded into the code table data in the code table memory 103, for the static cover code table data that generate of specific video standard, in application, can be for the corresponding code table data of the static generation of different video standards, these code table data for different video standards have unified general format, and corresponding with the code table data of video standard self.In fact, just as mentioned before, because the code table of Variable Length Code has certain abstract rule, therefore the code table of different video standards all can be converted to the code table data with general format among the present invention.Comprise a plurality of code tables in the described code table data, each code table has specific classification and the code table address of unique correspondence with it, and each code table comprises a plurality of list items, and each list item has the with it call number of unique correspondence.
Particularly, in a preferred embodiment, the code table in the code table data according to the present invention can be divided into polytype, be respectively 0bit code table, 1bit code table ... the Nbit code table, N 〉=0 and N are integer, comprise 2 in the 0bit code table 0Individual list item comprises 2 in the 1bit code table 1Individual list item by that analogy, comprises 2 in the Nbit code table NIndividual list item.In the Nbit code table 2 NIn the individual list item each has the with it call number of unique correspondence, can search the Nbit code table by the Nbit data in the code stream, obtains the list item corresponding with the call number of this Nbit data representation.Each list item comprises the common information that the list item in the code table of various video standards has, and for example, each list item can comprise following five kinds of information, can be represented by five variablees respectively:
Variable v: the bit of the N in the code stream is carried out the decode value that the table-look-up type decoding obtains;
Variable s: the sign bit of decode value;
Variable b: after current the tabling look-up, should in code stream, delete what bits;
Variable eocw: after current the tabling look-up, whether code word finishes;
Variable next: the address of next time tabling look-up and code table type;
However, the present invention is not limited to above-mentioned five kinds of information or five variablees, also can comprise other information in the list item of code table of the variable-length decoding under the various video standards, or comprises in above five kinds of information one or more.As long as can be with unified form, the information of expressing in the list item of the variable-length decoding under the various video standards gets final product.
By list item decoder 105, can draw address state variable and grammer state variable according to the above-mentioned five kinds of information that comprise in the list item.
Wherein the address state variable is used to indicate code table address and the code table type that the next one need to be searched, and in one embodiment, the address state variable can be identical with variable next;
The grammer state variable comprises the syntactic information of decoded result, and the grammer state variable can comprise:
Variable sign: the symbol of decoded result can obtain according to variable s;
Variable v_1: decode value, can obtain according to variable v, variable v_1 also can be a plurality of variablees, is used for the respectively specific bit of storage of variables v, variable v_1 can also utilize the value of part position storage of variables b;
Variable flag: indicate the address of next time tabling look-up to overflow, can obtain according to variable next, for example when variable next indication can be looked into without table next time, more new variables flag was to indicate this state.
However, the present invention is not limited to address state variable and the grammer state variable of above definition, can also be other address state variable and grammer state variable, as long as they can represent respectively code table address and the code table type of tabling look-up next time, and the information of decoded result gets final product.
Grammer status register 107 is before the decoding of any one brand-new code word of beginning all be reset (reset), and after each table lookup operation, judging on this basis into legal operation of tabling look-up, according to the information in the list item that obtains address state variable and grammer state variable are upgraded, until the information in the list item (such as variable eocw) pointer finishes the decoding of current code word, then return the grammer state variable by the grammer status register to the miscellaneous part of decoding device outside.
In another preferred embodiment, also comprise the information (for example information of variable b) that needs what data of deletion in code stream before next time tabling look-up in the grammer state variable of grammer status register 107, that is to say, in the process to the current decoding data that reads, described data still are retained in the code stream, until for the decoding of the current data that read finish and determine legal after, just it is deleted from code stream.In one embodiment, grammer status register 107 returns the information of variable b the peripheral logical unit of decoding device at every turn after tabling look-up, thereby deletes the data of corresponding number after current tabling look-up in code stream;
Decoding device of the present invention can be worked under three kinds of patterns, is respectively single-step mode, automatic mode and paging mode.
Single-step mode
In a preferred embodiment, decoding device of the present invention with single code word as the operand of complete decoding once, initial code table address and the initial code table type of each code word are provided by decoding instruction, when a codeword decoding is finished, output grammer state variable is also specified initial code table address and the initial code table type of next code word again by decoding instruction, the initial code table address of each code word and initial code table type can be before decode operation by software or firmware static state setting in advance.
Referring to Fig. 1, in the preferred embodiment, before decoding device was started working, code table assembler 104 will be loaded in the code table memory 103 for a cover code table of particular video frequency standard.When decoding device was started working, the 101 receipt decoding instructions of address instruction decoder were also deciphered it, thereby obtain initial code table address and initial code table type.When initial code table type has been indicated the first paragraph decoding data in the input code flow, need to search which kind of code table of 0bit code table in the Nbit code table, also just determined the length of the first end data that need read from input code flow, address calculator 102 needs to read corresponding 0bit from code stream, the data of 1bit...... or Nbit according to this initial code table type.In code table memory 103, can obtain the code table that will search according to the initial code table address, according to the 0bit that reads, 1bit...... or Nbit data, can find in this code table with the unique corresponding list item of these data.After obtaining this list item, 105 pairs of these list items of list item decoder are deciphered, thereby obtain address above mentioned state variable and grammer state variable, address state register 106 receiver address state variables, this address of next time tabling look-up and code table type (for example being stored among the variable next) that obtains of tabling look-up is offered address calculator 102, the current grammer state variable that arrives of tabling look-up of grammer status register storage.Address calculator 102 is read corresponding 0bit according to the code table type of tabling look-up next time from input code flow, 1bit...... or the data of Nbit, and in code table memory 103, determine corresponding code table according to the code table address of tabling look-up next time, thereby find corresponding list item in this code table based on above-mentioned data and code table address.After this, the parts such as list item decoder 105, address state register 106, grammer status register 107 repeat aforesaid operations for this list item, in code stream, constantly take out the data decoding of tabling look-up, until the decode operation (for example by variable eocw indication) of a code word has been finished in the result of list item decoder 105 indication, then return the grammer state variable that finally obtains by grammer status register 107 to the miscellaneous part of decoding device outside, and grammer status register 107 is resetted.When the decoding of the next code word of beginning, again draw initial code table address and the initial code table type of next code word and repeat aforesaid operations according to new decoding instruction by command decoder 101.If do not receive new decoding instruction, said process stops naturally.
Automatic mode
In another preferred embodiment of the present invention, as the object of the operation of complete decoding once, this pattern can be described as automatic mode to decoding device of the present invention with the code word of specifying number.Under this automatic mode, decoding instruction comprises the number of codewords that will decode, and this number can be limited, also can be unlimited, namely until decoding device quit work.Under this automatic mode, after the decoding of finishing each code word, address calculator 102 no longer receives new decoding instruction, but automatically calculate start code table address and the code table type of next new code word according to the address state variable (for example variable next) that obtains in the decode procedure last time, until the number of codewords of decoding reaches command request or the demonstration of address state variable quits work without Biao Kecha or decoding device next time, finish the automatic decoding process.Preferably, initial code table address when automatic mode starts and initial code table type can provide by different modes according to using needs, for example can be provided by the address state variable in the address state register or be provided or provided by other the decoding instruction that is used to indicate this initial code table address and initial code table type by decoding instruction.
Paging mode
In another preferred embodiment of the present invention, in order to enlarge the addressing range of code table, adopt paging mode to deposit the code table data, therefore in decoding instruction, page address and the page or leaf bias internal address thereof that can comprise initial code table, and initial code table type, thereby by page address and the page or leaf offset address thereof of initial code table initial code table is carried out addressing.
When the scale of code table data corresponding to video standard hour, only need before the decoding beginning, to load one page code tables by code table assembler 104 to code table memory 103, can finish decoding.When being on a grand scale of code table data corresponding to video standard, for improving the decoding speed of decoding device, can load one page code table to code table memory 103 by code table assembler 104, in decode procedure, the situation of overflowing if there is the code table decoding address, if it is inconsistent that for example described Instruction decoding result or described address state variable are indicated the page address of table look-up corresponding code table page address and current code table page or leaf next time, need to switch to addressing in other code table pages or leaves, then by code table assembler 104 required code table page or leaf is loaded in the code table memory 103, carries out subsequent decoding.In a preferred embodiment, can pass through list item information, for example variable next and variable eocw indicate needs to switch the code table page or leaf, for example work as variable next indication without Biao Kecha, and when variable eocw indication does not finish the decoding of a code word, the page address that means next time table look-up corresponding code table page address and current code table page or leaf is inconsistent, in this state, can utilize address state variable or grammer state variable to preserve page address and the page or leaf bias internal address of the code table page or leaf that will switch to, and export to external control component, external control component control code table assembler 104 loads the code table page or leaf that will switch according to above-mentioned page address to code table memory 103, external control component is also controlled decoding instruction and is provided page address and page or leaf bias internal address to address decoder, thereby so that decoding device of the present invention continuation is searched decoding in new code table page or leaf.
Fig. 2 is the flow chart according to an embodiment of the variable-length decoding method based on the general format code table of the present invention, wherein should comprise based on variable-length decoding method of general format code table:
S201 receives the code table data and is loaded in the code table memory by the code table assembler, and described code table data comprise a plurality of code tables and have unified general format for different video standards;
S202 deciphers the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction;
S203, the address state variable that returns according to described Instruction decoding result or address state register by address calculator calculate the code table address and read data in the input code flow;
S204, the list item of the code table in the code table memory is searched and exported to the data in the code table address that provides according to described address calculator and the input code flow that reads;
S205 deciphers described list item by the list item decoder, determines address state variable and grammer state variable by the result who deciphers, and by the address state register described address state variable is exported to address calculator;
S206 judges whether decoding is finished, if the result of decoding indicates decoding to finish, then enters step S207, if the result of decoding indicates decoding not finish, then enters step S203;
S207 exports described grammer state variable by the grammer status register.
Fig. 3 is the flow chart according to another embodiment of the variable-length decoding method based on the general format code table of the present invention, method of the present invention operates with single-step mode in this embodiment, namely take single code word as the operand of complete decoding once, in this embodiment, the method mainly may further comprise the steps:
S301 receives the code table data and is loaded in the code table memory by the code table assembler, and described code table data comprise a plurality of code tables and have unified general format for different video standards;
S302 deciphers the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction, and wherein decode results comprises initial code table address and the initial code table type of the current code word that will decode;
S303 searches and obtains list item according to this initial code table address and initial code table type to the code table memory by address calculator;
S304, by the list item decoder this list item is deciphered, thereby obtain address state variable and grammer state variable, wherein comprise code table address and the code table type of tabling look-up in the address state variable next time, by the address state register address state variable is offered address calculator;
S305 judges whether to have finished the decoding to a code word, if do not finish the decoding to a code word, then enters step S306; If finished the decoding to a code word, then enter step S307;
S306 searches and obtains list item according to the address state variable to the code table memory by address calculator, and enters step S304;
S307 by grammer status register output grammer state variable, resets the grammer status register, and gets back to step S302.
Fig. 4 is the flow chart according to another embodiment of the variable-length decoding method based on the general format code table of the present invention, method of the present invention operates with automatic mode in this embodiment, namely, with the code word of specifying number as the object of the once operation of complete decoding under this automatic mode, decoding instruction comprises the number of codewords that will decode, this number can be limited, also can be unlimited, namely until decoding device quit work.In this embodiment, the method may further comprise the steps:
S401 receives the code table data and is loaded in the code table memory by the code table assembler, and described code table data comprise a plurality of code tables and have unified general format for different video standards;
S402 deciphers the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction, and wherein decode results comprises the number of the code word that will decode;
S403 searches and obtains list item according to initial code table address and initial code table type to the code table memory by address calculator;
S404, by the list item decoder this list item is deciphered, thereby obtain address state variable and grammer state variable, wherein comprise code table address and the code table type of tabling look-up in the address state variable next time, by the address state register address state variable is offered address calculator;
S405 judges whether to finish the decoding to a code word, if do not finish the decoding to a code word, then enters step S406; If finished the decoding to a code word, then enter step S407;
S406 searches and obtains list item according to the address state variable to the code table memory by address calculator, then enters step S404;
S407 by grammer status register output grammer state variable, resets the grammer status register, and enters step S408;
S408 judges whether to have finished the decoding to the code word of described number, if do not finish the decoding to the code word of described number, then enters step S406; If finished the decoding to the code word of described number, then the method finishes.
Preferably, described initial code table address and initial code table type can provide by different modes according to using needs, for example can be provided by the address state variable in the address state register or be provided or provided by other the decoding instruction that is used to indicate this initial code table address and initial code table type by decoding instruction.
Fig. 5 is the flow chart according to another embodiment of the variable-length decoding method based on the general format code table of the present invention, in this embodiment, in order to enlarge the addressing range of code table, adopt paging mode to deposit the code table data, therefore in decoding instruction, initial page address and the initial page bias internal address thereof that can comprise initial code table, and initial code table type, thus by initial page address and the initial page offset address thereof of initial code table initial code table is carried out addressing.When the scale of code table data corresponding to video standard hour, only need before the decoding beginning, to load one page code tables by code table assembler 104 to code table memory 103, can finish decoding, this moment, coding/decoding method was similar to Fig. 2, Fig. 3 or method shown in Figure 4.
In a preferred embodiment, when being on a grand scale of code table data corresponding to video standard, for improving the decoding speed of decoding device, can load one page code table to code table memory 103 by code table assembler 104, in decode procedure, if there is the situation that the code table decoding address overflows, need to switch to addressing in other code table pages or leaves, then by code table assembler 104 required code table page or leaf is loaded in the code table memory 103, carries out subsequent decoding.In this embodiment shown in Figure 5, be to describe the paging storage mode as the basis take embodiment shown in Figure 2, in fact, the paging storage mode also can be applicable to Fig. 3 and embodiment shown in Figure 4, and wherein the method comprises:
S501 receives one page code table data and is loaded in the code table memory by the code table assembler, and described code table data comprise a plurality of code tables and have unified general format for different video standards;
S502 deciphers the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction;
S503, page address and a page or leaf bias internal address that the address state variable that returns according to described Instruction decoding result or address state register by address calculator calculates code table;
S504 judges whether the page address of the code table data in this page address and the code table assembler is consistent; If the page address of the code table data in this page address and the code table assembler is inconsistent, then enter step S505; If the page address of the code table data in this page address and the code table assembler is consistent, enter step S506;
S505 loads another page number table data corresponding with this page address by the code table assembler to the code table memory, and enters step S507;
S506, the data in the input code flow that reads, and enter step S507;
S507 searches and exports the list item of the code table in the code table memory according to the data in described page address and page or leaf bias internal address and the input code flow that reads;
S508 deciphers described list item by the list item decoder, determines address state variable and grammer state variable by the result who deciphers, and by the address state register described address state variable is exported to address calculator;
S509 judges whether decoding is finished; If the result of decoding indicates decoding to finish, then enter step S510, if the result of decoding indicates decoding not finish, then enter step S503;
S510 exports described grammer state variable by the grammer status register, and the method finishes.
Above-described embodiment is for illustrative principle of the present invention and effect thereof, but not is used for restriction the present invention.Any those skilled in the art all can under spirit of the present invention and category, make amendment to above-described embodiment.So protection scope of the present invention, should be listed such as claims of the present invention.

Claims (14)

1. variable-length decoder based on the general format code table, this device comprises:
-command decoder, the receipt decoding instruction is also deciphered the output order decode results to decoding instruction;
-address calculator, the address state variable that returns according to described Instruction decoding result or address state register calculate the code table address and read data in the input code flow;
-code table memory is used for storage code table data, and the data in the code table address that described code table memory provides according to described address calculator and the input code flow that reads are exported the list item in the code table;
-list item decoder receives the described list item that the code table memory is exported, and described list item is deciphered, and determines address state variable and grammer state variable by the result who deciphers;
-address state register receives described address state variable and exports to address calculator;
-grammer status register receives described grammer state variable and export this grammer state variable when decoding finishes;
-code table assembler, reception code table data also are loaded in the code table memory, and described code table data comprise a plurality of code tables and have unified general format for different video standards.
2. the variable-length decoder based on the general format code table according to claim 1, wherein, each described code table has specific classification and the code table address of unique correspondence with it, and each code table comprises a plurality of list items, and each list item has the with it call number of unique correspondence.
3. the variable-length decoder based on the general format code table according to claim 2, described a plurality of code tables are divided into 0bit code table, 1bit code table ... the Nbit code table, and N 〉=0 and N are integer, comprise 2 in the Nbit code table NIndividual list item can be searched the Nbit code table by the Nbit data in the code stream, obtains the list item corresponding with the call number of this Nbit data representation.
4. the variable-length decoder based on the general format code table according to claim 2, wherein each described list item comprises one or more in the following information that represents with unified form:
-to the decode value that obtains of decoding of tabling look-up of the Nbit in the code stream;
The sign bit of-decode value;
After-current the tabling look-up, should in code stream, delete what bits;
After-current the tabling look-up, whether code word finishes;
-address and the code table type of next time tabling look-up;
Described list item decoder is determined described address state variable and described grammer state variable according to above information, wherein said address state variable is used to indicate code table address and the code table type that the next one need to be searched, and described grammer state variable comprises the syntactic information of decoded result.
5. the variable-length decoder based on the general format code table according to claim 4, wherein the code table in the described code table memory is determined in the code table address that provides of the code table address that provides according to the Instruction decoding result of address calculator or address state variable, and the code table type that the code table type that provides according to the Instruction decoding result or address state variable provide reads the Nbit data from input code flow, and determines list item in the described code table by these Nbit data.
6. the variable-length decoder based on the general format code table according to claim 4, also comprise the information that needs what data of deletion in code stream before next time tabling look-up in the described grammer state variable, finish for the decoding of the current data that read and determine legal after, the data of corresponding number are deleted from input code flow.
7. the variable-length decoder based on the general format code table according to claim 1, initial code table address and the initial code table type of each code word are provided by decoding instruction, when a codeword decoding is not finished, described address calculator is according to described address state variable look-up table item, when a codeword decoding was finished, described grammer status register was exported described grammer state variable and is again specified initial code table address and the initial code table type of next code word by decoding instruction.
8. the variable-length decoder based on the general format code table according to claim 1, described decoding instruction comprises the number of codewords that will decode, after the decoding of finishing each code word, described address calculator automatically calculates start code table address and the code table type of next new code word according to the address state variable that obtains in the decode procedure last time, until the number of codewords of decoding reaches command request or the address state variable shows that quit work without Biao Kecha or decoding device next time.
9. the variable-length decoder based on the general format code table according to claim 1, adopt paging mode to deposit described code table data, described code table assembler loads one page code table to the code table memory, if the page address of the page address of described Instruction decoding result indication or the indication of described address state variable and the page address of the code table data in the code table assembler are inconsistent, then by described code table assembler required code table page or leaf is loaded in the described code table memory.
10. variable-length decoding method based on the general format code table, the method comprises:
1) receive the code table data by the code table assembler and be loaded in the code table memory, described code table data comprise a plurality of code tables and have unified general format for different video standards;
2) decipher the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction;
3) the address state variable that returns according to described Instruction decoding result or address state register by address calculator calculates the code table address and reads data in the input code flow;
4) list item of the code table in the code table memory is searched and exported to the data in the code table address that provides according to described address calculator and the input code flow that reads;
5) by the list item decoder described list item is deciphered, result by decoding determines address state variable and grammer state variable, by the address state register described address state variable is exported to address calculator, if the result of decoding indicates decoding to finish, then enter step 6), if the result of decoding indicates decoding not finish, then enter step 3);
6) export described grammer state variable by the grammer status register.
11. the variable-length decoding method based on the general format code table, the method comprises:
1) receive the code table data by the code table assembler and be loaded in the code table memory, described code table data comprise a plurality of code tables and have unified general format for different video standards;
2) decipher the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction, wherein decode results comprises initial code table address and the initial code table type of the current code word that will decode;
3) according to this initial code table address and initial code table type list item is searched and obtained to the code table memory by address calculator;
4) by the list item decoder this list item is deciphered, thereby obtain address state variable and grammer state variable, wherein comprise code table address and the code table type of tabling look-up in the address state variable next time, by the address state register address state variable is offered address calculator, if finished the decoding to a code word, then by grammer status register output grammer state variable, the grammer status register is resetted, and get back to step 2), if do not finish the decoding to a code word, then enter step 5);
5) according to the address state variable list item is searched and obtained to the code table memory by address calculator, and enter step 4).
12. the variable-length decoding method based on the general format code table, the method comprises:
1) receive the code table data by the code table assembler and be loaded in the code table memory, described code table data comprise a plurality of code tables and have unified general format for different video standards;
2) decipher the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction, wherein decode results comprises the number of the code word that will decode;
3) according to initial code table address and initial code table type list item is searched and obtained to the code table memory by address calculator;
4) by the list item decoder this list item is deciphered, thereby obtain address state variable and grammer state variable, wherein comprise code table address and the code table type of tabling look-up in the address state variable next time, by the address state register address state variable is offered address calculator, if finished the decoding to a code word, then by grammer status register output grammer state variable, the grammer status register is resetted, and enter step 5), if do not finish the decoding to a code word, then enter step 6);
5) if finished decoding to the code word of described number, then the method finishes, if do not finish the decoding to the code word of described number, then enters step 6);
6) according to the address state variable list item is searched and obtained to the code table memory by address calculator, then enter step 4).
13. the variable-length decoding method based on the general format code table according to claim 12, wherein said initial code table address and initial code table type are provided by the address state variable in the described address state register or are provided or provided by other decoding instructions that are used to indicate this initial code table address and initial code table type by described decoding instruction.
14. the variable-length decoding method based on the general format code table, the method comprises:
1) receive one page code table data by the code table assembler and be loaded in the code table memory, described code table data comprise a plurality of code tables and have unified general format for different video standards;
2) decipher the output order decode results by the instruction of command decoder receipt decoding and to decoding instruction;
3) the address state variable that returns according to described Instruction decoding result or address state register by address calculator calculates page address and the page or leaf bias internal address of code table, if the page address of the code table data in this page address and the code table assembler is consistent, then read the data in the input code flow and enter step 5), if the page address of the code table data in this page address and the code table assembler is inconsistent, then enter step 4);
4) load another page number table data corresponding with this page address by the code table assembler to the code table memory, and enter step 5);
5) search and export the list item of the code table in the code table memory according to the data in described page address and page or leaf bias internal address and the input code flow that reads;
6) by the list item decoder described list item is deciphered, result by decoding determines address state variable and grammer state variable, by the address state register described address state variable is exported to address calculator, if the result of decoding indicates decoding to finish, then enter step 7), if the result of decoding indicates decoding not finish, then enter step 3);
7) export described grammer state variable by the grammer status register, the method finishes.
CN201210078973.8A 2012-03-22 2012-03-22 Variable-length decoder and method based on general format code table Active CN103327314B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210078973.8A CN103327314B (en) 2012-03-22 2012-03-22 Variable-length decoder and method based on general format code table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210078973.8A CN103327314B (en) 2012-03-22 2012-03-22 Variable-length decoder and method based on general format code table

Publications (2)

Publication Number Publication Date
CN103327314A true CN103327314A (en) 2013-09-25
CN103327314B CN103327314B (en) 2016-06-29

Family

ID=49195815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210078973.8A Active CN103327314B (en) 2012-03-22 2012-03-22 Variable-length decoder and method based on general format code table

Country Status (1)

Country Link
CN (1) CN103327314B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030184457A1 (en) * 1999-12-14 2003-10-02 Vivian Hsiun Programmable variable-length decoder
CN1496127A (en) * 2002-08-03 2004-05-12 三星电子株式会社 Device for decoding and variable length coding and method
US20040233076A1 (en) * 2001-02-20 2004-11-25 Minhua Zhou Variable length decoding system and method
CN1791223A (en) * 2005-12-15 2006-06-21 清华大学 Self-adaptive two-dimensional variable length decoding method and device based on context
CN101309423A (en) * 2008-06-26 2008-11-19 四川虹微技术有限公司 Method for decoding number of non-zero coefficient and number tailing coefficient

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030184457A1 (en) * 1999-12-14 2003-10-02 Vivian Hsiun Programmable variable-length decoder
US20040233076A1 (en) * 2001-02-20 2004-11-25 Minhua Zhou Variable length decoding system and method
CN1496127A (en) * 2002-08-03 2004-05-12 三星电子株式会社 Device for decoding and variable length coding and method
CN1791223A (en) * 2005-12-15 2006-06-21 清华大学 Self-adaptive two-dimensional variable length decoding method and device based on context
CN101309423A (en) * 2008-06-26 2008-11-19 四川虹微技术有限公司 Method for decoding number of non-zero coefficient and number tailing coefficient

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
BAI-JUE SHEIEH: "A new approach of group-based VLC codec system with full table programmability", 《IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS FOR VIDEO TECHNOLOGY》 *

Also Published As

Publication number Publication date
CN103327314B (en) 2016-06-29

Similar Documents

Publication Publication Date Title
US10116325B2 (en) Data compression/decompression device
US20180107725A1 (en) Data Storage Method and Apparatus, and Data Read Method and Apparatus
CN104657362A (en) Method and device for storing and querying data
US9292549B2 (en) Method and system for index serialization
US8542137B2 (en) Decoding encoded data
CN101551820B (en) Generation method and apparatus for index database of points of interest attribute
CN202602827U (en) Variable-length decoding device based on universal format code table
CN114567331A (en) LZ 77-based compression method, device and medium thereof
US20140258247A1 (en) Electronic apparatus for data access and data access method therefor
CN106354746B (en) Search method and search device
CN110554878A (en) data conversion method, game data processing method and device and server
CN107943727B (en) High-efficient DMA controller
CN102193787B (en) Methods for serialization and de-serialization, device and system
CN113064556A (en) BIOS data storage method, device, equipment and storage medium
US6205255B1 (en) Method and apparatus for run-length encoding of multi-colored images
KR20220054651A (en) multi-symbol decoder
JP4821287B2 (en) Structured document encoding method, encoding apparatus, encoding program, decoding apparatus, and encoded structured document data structure
CN111857868A (en) Security data reading and writing method, device, equipment and computer readable storage medium
CN103327314A (en) Variable-length decoding device and method based on general format code tables
CN113222807B (en) Data memory, data storage method, data reading method, chip and computer equipment
CN111190896A (en) Data processing method, data processing device, storage medium and computer equipment
CN102695096A (en) Method and device for acquiring output image-text language of bit stream and set top box
CN111726626B (en) Integrated circuit and probability table storage method for video decoding
CN114070470A (en) Encoding and decoding method and device
CN109840080B (en) Character attribute comparison method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220727

Address after: 201203 11F, No. 2 Building, 560 Lane, Midsummer Road, Pudong New Area, Shanghai

Patentee after: GALAXYCORE SHANGHAI Ltd.,Corp.

Address before: Room 1004-1005, building 2, No. 560, shengxia Road, Pudong New Area, Shanghai 201203

Patentee before: SHANGHAI SUANXIN MICROELECTRONICS Co.,Ltd.