The content of invention
The purpose of this invention is to provide a kind of differently, be used for the square wave orthogonal function system choosing method and the method for software and hardware thereof of graphical analysis with discrete cosine transform.The orthogonal function system of selecting with the method is particularly suitable for analyzing images and digital signals, has avoided producing in the discrete cosine transform problem of match difference, and realizes all being better than on cost and the efficient existing method at software and hardware.
Technical scheme of the present invention is as follows:
A kind of square wave orthogonal function system choosing method of graphical analysis comprises earlier image being divided into N * N block of pixels, may further comprise the steps:
1) under N pixel condition, establishes N=2
M(m 〉=0) then can construct N quadrature square wave analytic function 0 in the m frequency range;
2) establishing frequency is i, and the span of i is 0 to m, default i=0;
3) when i=0, function expression is as follows:
f
0_0(n)=1, condition is: 0≤n≤N-1, n ∈ R;
Frequency is that i increased progressively 1 after 0 construction of function was finished, and continues the function under the next frequency of structure;
4) when i ≠ 0, need to construct 2 under each frequency i
I-1Individual component, component represent that with j the span of j is 0 to 2
(i-1)-1, default j=0;
Pulse duration under each frequency i is designated as d=(N/2
I-1)/2=2
M-i
5) the function expression f of the component j under each frequency i
I_j(n) following (wherein 0≤n≤N-1, n ∈ R):
f
I_j(n)=0, condition is: n<2jd or n 〉=2jd+2d;
f
I_j(n)=1, condition is: n 〉=2jd and n<2jd+d;
f
I_j(n)=-1, condition is: n 〉=2jd+d and n<2jd+2d;
6) after the construction of function of the current component j under the current frequency i was finished, j increased progressively 1, continued the function of the next component under the current frequency i of structure;
7) after the construction of function of each component was finished under the current frequency i, i increased progressively 1, continued the function under the next frequency of structure;
8) each function f
I_jBy divided by
Standardize and obtain function F
I_j
A kind of hardware implementation method of the square wave orthogonal function system choosing method based on described graphical analysis, earlier image is divided into 8 * 8 block of pixels, minimum arithmetic element of design in hardware designs, described minimum arithmetic element is used for handling 8 continuous images input data data1~data8, generate later 8 dateouts at 8 clocks, respectively representative function f
0_0, f
1_0, f
2_0, f
2_1, f
3_0, f
3_1, f
3_2, f
3_3
A kind of software implementation method of the square wave orthogonal function system choosing method based on described graphical analysis is divided into 8 * 8 block of pixels with image earlier, with 8 * 8 orthogonal transform matrixs to each 8 * 8 pixel fritter A
8 * 8Make two-dimensional transform, obtain transform coefficient matrix M
8 * 8, its expression formula is:
M
8×8=D
8vA
8×8D
8h
Wherein, D
8hAnd D
8vRepresented 8 * 8 horizontal quadrature transformation matrixs and 8 * 8 perpendicular quadrature transformation matrixs respectively, and D
8vBe D
8hTransposed matrix;
Described 8 * 8 horizontal quadrature transformation matrix D
8hFor:
As further scheme of the present invention:
Described 8 * 8 horizontal quadrature transformation matrix D
8hIn any one row all reindexing, be above-mentioned 8 * 8 horizontal quadrature transformation matrix D
8hEquivalent transformation.
If
Define an INTEGER MATRICES P
8hWith a diagonal matrix E:
With described 8 * 8 horizontal quadrature transformation matrix D
8hBe decomposed into: D
8h=P
8hE, then the expression formula of transform coefficient matrix is:
M
8×8=D
8vA
8×8D
8h=E(P
8vA
8×8P
8h)E,
P wherein
8vA
8 * 8P
8hFor only containing the integer arithmetic of addition and subtraction, P
8vBe P
8hTransposed matrix.
Useful technique effect of the present invention is:
With the square wave orthogonal function system that the inventive method is selected, there is not the match between string wave function and actual discrete signal poor, be particularly suitable for analyzing images and digital signals, and realize all being better than on cost and the efficient existing method at software and hardware.
In hardware was realized, owing to only used addition and subtraction in the design, algorithm was simple, and the other hardware in side, chip form realize code decode algorithm especially, greatly reduce area of chip, have improved the computing frequency.Simultaneously, when receiving data, just finish computing, improved the parallel processing capability of circuit.
In software was realized, similar JPEG, MPEG-1, MPEG-2, MPEG-4, the DCT basis arithmetic section of scheduling algorithm H.264 can substitute DCT.Combine with the subsequent compression algorithm, can obtain good graph image compression effectiveness and compression ratio, the publish picture signal to noise ratio of picture of compression back data pressurization is low, and quality is good.
Embodiment
Below in conjunction with accompanying drawing the specific embodiment of the present invention is described further.
To each independent color image components, can be divided into whole component image the image block of several N * N pixel, by the orthogonal function conversion, concentration of energy on a few coefficient.
The orthogonal function system that graphical analysis is at present adopted is the discrete cosine function.As long as in fact the function system satisfies the basis that quadrature, canonical, convergence condition just can be used as analysis, be different orthogonal function system selection mode characteristic differences.
A kind of orthogonal function system system of selection based on square wave of the present invention's design, the orthogonal function system of selecting with the method is particularly suitable for analyzing images and digital signals, also satisfies quadrature, canonical, convergence condition simultaneously.
At this is the function system of example analysis explanation 2 dimension graphical analyses with 1 dimension.In the 2 dimension graphical analyses, the orthogonal function system system of selection on each dimension is the same.Therefore, only the selection of square wave orthogonal function system in the numerical analysis of one-dimensional signal is described.
Choosing of square wave orthogonal function system may further comprise the steps:
1) under N pixel condition, establishes N=2
m(m 〉=0) then can construct N quadrature square wave analytic function 0 in the m frequency range;
2) establishing frequency is i, and the span of i is 0 to m, default i=0;
3) when i=0, function expression is as follows:
f
0_0(n)=1, condition is: 0≤n≤N-1, n ∈ R;
Frequency is that i increased progressively 1 after 0 construction of function was finished, and continues the function under the next frequency of structure;
4) when i ≠ 0, need to construct 2 under each frequency i
I-1Individual component, component represent that with j the span of j is 0 to 2
(i-1)-1, default j=0;
Pulse duration under each frequency i is designated as d=(N/2
I-1)/2=2
M-i
5) the function expression f of the component j under each frequency i
I_j(n) following (wherein 0≤n≤N-1, n ∈ R):
f
I_j(n)=0, condition is: n<2jd or n 〉=2jd+2d;
f
I_j(n)=1, condition is: n 〉=2jd and n<2jd+d;
f
I_j(n)=-1, condition is: n 〉=2jd+d and n<2jd+2d;
6) after the construction of function of the current component j under the current frequency i was finished, j increased progressively 1, continued the function of the next component under the current frequency i of structure;
7) after the construction of function of each component was finished under the current frequency i, i increased progressively 1, continued the function under the next frequency of structure;
8) each function f
I_jBy divided by
Standardize and obtain function F
I_j
In graphical analysis, N must be 2 power, for the most typical, adopts 8 in photo current/video compression standard with 4,8,16,32 these 4 values more.
Be unit with 8 * 8 common pixel elements now, the unit scope of what-if is N=8.Then need in the frequency range of 0~3Hz, construct totally 8 functions.Do not have the frequency concept of string Poona sample standard though it is pointed out that square wave, use the characteristic that this notion can be expressed selected quadrature square wave function more naturally.The system of selection of various frequency minor function is as follows:
The 0Hz frequency function, as shown in Figure 1, its expression formula is:
f
0_0(t)={1,1,1,1,1,1,1,1}(0≤t≤8,t∈R),
Then
1Hz frequency function component, as shown in Figure 2, its expression formula is:
f
1_0(t)={1,1,1,1,-1,-1,-1,-1}(0≤t≤8,t∈R),
Then
2Hz frequency the 0th function component, as shown in Figure 3, its expression formula is:
f
2_0(t)={1,1,-1,-1,0,0,0,0}(0≤t≤8,t∈R),
Then
2Hz frequency the 1st function component, as shown in Figure 4, its expression formula is:
f
2_1(t)={0,0,0,0,1,1,-1,-1}(0≤t≤8,t∈R),
Then
3Hz frequency the 0th function component, as shown in Figure 5, its expression formula is:
f
3_0(t)={1,-1,0,0,0,0,0,0}(0≤t≤8,t∈R),
Then
3Hz frequency the 1st function component, as shown in Figure 6, its expression formula is:
f
3_1(t)={0,0,1,-1,0,0,0,0}(0≤t≤8,t∈R),
Then
3Hz frequency the 2nd function component, as shown in Figure 7, its expression formula is:
f
3_2(t)={0,0,0,0,1,-1,0,0}(0≤t≤8,t∈R),
Then
3Hz frequency the 3rd function component, as shown in Figure 8, its expression formula is:
f
3_3(t)={0,0,0,0,0,0,1,-1}(0≤t≤8,t∈R),
Then
Above construction of function is finished.
As shown in Figure 9, the hardware implementation method of 8 * 8 graphical analyses.Earlier image is divided into 8 * 8 block of pixels, minimum arithmetic element of design in hardware designs, this minimum arithmetic element is used for handling 8 continuous images input data data1~data8, generates 8 dateouts later at 8 clocks, represents the f that is described to above respectively
0_0, f
1_0, f
2_0, f
2_1, f
3_0, f
3_1, f
3_2, f
3_3Can see and only use addition and subtraction in the hardware designs, greatly reduce area of chip, improve the computing frequency.Simultaneously, when receiving data, just finish computing, improved the parallel processing capability of circuit.
The software implementation method of 8 * 8 graphical analyses.The orthogonal transform matrix that is adopted in the computed in software is D,
About the orthogonality of D, we only need checking DD
T=I gets final product, here D
TBe the transposed matrix of D, I is a unit matrix.Therefore, all reindexing of any row is regarded as equivalent transformation in the above-mentioned matrix.
We establish D
8h=D and D
8v=D
T, be called 8 * 8 horizontal quadrature transformation matrixs and 8 * 8 perpendicular quadrature transformation matrixs.Image is divided into 8 * 8 block of pixels, then to each compressed video data block A
8 * 8(8 * 8 matrix) makes two-dimensional transform, obtains transform coefficient matrix M
8 * 8(8 * 8 matrix), promptly
M
8×8=D
8vA
8×8D
8h,
So that finish follow-up compression encoding process.
This calculating formula has been expressed following implication: at first use above-mentioned Functional Analysis matrix D that horizontal 88 * 1 pixels (8 8 * 1 vectors just) are carried out matrix and take advantage of calculating, obtain 88 * 1 data, just middle 8 * 8 data values.To middle 8 * 8 data values, in the vertical, be re-used as 88 * 1 vectors and carry out matrix and take advantage of calculating, 88 * 1 data to the end, just last 8 * 8 analysis result data.Result's 8 * 8 data values, 8 * 8 pixels decompose the analysis result behind the function space of aforementioned Fi_j function 8 * 8, the component parameter on the representative function space at 2 dimension spaces exactly.
Equally as can be known, above-mentioned matrix D
8hIn any one row or matrix D
8vIn any all reindexing of delegation, be regarded as equivalent transformation.
On above basis, the present invention proposes a kind of conversion integer implementation method, establish
Define an INTEGER MATRICES P
8hWith one to handing over matrix E as follows:
Then described 8 * 8 horizontal quadrature transformation matrix D
8hBe decomposed into: D
8h=P
8hE, the expression formula of transform coefficient matrix is:
M
8×8=D
8vA
8×8D
8h=E(P
8vA
8×8P
8h)E,
P wherein
8vBe P
8hTransposed matrix.
Note P
8hAnd P
8vElement all be 0,1 ,-1 these several integers, A
8 * 8Element also all be integer.P like this
8vA
8 * 8P
8hComputing be the computing that only comprises plus-minus, avoided more senior computings such as multiplication, help the efficient realization of computational methods.
At JPEG, MPEG-1, MPEG-2, MPEG-4, H.264 in, conversion of the present invention can be used in every place of using discrete cosine transform.Below specify with image compression encoding.For the ease of contrast, the present invention utilizes the JPEG framework to implement.
In JPEG, the compression of image is divided into four big steps, comprises discrete cosine transform (DCT), quantization transform coefficient, the scanning of Z word and entropy coding.Its concrete steps are:
The fritter X that earlier image is divided into 8 * 8 pixels
8 * 8, use 8 * 8 discrete cosine transform (DCT then
8) each image block is made two-dimensional transform, i.e. Y
8 * 8=(DCT
8v) X
8 * 8(DCT
8h), DCT wherein
8vBe classical discrete cosine matrix, DCT
8hBe DCT
8vTransposed matrix.
Obtain transform coefficient matrix Y by following formula
8 * 8, again to Y
8 * 8Each coefficient divided by a value, this process is called quantification, the matrix that these dividends constitute is called quantization matrix, and corresponding DCT is arranged in the JPEG
8The quantization matrix of acquiescence.
The layout again of coefficient after the quantification, the number of purpose continuous in order to increase " 0 " coefficient is exactly the run length of " 0 ", and method is the style layout according to zigzag.Then, finish the compressed encoding output of coefficient with Huffman encoding (one group of fixing Huffman code table is arranged usually).
The process of decoding/decoding and the process of compressed encoding are just in time opposite.About these contents, in the normative document of JPEG, all can find.
In the present invention, we still keep above-mentioned JPEG compressed encoding flow process, and only we are with DCT
8hChanged D into
8h, just at formula Y=(DCT
8v) X
8 * 8(DCT
8h) in, with DCT
8hChange D into
8h, the corresponding Y that becomes of formula
8 * 8=(D
8v) X
8 * 8(D
8h), the also corresponding thereupon change of quantization matrix and Huffman code table.
The present invention does not have the match between string wave function and actual discrete signal poor owing to structure is square wave function.And classical DCT
8The coefficient of matrix is very complicated, and the coefficient after the realization of matrix D of the present invention process conversion integer all is a small integer, makes things convenient for the efficient realization of algorithm, and has only addition and subtraction, convenient establishment simple algorithm.Combine with the subsequent compression algorithm of JPEG, can obtain good graph image compression effectiveness and compression ratio, the publish picture signal to noise ratio of picture of compression back data pressurization is low, and quality is good.
The above only is a preferred implementation of the present invention, is appreciated that those skilled in the art under the prerequisite that does not break away from spirit of the present invention and design, can make other improvement and variation.