Background technology
To variable X
1, X
2Carrying out two-dimentional united information entropy keeps variable-length encoding two-dimentional code table realizes by searching often.Work as variable X
1, X
2Span when very big, if adopt information combination { X
1, X
2Will cause two-dimentional code table very huge with code word is corresponding one by one, be unfavorable for storing and searching.Usual way is, for the bigger information combination { X of probability of occurrence
1, X
2Realize coding with tabling look-up, and for the little { X of probability of occurrence
1, X
2Combination, tabling look-up earlier obtains a control code word.This control code word only is used for mark and can not directly realizes by tabling look-up the coding of this incident, and X
1, X
2Information will by next-door neighbour this control code word back other code words carry.
For can not directly realizing { the X of coding by tabling look-up
1, X
2Combination, general adopted coding method is in control code word back, successively to X
1, X
2Encode separately.The weak point of this method is not utilize X
1, X
2Between correlation, control code word simultaneously as just mark, do not carry some about X
1Or X
2Information, exist redundancy, be unfavorable for the raising of compression efficiency.
A kind of new comentropy keeps coding method with X
1, X
2A part of information be attached to control and encode on the code word, remainder information is encoded according to coded message again, improves the compression efficiency that comentropy keeps coding like this.
Summary of the invention
The invention provides a kind of comentropy and keep coding/decoding method and device, be used for keeping coding method and the code stream that device is generated to be correctly decoded the new comentropy of background technology.
In order to achieve the above object, the technical solution used in the present invention is as follows:
1. if a comentropy keeps coding/decoding method, comprises code word of extracting from code stream and the signal combination { X in the code table
1=x
n, X
2=y
mCorresponding one by one, then decode { X
1=x
n, X
2=y
m; If the code word from code stream, extracted not with code table in signal combination { X
1=x
n, X
2=y
mCorresponding one by one, then this code word is first composite signal, and next code word following closely is second composite signal, and its decoding step is as follows:
1) from first composite signal, deducts specific control code word, thereby decode the first signal X
1Perhaps secondary signal X
2
2) according to decoded information, another signal of decoding from second composite signal.
Describedly from first composite signal, deduct specific control code word, thereby decode the first signal X
1Perhaps secondary signal X
2, comprising:
1) from first composite signal, deducts specific control code word;
2) first composite signal is deducted the signal of controlling the code word gained and obtain the first signal X through function f (x) map decoding
1Perhaps secondary signal X
2Value, obtain a control information of another not decoded signal simultaneously, wherein the independent variable of f (x) is the signal that first composite signal deducts control code word gained.
Described according to decoded information, another signal of decoding from second composite signal comprises:
1) decoded signal is shone upon through function u (x);
2) will be through the signal and the second composite signal addition of function u (x) mapping gained;
3) utilize signal and an and above-described control information another signal of decoding of addition gained.
2. a comentropy keeps the device of decoding, comprises that the code word of input looks into the table look-up device of two-dimensional variable length decoding table, if code word of extracting from code stream and the signal combination { X in the code table
1=x
n, X
2=y
mCorresponding one by one, then decode signal combination { X
1=x
n, X
2=y
m; If the code word of input not with the two-dimensional variable length decoding table in signal combination { X
1, X
2Corresponding one by one then with this enter code word and next code word input Deplexing apparatus following closely;
1) is used to separate the Deplexing apparatus of first composite signal and second composite signal;
2) deduct specific control code word from first composite signal, the first signal X is used to decode
1Perhaps secondary signal X
2Information extracting device;
3) according to decoded information, the information reverting device of another signal of decoding from second composite signal;
Deplexing apparatus links to each other with the information reverting device with information extracting device respectively, and the control code word connects the input of information extracting device, and information extracting device links to each other with the information reverting device.
Described information extracting device comprises:
1) substracting unit;
2) be used to realize function f (x) function, decoding X
1Or X
2, obtain the first information reduction apparatus of a control information of another not decoded signal simultaneously;
When the output of table look-up device was the control code word, first composite signal and control code word connect the input of substracting unit respectively; The output of substracting unit links to each other with first information reduction apparatus; The X of first information reduction apparatus output
1Or X
2, and control information links to each other with the information reverting device.
Described information reverting device comprises:
1) adder;
2) be used to realize the mapping device of function u (x) function;
3) be used to the X that decodes
2The second information reverting device;
The X of information extracting device decoding gained
1Or X
2Connect the input of mapping device; The output of mapping device and adder input link to each other; Second composite signal connects another input of adder; Adder links to each other with the second information reverting device; The control signal of information extracting device output links to each other with the second information reverting device, is used for control information transmission; Second information reverting device output X
2
The useful effect that the present invention has is: it has realized comentropy new in the background technology is kept the decoding of code stream that coding method generates fully.The present invention is mainly used in that digital signal is carried out two-dimentional united information entropy and keeps can also extending to the decoder of multivariate joint probability variable-length encoding code stream in the decoder of variable-length encoding code stream.The present invention is particularly useful for image or video compression decode.
Embodiment
View data and video data are that forming alternately appears in individual 0 and non-0 coefficient of n (n 〉=0) through the one dimension coefficient after the change quantization scanning in the compression coding and decoding process.The value of non-0 coefficient is level, and value is that 0 coefficient number is called distance of swimming run before this non-0 coefficient.To the decoding of the coefficient after the change quantization scanning often by searching { level, the run} combination of two-dimension code tabulation sign indicating number.The present invention is applicable to { level=x
n, run=y
mThe decoding that two-dimentional united information entropy keeps encoding code stream is carried out in combination, below is embodiments of the invention:
Embodiment 1
1. a comentropy keeps coding/decoding method, may further comprise the steps:
The code word input table look-up device that 1) will extract from code stream is looked into the two-dimensional variable length decoding table, if { the level=x in this code word and the code table
n, run=y
mCombination is corresponding one by one, then decode { level=x
n, run=y
mCombination; If the code word of input does not exist in the two-dimensional variable length decoding table and its signal combination { level=x one to one
n, run=y
m; the control code word that table look-up device output is specific; simultaneously this enter code word and next code word are following closely imported Deplexing apparatus, Deplexing apparatus is exported as the output of first composite signal and with next code word following closely this enter code word as second composite signal;
2) decoding step of first composite signal and second composite signal is as follows:
First composite signal and specific control code word input information extraction element, first composite signal deducts specific control code word in information extracting device, thus decoding obtains the value of run;
Second composite signal and decoded information input information reduction apparatus, according to decoded information, the value of decoding level from second composite signal.
2. the 1st saidly deducts specific control code word from first composite signal, thus the value of decoding run, and method is as follows:
1) first composite signal and specific control code word input substracting unit 701, first composite signal deducts specific control code word in substracting unit 701, and control code word specific in this example equals 59;
2) signal that first composite signal is deducted specific control code word gained is imported first information reduction apparatus 703, input obtains the value of run through function f (x) map decoding in first information reduction apparatus 703, obtain the symbolic information of level simultaneously, wherein the function of f (x) is with the lowest order after the input x binarization, as the output of the symbolic information of level, with the x value that obtains run that moves to right.
The 1st said according to decoded information, from second composite signal decoding level value, method is as follows:
1) run input mapping device 705 is through function u (y
m) mapping, wherein function u (y
m) function that realizes is for run=y
m, find | x
l|, { level=|x wherein
l|, run=y
mCan not realize decoding and { level=|x by tabling look-up
l|-1, run=y
m, can realize decoding, then u (y by tabling look-up
m)=| x
l|;
2) output of mapping device 705 and second composite signal are all imported adder 704, will be through function u (y
m) mapping gained signal | x
l| with the second composite signal addition, obtain the absolute value information of level;
3) symbolic information of the level that solves among the absolute value information of level and the 2nd is imported the second information reverting device 706, and decoding obtains the value of level.
Embodiment 2
1. a comentropy keeps coding/decoding method, may further comprise the steps:
The code word input table look-up device that 1) will extract from code stream is looked into the two-dimensional variable length decoding table, if { the level=x in this code word and the code table
n, run=y
mCombination is corresponding one by one, then decode { level=x
n, run=y
mCombination; If the code word of input does not exist in the two-dimensional variable length decoding table and its signal combination { level one to one, run}, the control code word that table look-up device output is specific, simultaneously this enter code word and next code word are following closely imported Deplexing apparatus, Deplexing apparatus is exported as the output of first composite signal and with next code word following closely this enter code word as second composite signal;
2) decoding step of first composite signal and second composite signal is as follows:
First composite signal and specific control code word input information extraction element, first composite signal deducts specific control code word in information extracting device, thus decoding obtains the value of run or level;
Second composite signal and decoded information input information reduction apparatus, according to decoded information, another signal of decoding from second composite signal.
2. the 1st saidly deducts specific control code word from first composite signal, thus the value of decoding run or level, and method is as follows:
1) first composite signal and specific control code word input substracting unit 701, first composite signal deducts specific control code word in substracting unit 701, and control code word specific in this example equals 59;
2) the signal x that first composite signal is deducted specific control code word gained imports first information reduction apparatus 703, in first information reduction apparatus 703, obtain the value of run or level through function f (x) map decoding, if the function of f (x) is x<64, then the decode value of run, run equals x, otherwise (being x 〉=64) is with the symbolic information of the lowest order after the value binarization of (x-64) as level, simultaneously (x-64) moved to right one and obtain the absolute value information of level, by the value of the absolute value information decoding level of the symbolic information of level and level, the control information of f (x) output is 0 again.
The 1st said according to decoded information, from second composite signal decoding another signal, method is as follows:
1) the signal run of decoding or level input mapping device 705 in the 2nd is mapped as 0 through function u (x);
2) output of mapping device 705 and second composite signal are all imported adder 704, will obtain signal z through the signal 0 and the second composite signal addition of function u (x) mapping gained;
3) signal z is imported the second information reverting device 706, if decoded in the 2nd is the value of run, the value of second information reverting device decoding level then, with the symbolic information of the lowest order after the z binarization as level, z being moved to right one simultaneously obtains the absolute value information of level, again by the value of the absolute value information decoding level of the symbolic information of level and level; If decoded in the 2nd is the value of level, the value of second information reverting device decoding decoding run then, run equals z.
The above-mentioned comentropy that is used to improve compression efficiency keeps the device of coding/decoding method, can use processor system, microcontroller, programmable logic device or the part or all of operation of hardware circuit realization.Above-mentioned certain operations can realize that other operations simultaneously can realize with hardware with software.
For convenience's sake, these operations are described to the functional unit of different interconnection or different software modules.But this is dispensable.In some applications, these functional units or module can be integrated in single logical device, program or the operation, and do not have obvious limit.In any situation, the feature of functional unit and software module or description can independently realize, or reinstate hardware or software realization with other operations one.