Comentropy keeps coding method and device
Technical field
The present invention relates to electric numerical data processing technology field, particularly relate to a kind of comentropy and keep coding method and device.
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 two-dimensional signal 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 symbols 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.This code device as shown in Figure 1.Signal X
1, X
2Import table look-up device, export the code word of the gained of tabling look-up.When the output code word was the control code word, control signal was made switch downwards, otherwise control signal is upwards made switch.When switch is beaten, X is described downwards
1, X
2Can not directly realize coding by tabling look-up.At this moment, will be by TDMD time division multiplex device successively transmission control code word, X
1, X
2Three signals.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.This needing with 3 part symbols when incident can not directly realize coding by tabling look-up just to cause---control code word, X
1, X
2---finish X
1, X
2Coding, compression efficiency is not high.
Summary of the invention
The purpose of this invention is to provide the higher a kind of comentropy of Information Compression efficient and keep coding method and device.To variable X
1, X
2That carries out occurring in the two-dimentional joint variable-length cataloged procedure can not directly realize the small probability signal { X of coding by tabling look-up
1=x
n, X
2=y
mCoding method and device improvement has been proposed.
In order to achieve the above object, the technical solution used in the present invention is as follows:
1. a comentropy keeps coding method, comprises input signal { X
1=x
n, X
2=y
mLook into the two-dimensional variable length coding schedule, if exist in the code table and input signal code word one to one, then use this codeword coding input signal, if do not exist and input signal code word one to one, then with a unified control code sign knowledge input signal; If input signal { X
1=x
n, X
2=y
mBe Controlled code word sign, then coding step is as follows:
1) with X
1Information and X through function f (x) mapping gained
2Information through function g (x) mapping gained is combined into first composite signal with the control code word;
2) with X
1Information and X through function u (x) mapping gained
2Information through function v (x) mapping gained is combined into second composite signal;
3) with first composite signal, second composite signal serial output.
With X
1Information and X through function f (x) mapping gained
2Information through function g (x) mapping gained is combined into first composite signal with the control code word, and method is as follows:
First composite signal=control code word+f (X
1)+g (X
2),
Wherein, f (x) is that independent variable is X
1Function, g (x) is that independent variable is X
2Function.
Said with X
1Information and X through function u (x) mapping gained
2Information through function v (x) mapping gained is combined into second composite signal, and method is as follows:
Second composite signal=v (X
2)-u (X
1),
Wherein, u (x) is that independent variable is X
1Function, v (x) is that independent variable is X
2Function.
Said with first composite signal, first composite signal, second composite signal are promptly exported in second composite signal serial output successively, form encoding code stream.
2. a comentropy keeps apparatus for encoding, comprising:
With input signal { X
1=x
n, X
2=y
mLook into the table look-up device of two-dimentional code table; And:
1) with X
1Information and X through function f (x) mapping gained
2Shine upon the information of gained and the information synthesizer that the control code word is combined into first composite signal through function g (x);
2) with X
1Information and X through function u (x) mapping gained
2Be combined into the remaining information code device of second composite signal through the information of function v (x) mapping gained;
3) export the TDMD time division multiplex device of first composite signal, second composite signal successively;
Input signal X
1And X
2Be connected input signal X with the input of information synthesizer
1And X
2Be connected with the input of remaining information synthesizer, second composite signal of first composite signal of information synthesizer output and remaining information code device output links to each other with the input of TDMD time division multiplex device respectively.
Described information synthesizer, comprising:
1) is used to realize first mapping device of function f (x) function;
2) be used to realize second mapping device of function g (x) function;
3) be used to construct the adder of first composite signal;
Signal X
1Connect the input of first mapping device; The output of first mapping device links to each other with the input of adder; Signal X
2Connect the input of second mapping device; The output of second mapping device links to each other with the input of adder; Link to each other with the input of adder first composite signal of adder output of control code word connects an input of TDMD time division multiplex device.
Described remaining information code device comprises:
1) is used to realize the 3rd mapping device of function u (x) function;
2) be used to realize the 4th mapping device of function v (x) function;
3) be used to construct the substracting unit of second composite signal;
Signal X
1Connect the input of the 3rd mapping device; The output of the 3rd mapping device links to each other with the input of substracting unit; Signal X
2Connect the input of the 4th mapping device; The output of the 4th mapping device links to each other with the input of substracting unit, and second composite signal of substracting unit output connects another input of TDMD time division multiplex device.
The present invention compares with background technology, and the useful effect that has: this method has been utilized X
1, X
2Between correlation, simultaneously to control code word revise, make it to carry X
1, X
2Partial information.The result shows: the present invention is with X
1, X
2The information separated into two parts encode, wherein a part be attached to control code word on; Required like this bit number less than conventional method separately to 3 part symbols---control code word, X
1, X
2---the required bit number of encoding, thus overcome the deficiency of conventional method.The present invention is mainly used in that digital signal is carried out two-dimentional united information entropy and keeps in the encoder of variable-length encoding, can also extend to the multivariate joint probability comentropy and keep variable-length encoding.
Description of drawings
Fig. 1 is the code device block diagram of conventional method;
Fig. 2 is the theory diagram of apparatus of the present invention;
Fig. 3 is the modular construction block diagram of apparatus of the present invention.
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 compression encoding 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.Coding to the coefficient after the change quantization scanning passes through { run, the realization of level} two dimension combined coding often.The present invention is applicable to signal { run=x
n, level=y
mCarry out two-dimentional united information entropy maintenance variable-length encoding, be embodiments of the invention below:
Embodiment 1
1. a comentropy keeps cataloged procedure, may further comprise the steps:
1) with input signal { run=x
n, level=y
mThe input table look-up device, look into the two-dimensional variable length coding schedule,, then use this codeword coding input signal if exist in the code table and input signal code word one to one, if do not exist and input signal code word one to one, then with a unified control code sign knowledge input signal;
2) if input signal { run=x
n, level=y
mBe Controlled code word sign, then coding step is as follows:
Run is imported first mapping device 601 through the information of function f (x) mapping gained with level is imported second mapping device 602 be combined into first composite signal with the control code word through adder 605 through the information of function g (x) mapping gained;
Run is imported the 3rd mapping device 603 to be imported the 4th mapping device 604 through the information of function u (x) mapping gained and level and is combined into second composite signal through the information of function v (x) mapping gained through substracting unit 606;
With first composite signal, second composite signal is exported through TDMD time division multiplex device 607 serials.
2. said run is imported first mapping device 601 through the information of function f (x) mapping gained with level is imported second mapping device 602 be combined into first composite signal with the control code word through adder 605 through the information of function g (x) mapping gained at the 1st, method is as follows:
First composite signal=control code word+f (x
n)+g (y
m), f (x)=2*x wherein,
The control code word is 59.
3. saidly run is imported the 3rd mapping device 603 import the 4th mapping device 604 through the information of function u (x) mapping gained and level and be combined into second composite signal through the information of function v (x) mapping gained through substracting unit 606 for the 1st, method is as follows:
Second composite signal=v (y
m)-u (x
n), function u (x wherein
n) function that realizes is for run=x
n, find | y
l|, feasible { run=x
n, level=|y
l| can not realize coding and { run=x by tabling look-up
n, level=|y
l|-1} can realize coding, then u (x by tabling look-up
n)=| y
l|; Wherein function v (x)=| y
m|.
The 1st said with first composite signal, second composite signal is promptly exported first composite signal, second composite signal through TDMD time division multiplex device 607 successively through TDMD time division multiplex device 607 serials output, forms encoding code stream.
Embodiment 2
1. a comentropy keeps coding method, may further comprise the steps:
1) with input signal { run=x
n, level=y
mThe input table look-up device, look into the two-dimensional variable length coding schedule,, then use this codeword coding input signal if exist in the code table and input signal code word one to one, if do not exist and input signal code word one to one, then with a unified control code sign knowledge input signal;
2) if input signal { run=x
n, level=y
mBe Controlled code word sign, then coding step is as follows:
Run is imported first mapping device 601 through the information of function f (x) mapping gained with level is imported second mapping device 602 be combined into first composite signal with the control code word through adder 605 through the information of function g (x) mapping gained;
Run is imported the 3rd mapping device 603 to be imported the 4th mapping device 604 through the information of function u (x) mapping gained and level and is combined into second composite signal through the information of function v (x) mapping gained through substracting unit 606;
With first composite signal, second composite signal is exported through TDMD time division multiplex device 607 serials.
2. said run is imported first mapping device 601 through the information of function f (x) mapping gained with level is imported second mapping device 602 be combined into first composite signal with the control code word through adder 605 through the information of function g (x) mapping gained at the 1st, method is as follows:
First composite signal=control code word+f (x
n)+g (y
m), wherein
The control code word is 59.
3. saidly run is imported the 3rd mapping device 603 import the 4th mapping device 604 through the information of function u (x) mapping gained and level and be combined into second composite signal through the information of function v (x) mapping gained through substracting unit 606 for the 1st, method is as follows:
Second composite signal=v (y
m)-u (x
n), wherein
The 1st said with first composite signal, second composite signal is promptly exported first composite signal, second composite signal through TDMD time division multiplex device 607 successively through TDMD time division multiplex device 607 serials output, forms encoding code stream.
The above-mentioned device that is used to improve comentropy maintenance variable-length encoding compression efficiency can be used processor system, microcontroller, and programmable logic device or hardware circuit are realized part or all of operation.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.