A kind of 16*16 integer transformation method for video coding
Technical field
The present invention relates to technical field of video coding, particularly relate to a kind of 16*16 integer transformation method for video coding.
Background technology
The video coding system of complete set by predicting, convert, quantify, the series of algorithms module such as entropy code forms
's.Wherein between intra frame, prediction is the dependency compression data utilizing video data on room and time.Conversion module be by
The Image Residual data of prediction module output by spatial transform to another spatially, make the data of flat distribution in time domain become
Change spatially energy to concentrate, the energy of data is largely focused in the low frequency region in space.Compile in quantization subsequently and entropy
In code module, can effectively utilize the data distribution characteristics after conversion, compress data further.It is clear that conversion module is
Ingredient important in video coding system, the performance of conversion directly affects the performance of video coding system.
In existing video coding system, DCT (discrete cosine transform: Discrete Cosine Transform) converts
Being widely used, the energy centrality of its conversion is fine, can greatly eliminate video data on transformation space
Dependency.But this algorithm Shortcomings, dct transform matrix is floating point representation, uses substantial amounts of floating-point during calculating
Multiplication and addition, take hardware resource many, calculates the big of complexity.Simultaneously because the impact of processor operational bits, floating-point operation is deposited
In truncated error, Floating-point Computation precision is the highest, and the positive inverse transformation of DCT can not be mated completely, converts irreversible.
Summary of the invention
The purpose of the embodiment of the present invention is to propose a kind of 16*16 integer transformation method for video coding, it is intended to solve existing
Technology dct transform matrix uses floating-point multiplication and addition, takies hardware resource many, calculates the big of complexity, and computational accuracy is the highest,
The positive inverse transformation of DCT can not be mated completely, converts irreversible problem.
The method of the embodiment of the present invention is achieved in that a kind of 16*16 integer transformation method for video coding, including:
Receive Image Residual data X of the 16x16 of prediction module output in encoder;
Choose integer translation base, build transformation matrix,
Build 16 take advantage of 16 general purpose integer transformation matrix as follows:
C=[C1 C2], wherein,
In Matrix C, k9=10;K10=9;K11=6;K12=2;
[k1 k2 k3 k4 k5 k6 k7 k8] is integer translation base;
Image Residual data X of 16x16 are carried out integer transform by direct transform, and transformation for mula is Y=PXPT;Wherein P is institute
The transformation matrix stated;X is described Image Residual data;
Wherein:
Described integer translation base is one in values below:
[27 28 24 23 19 14 9 5]、[15 13 11 11 5 6 5 1]。
Step can also be included after wherein said step " choose integer translation base, build transformation matrix P ":
According to transformation matrix P, build scaled matrix PF,
PF=zT*z
Wherein, zT=[1/ | | m1||…1/||m16||];miFor the row vector of transformation matrix P, i value is 1-16;||mi||
For row vector miVector norm;
Data Y after 16x16 direct transform are zoomed in and out process,
Being the point multiplication operation of matrix, Y is the data after 16x16 direct transform, and PF is scaled matrix, and Y' is this scaling
Output valve after process, represents the information that video data transforms on frequency domain;
Wherein, the elementary cell of the conversion in described direct transform is 16 one-dimensional transforms of shape such as y=Px, wherein
X=[x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16]T, the y of output
=[y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16]T,
X1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 is the 16 of direct transform
Point input numerical value;
Y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 is the 16 of direct transform
Point output numerical value.
When described integer translation base value is [27 28 24 23 19 14 9 5]:
Described transformation matrix
zT=[α 1 α 1], wherein
α 1=[0.25 0.012345 0.033634 0.012345 0.15811 0.012345 0.033634
0.012345]
Scaled matrix is:
PF=[β 1 β 1], wherein
When described when integer translation base value is [27 28 24 23 19 14 9 5], " to 16x16's
Image Residual data X carry out integer transform, and transformation for mula is Y=PXPT" calculate process as follows:
A.b1=x1-x16 b2=x2-x15 b3=x3-x14 b4=x4-x13b5=x5-x12 b6=x6-x11 b7
=x7-x10 b8=x8-x9
B.b16=x1+x16 b15=x2+x15 b14=x3+x14 b13=x4+x13b12=x5+x12 b11=x6+
X11 b10=x7+x10 b9=x8+x9
C.m1=b16-b9;M2=b15-b10;M3=b14-b11;M4=b13-b12;
D.y1=b9+b10+b11+b12+b13+b14+b15+b16;
Y5=b16 < < 1+b15-b14-b13 < < 1-b12 < < 1-b11+b10+b9 < < 1
Y9=b16-b15-b14+b13+b12-b11-b10+b9
Y13=b16-b15 < < 1+b14 < < 1-b13-b12+b11 < < 1-b10 < < 1+b9;
Complete following steps again:
E.n1=m1 < < 3;N2=m2 < < 3;N3=m3 < < 3;N4=m4 < < 3;
F.l1=m1 < < 1;L2=m2 < < 1;L3=m3 < < 1;L4=m4 < < 1;
G.cc1=n1+l4;Cc2=-n2+l3;Cc3=n3+l2;Cc4=n4-l1;
H.y3=cc1-cc2+n3+l1+m2;Y7=cc1-cc3-n4-l3+m1;Y11=n1+cc2+cc4-l2+m4;y15
=-n2+cc3-cc4-l4+m3
Finally complete following steps:
I.c1=b1 < < 4;C2=b2 < < 4;C3=b3 < < 4;C4=b4 < < 4;C5=b5 < < 4;C6=b6 < < 4;C7=b7 <
<4;C8=b8 < < 4;
J.g1=b1 < < 3;G2=b2 < < 3;G3=b3 < < 3;G4=b4 < < 3;G5=b5 < < 3;G6=b6 < < 3;G7=b7 <
<3;G8=b8 < < 3;
K.e1=b1 < < 2;E2=b2 < < 2;E3=b3 < < 2;E4=b4 < < 2;E5=b5 < < 2;E6=b6 < < 2;E7=b7 <
<2;E8=b8 < < 2;
L.f1=b1 < < 1;F2=b2 < < 1;F3=b3 < < 1;F4=b4 < < 1;F5=b5 < < 1;F6=b6 < < 1;F7=b7 <
<1;F8=b8 < < 1;
M.d1=(e1-e6)+(c1-c6);D2=(e2+e5)+c5;D3=(e4+e5);D4=(-e4+e7);D5=(g1
+g7);D6=(g1-g7);D7=(-g2-g8);D8=(-g2+g8);D9=(g3+g4);D10=(g3-g4);D11=(g5+
g6)-e3;D12=(g5-g6);D13=(c1+c6);D15=(-c2+c3)+e3;D16=(c2+c3);D17=(-c4+c8)+
e6;D18=(c4+c8);D19=(c5-c7);D20=(c5+c7);D21=-b1+b8;D22=b1+b8;D23=b2-b3;
D24=-b4-b5;D25=b4-b5;D26=b6+b7;
N.y2=d2+d5+d9+d13+d16+d21+d24+e1+e8+g2+c4-f6+b7;
Y4=d1+d6-d11-d20-d23+d26+e2-g8+ (c2-c4)+f4-b8;
Y6=d4+d5-d9+d13+d17-d26+e2-g5+ (-c3+c7)+b2+b3-b5-f8;
Y8=d3+d6+d11-d16+d19+d21+d25-g3+ (c1-c8)+f2+b6-g4;
Y10=d1+d8-d10+d18-d22+d24-g6+ (-c2+c7)-b3-f7+ (e4-e5);
Y12=-d2+d7-d12+d13+d15+d23+e7+g4-c8-f1+b4-b6+b7;
Y14=d8+d10+d15+d17+d19+d23+d26+ (-e7+e8)+g1+b1-f5;
Y16=d4+d7+d12-d18+d20+d22+d25+ (e1-e8)+g7+c3-b2-f3-c6;
Wherein " < < " represents shifted left computing, and priority is higher than addition and subtraction, and elementary cell y=Px needs 196 to add altogether
Method and 40 displacements.
When described integer translation base value is [15 13 11 11 565 1]:
Described transformation matrix
zT=[α 1 α 1], wherein
α 1=[0.25 0.026298 0.033634 0.026298 0.15811 0.026298 0.033634
0.026298]
Scaled matrix is:
PF=[β 1 β 1], wherein
Described when integer translation base value is [15 13 11 11 565 1], " Image Residual data X to 16x16
Carrying out integer transform, transformation for mula is Y=PXPT" calculate process as follows:
A.b1=x1-x16 b2=x2-x15 b3=x3-x14 b4=x4-x13 b5=x5-x12 b6=x6-x11b7
=x7-x10 b8=x8-x9
B.b16=x1+x16 b15=x2+x15 b14=x3+x14 b13=x4+x13 b12=x5+x12b11=x6+
X11 b10=x7+x10 b9=x8+x9
C.m1=b16-b9;M2=b15-b10;M3=b14-b11;M4=b13-b12;
D.y1=b9+b10+b11+b12+b13+b14+b15+b16;
Y5=b16 < < 1+b15-b14-b13 < < 1-b12 < < 1-b11+b10+b9 < < 1
Y9=b16-b15-b14+b13+b12-b11-b10+b9
Y13=b16-b15 < < 1+b14 < < 1-b13-b12+b11 < < 1-b10 < < 1+b9;
Complete following steps again:
E.n1=m1 < < 3;N2=m2 < < 3;N3=m3 < < 3;N4=m4 < < 3;
F.l1=m1 < < 1;L2=m2 < < 1;L3=m3 < < 1;L4=m4 < < 1;
G.cc1=n1+l4;Cc2=-n2+l3;Cc3=n3+l2;Cc4=n4-l1;
I.y3=cc1-cc2+n3+l1+m2;Y7=cc1-cc3-n4-l3+m1;Y11=n1+cc2+cc4-l2+m4;y15
=-n2+cc3-cc4-l4+m3
Finally complete following steps:
J.g1=b1 < < 3;G2=b2 < < 3;G3=b3 < < 3;G4=b4 < < 3;G5=b5 < < 3;G6=b6 < < 3;G7=b7 <
<3;G8=b8 < < 3;
K.e1=b1 < < 2;E2=b2 < < 2;E3=b3 < < 2;E4=b4 < < 2;E5=b5 < < 2;E6=b6 < < 2;E7=b7 <
<2;E8=b8 < < 2;
L.f1=b1 < < 1;F2=b2 < < 1;F3=b3 < < 1;F4=b4 < < 1;F5=b5 < < 1;F6=b6 < < 1;F7=b7 <
<1;F8=b8 < < 1;
M.d1=(g1-g7);D2=(-g2+g8)+e1;D3=(g3+g4);D4=(g5-g6);D5=(e1+e2);d6
=(-e2+e3);D7=(e3-e7)-g4;D8=(e4-e6);D9=(-e4-e8)-f6;D10=(e5-e8)-f7;D11=
(f1+f6);D12=(-f2+f5);D13=(f3-f8);D14=(f4+f7);D15=g1+e7;D16=g2+e5;D17=g5
+e6;D18=b1-b7;D19=b1+b7;D20=-b2-b8;D21=-b2+b8;D22=b3+b4;D23=-b3+b4;d24
=b5+b6;D25=-b5+b6;D26=(e5+e8)+(f3-f4)
N.y2=d3+d5+d11+d15+d16+d19-d20+d22+e6+ (f3+f4)+b5;
Y4=d1+d5+d9-d14-d17+d18-d21-d24-g6+ (-f5)+b3;
Y6=-d3-d8-d10-d13+d15+d19-d22+d25+g7+f1+b2;
Y8=d1+d10+d12+d17+d18+d23+d24-g3+ (-e2-e3)+f1-b8;
Y10=d2-d7+d8+d14+d23-d24+d21-g6+ (-f2+f8)+b1;
Y12=-d4+d6+d11-d16+d20+d22+d25+ (e1+e4)+(-f2-f8)+b7-g8;
Y14=d2+d7+d12+d18+d21-d23+g3+d26+b6;
Y16=d4+d6+d9+d13+d19-d20-d25+g3+d26-b4-g8;
Wherein " < < " represents shifted left computing, and priority is higher than addition and subtraction, and elementary cell y=Px needs 185 to add altogether
Method and 32 displacements.
Beneficial effects of the present invention:
The integer transform matrix of the 16x16 of two groups of embodiment of the present invention proposition, and give the fast algorithm of conversion,
The alternative approach energy of the embodiment of the present invention concentrates excellent performance, and encircled energy, close to 16x16DCT, can greatly eliminate
Video data dependency on transformation space.Computation complexity is low, can be realized by addition and displacement, it is easy to hardware is real
Existing, and operational precision is high, there is not the unmatched problem of positive inverse transformation
Accompanying drawing explanation
Fig. 1 is the method flow diagram of the preferred embodiment of the 16*16 integer transformation method for video coding of the present invention;
Fig. 2 is choosing when integer translation base of the preferred embodiment of the 16*16 integer transformation method for video coding of the present invention
Corresponding integer transform computational methods schematic diagram time [27 28 24 23 19 14 9 5];
Fig. 3 is the computational methods figure of the computing module M1 in Fig. 2 in integer transform computational methods schematic diagram;
Fig. 4 is the computational methods figure of the computing module M2 in Fig. 2 in integer transform computational methods schematic diagram;
Fig. 5 is the computational methods figure of the computing module M3 in Fig. 2 in integer transform computational methods schematic diagram;
Fig. 6 is choosing when integer translation base of the preferred embodiment of the 16*16 integer transformation method for video coding of the present invention
Corresponding integer transform computational methods schematic diagram time [15 13 11 11 565 1];
Fig. 7 is the computational methods figure of the computing module N1 in Fig. 6 in integer transform computational methods schematic diagram;
Fig. 8 is the computational methods figure of the computing module N2 in Fig. 6 in integer transform computational methods schematic diagram;
Fig. 9 is the computational methods figure of the computing module N3 in Fig. 6 in integer transform computational methods schematic diagram.
Detailed description of the invention
In order to make the purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, right
The present invention is further elaborated, and for convenience of description, illustrate only the part relevant to the embodiment of the present invention.Should manage
Solve, the specific embodiment that this place is described, be used only for explaining the present invention, not in order to limit the present invention.
The present invention, by receiving Image Residual data X of the 16x16 of prediction module output in encoder, chooses different integer
Conversion base ([27 28 24 23 19 14 9 5] or [15 13 11 11 565 1]);Image Residual data X are just being carried out
Conversion (Y=PXPT), and according to different integer translation bases, use corresponding integer transform computational methods;Build transformation matrix
P, according to transformation matrix P, builds scaled matrix PF (PF=zT*z);Data Y after 16x16 direct transform are zoomed in and out place
Reason.
Embodiment one
Be illustrated in figure 11 one kinds of 16*16 integer transformation method for video codings of the embodiment of the present invention, described method include with
Lower step:
S101, receives Image Residual data X of the 16x16 of prediction module output in encoder;
S102, chooses integer translation base, builds transformation matrix P;
Build 16 take advantage of 16 general purpose integer transformation matrix as follows:
C=[C1 C2], wherein,
In Matrix C, k9=10;K10=9;K11=6;K12=2.Definition conversion base is [k1 k2 k3 k4 k5 k6 k7
K8] it is that integer translation base is built into transformation matrix P.
In the embodiment of the present invention, integer translation base can choose one in values below:
[27 28 24 23 19 14 9 5]、[15 13 11 11 5 6 5 1]。
S103, according to transformation matrix P, builds scaled matrix PF;
PF=zT*z
Wherein, zT=[1/ | | m1||…1/||m16||];miFor the row vector of transformation matrix P, i value is 1-16;||mi||
For row vector miVector norm;
S104, direct transform, Image Residual data X of 16x16 are carried out integer transform, transformation for mula is Y=PXPT;Wherein
P is described transformation matrix;X is described Image Residual data;
The elementary cell of conversion is 16 one-dimensional transforms of shape such as y=Px, wherein
X=[x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16]T, the y of output
=[y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16]T,
X1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 represents integer transform
Input 16 point value of one-dimensional direct transform;
Y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 is the 16 of direct transform
Point output numerical value;
According to different integer translation bases, use corresponding integer transform computational methods.
Data Y after 16x16 direct transform are zoomed in and out process by S105;
Being the point multiplication operation of matrix, Y is the data after 16x16 direct transform, and PF is scaled matrix, and Y' is this scaling
Output valve after process, represents the information that video data transforms on frequency domain.
The alternative approach energy of the embodiment of the present invention concentrates excellent performance, and encircled energy is close to 16x16DCT, Ke Yiji
The earth eliminates video data dependency on transformation space;Computation complexity is low, can be realized by addition and displacement, it is easy to
Hardware realizes, and operational precision is high, there is not the unmatched problem of positive inverse transformation.
Embodiment two
Being below a kind of 16*16 integer transformation method for video coding of the embodiment of the present invention 2, the embodiment of the present invention 2 is chosen
[27 28 24 23 19 14 9 5] are the integer translation base of 16x16 general purpose integer transformation matrix, and described method includes following step
Rapid:
S201, receives Image Residual data X of the 16x16 of prediction module output in encoder;
S202, chooses integer translation base, builds transformation matrix P;
Build 16 take advantage of 16 general purpose integer transformation matrix as follows:
C=[C1 C2], wherein,
In Matrix C, k9=10;K10=9;K11=6;K12=2.Definition conversion base is [k1 k2 k3 k4 k5 k6 k7
K8] it is that integer translation base is built into transformation matrix P.
It is integer translation base that the embodiment of the present invention chooses [27 28 24 23 19 14 9 5], is built into transformation matrix P.
When converting base and being [27 28 24 23 19 14 9 5], transformation matrix P is:
S203, according to transformation matrix P, builds scaled matrix PF;
PF=zT*z
Wherein, zT=[1/ | | m1||…1/||m16||];miFor the row vector of transformation matrix P, i value is 1-16;||mi||
For row vector miVector norm;
When the conversion base of transformation matrix P is [27 28 24 23 19 14 9 5],
zT=[α 1 α 1], wherein
α 1=[0.25 0.012345 0.033634 0.012345 0.15811 0.012345 0.033634
0.012345]
Scaled matrix is:
PF=[β 1 β 1], wherein
S204, direct transform, Image Residual data X of 16x16 are carried out integer transform, transformation for mula is Y=PXPT;Wherein
P is described transformation matrix;X is described Image Residual data;
The elementary cell of conversion is 16 one-dimensional transforms of shape such as y=Px, wherein
X=[x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16]T, the y of output
=[y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16]T,
X1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 represents integer transform
Input 16 point value of one-dimensional direct transform;
Y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 is the 16 of direct transform
Point output numerical value;
The calculating process of described integer transform is as follows:
A.b1=x1-x16 b2=x2-x15 b3=x3-x14 b4=x4-x13b5=x5-x12 b6=x6-x11 b7
=x7-x10 b8=x8-x9
B.b16=x1+x16 b15=x2+x15 b14=x3+x14 b13=x4+x13b12=x5+x12 b11=x6+
X11 b10=x7+x10 b9=x8+x9
C.m1=b16-b9;M2=b15-b10;M3=b14-b11;M4=b13-b12;
D.y1=b9+b10+b11+b12+b13+b14+b15+b16;
Y5=b16 < < 1+b15-b14-b13 < < 1-b12 < < 1-b11+b10+b9 < < 1
Y9=b16-b15-b14+b13+b12-b11-b10+b9
Y13=b16-b15 < < 1+b14 < < 1-b13-b12+b11 < < 1-b10 < < 1+b9;
Wherein, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, m1, m2, m3,
M4 is the intermediate variable of integer transform;
Complete following steps again:
E.n1=m1 < < 3;N2=m2 < < 3;N3=m3 < < 3;N4=m4 < < 3;
F.l1=m1 < < 1;L2=m2 < < 1;L3=m3 < < 1;L4=m4 < < 1;
G.cc1=n1+l4;Cc2=-n2+l3;Cc3=n3+l2;Cc4=n4-l1;
H.y3=cc1-cc2+n3+l1+m2;Y7=cc1-cc3-n4-l3+m1;Y11=n1+cc2+cc4-l2+m4;y15
=-n2+cc3-cc4-l4+m3
Wherein, n1, n2, n3, n4, l1, l2, l3, l4, cc1, cc2, cc3, cc4 are the intermediate variable of integer transform;
Finally complete following steps:
I.c1=b1 < < 4;C2=b2 < < 4;C3=b3 < < 4;C4=b4 < < 4;C5=b5 < < 4;C6=b6 < < 4;C7=b7 <
<4;C8=b8 < < 4;
J.g1=b1 < < 3;G2=b2 < < 3;G3=b3 < < 3;G4=b4 < < 3;G5=b5 < < 3;G6=b6 < < 3;G7=b7 <
<3;G8=b8 < < 3;
K.e1=b1 < < 2;E2=b2 < < 2;E3=b3 < < 2;E4=b4 < < 2;E5=b5 < < 2;E6=b6 < < 2;E7=b7 <
<2;E8=b8 < < 2;
L.f1=b1 < < 1;F2=b2 < < 1;F3=b3 < < 1;F4=b4 < < 1;F5=b5 < < 1;F6=b6 < < 1;F7=b7 <
<1;F8=b8 < < 1;
M.d1=(e1-e6)+(c1-c6);D2=(e2+e5)+c5;D3=(e4+e5);D4=(-e4+e7);D5=(g1
+g7);D6=(g1-g7);D7=(-g2-g8);D8=(-g2+g8);D9=(g3+g4);D10=(g3-g4);D11=(g5+
g6)-e3;D12=(g5-g6);D13=(c1+c6);D15=(-c2+c3)+e3;D16=(c2+c3);D17=(-c4+c8)+
e6;D18=(c4+c8);D19=(c5-c7);D20=(c5+c7);D21=-b1+b8;D22=b1+b8;D23=b2-b3;
D24=-b4-b5;D25=b4-b5;D26=b6+b7;
N.y2=d2+d5+d9+d13+d16+d21+d24+e1+e8+g2+c4-f6+b7;
Y4=d1+d6-d11-d20-d23+d26+e2-g8+ (c2-c4)+f4-b8;
Y6=d4+d5-d9+d13+d17-d26+e2-g5+ (-c3+c7)+b2+b3-b5-f8;
Y8=d3+d6+d11-d16+d19+d21+d25-g3+ (c1-c8)+f2+b6-g4;
Y10=d1+d8-d10+d18-d22+d24-g6+ (-c2+c7)-b3-f7+ (e4-e5);
Y12=-d2+d7-d12+d13+d15+d23+e7+g4-c8-f1+b4-b6+b7;
Y14=d8+d10+d15+d17+d19+d23+d26+ (-e7+e8)+g1+b1-f5;
Y16=d4+d7+d12-d18+d20+d22+d25+ (e1-e8)+g7+c3-b2-f3-c6;
Wherein, c1, c2, c3, c4, c5, c6, c7, c8, g1, g2, g3, g4, g5, g6, g7, g8, e1, e2, e3, e4, e5,
E6, e7, e8, f1, f2, f3, f4, f5, f6, f7, f8, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13,
D14, d15, d16, d17, d18, d19, d20, d21, d22, d23, d24 are the intermediate variable of integer transform;
Wherein " < < " represents shifted left computing, and priority is higher than addition and subtraction, and elementary cell y=Px needs 196 to add altogether
Method and 40 displacements.
The direct transform quick calculation method of this conversion base as in figure 2 it is shown, wherein computing module M1, M2, M3 respectively such as Fig. 3,
Shown in 4,5.Wherein
X1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 represents integer transform
Input 16 point value of one-dimensional direct transform;
Y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 is the 16 of direct transform
Point output numerical value;It is from left to right that data process direction, and the intermediate variable value intersecting at a round dot represents equal to line on the left of round dot
Data be added;Square expression data take advantage of a coefficient;"-" represents and takes negative value;" 2 " expression takes advantage of 2, i.e. moves to left one;" 4 " represent
Take advantage of 4, i.e. move to left two;" 8 " expression takes advantage of 8, i.e. moves to left 3, and " 16 " expression takes advantage of 16, i.e. moves to left 4.
" in1 " " in2 " " in3 " " in4 " " in5 " " in6 " " in7 " " in8 " in M1 module in Fig. 2 represents M1 module
Input data, are connected with b16, b15, b14, b13, b12, b11, b10, b9 respectively;" out1 " " out2 " in M1 module
" out3 " " out4 " represents the output data of M1 module, is connected with y1, y5, y9, y13 respectively;
" in1 " " in2 " " in3 " " in4 " in M2 module in Fig. 2 represents the input data of M2 module, respectively with m4,
M3, m2, m1 are connected;" out1 " " out2 " " out3 " " out4 " in M2 module represents the output data of M2 module, respectively with y3,
Y7, y11, y15 are connected;
" in1 " " in2 " " in3 " " in4 " " in5 " " in6 " " in7 " " in8 " in M3 module in Fig. 2 represents M3 module
Input data, are connected with b8, b7, b6, b5, b4, b3, b2, b1 respectively;" out1 " " out2 " " out3 " " out4 " in M3 module
" out5 " " out6 " " out7 " " out8 " represent M3 module output data, respectively with y2, y4, y6, y8, y10, y12, y14,
Y16 is connected;
Data Y after 16x16 direct transform are zoomed in and out process by S205;
Being the point multiplication operation of matrix, Y is the data after 16x16 direct transform, and PF is scaled matrix, and Y' is this scaling
Output valve after process, represents the information that video data transforms on frequency domain.
The alternative approach energy of the embodiment of the present invention concentrates excellent performance, and encircled energy is close to 16x16DCT, Ke Yiji
The earth eliminates video data dependency on transformation space;Computation complexity is low, can be realized by addition and displacement, it is easy to
Hardware realizes, and operational precision is high, there is not the unmatched problem of positive inverse transformation.
Embodiment three
Being below a kind of 16*16 integer transformation method for video coding of the embodiment of the present invention 3, the embodiment of the present invention 3 is chosen
[15 13 11 11 565 1] are the integer translation base of 16x16 general purpose integer transformation matrix, and described method includes following step
Rapid:
S301, receives Image Residual data X of the 16x16 of prediction module output in encoder.
S302, chooses integer translation base, builds transformation matrix P;
Build 16 take advantage of 16 general purpose integer transformation matrix as follows:
C=[C1 C2], wherein,
In Matrix C, k9=10;K10=9;K11=6;K12=2.Definition conversion base is [k1 k2 k3 k4 k5 k6 k7
K8] it is that integer translation base is built into transformation matrix P.
It is integer translation base that the embodiment of the present invention chooses [15 13 11 11 565 1], is built into transformation matrix P.
When converting base and being [15 13 11 11 565 1], transformation matrix P is:
S303, according to transformation matrix P, builds scaled matrix PF;
PF=zT*z
Wherein, zT=[1/ | | m1 | | ... 1/ | | m16 | |];miFor the row vector of transformation matrix P, i value is 1-16;||mi|
| for row vector miVector norm;
When the conversion base of transformation matrix P is [15 13 11 11 565 1],
zT=[α 1 α 1], wherein
α 1=[0.25 0.026298 0.033634 0.026298 0.15811 0.026298 0.033634
0.026298]
Scaled matrix is:
PF=[β 1 β 1], wherein
S304, direct transform, Image Residual data X of 16x16 are carried out integer transform, transformation for mula is Y=PXPT;Wherein
P is described transformation matrix;X is described Image Residual data;
The elementary cell of conversion is 16 one-dimensional transforms of shape such as y=Px, wherein
X=[x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16]T, the y of output
=[y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16]T,
X1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 represents integer transform
Input 16 point value of one-dimensional direct transform;
Y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 is the 16 of direct transform
Point output numerical value;
The calculating process of described integer transform is as follows:
A.b1=x1-x16 b2=x2-x15 b3=x3-x14 b4=x4-x13 b5=x5-x12 b6=x6-x11b7
=x7-x10 b8=x8-x9
B.b16=x1+x16 b15=x2+x15 b14=x3+x14 b13=x4+x13 b12=x5+x12b11=x6+
X11 b10=x7+x10 b9=x8+x9
C.m1=b16-b9;M2=b15-b10;M3=b14-b11;M4=b13-b12;
D.y1=b9+b10+b11+b12+b13+b14+b15+b16;
Y5=b16 < < 1+b15-b14-b13 < < 1-b12 < < 1-b11+b10+b9 < < 1
Y9=b16-b15-b14+b13+b12-b11-b10+b9
Y13=b16-b15 < < 1+b14 < < 1-b13-b12+b11 < < 1-b10 < < 1+b9;
Wherein, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, m1, m2, m3,
M4 is the intermediate variable of integer transform;
Complete following steps again:
E.n1=m1 < < 3;N2=m2 < < 3;N3=m3 < < 3;N4=m4 < < 3;
F.l1=m1 < < 1;L2=m2 < < 1;L3=m3 < < 1;L4=m4 < < 1;
G.cc1=n1+l4;Cc2=-n2+l3;Cc3=n3+l2;Cc4=n4-l1;
I.y3=cc1-cc2+n3+l1+m2;Y7=cc1-cc3-n4-l3+m1;Y11=n1+cc2+cc4-l2+m4;y15
=-n2+cc3-cc4-l4+m3
Wherein, n1, n2, n3, n4, l1, l2, l3, l4, cc1, cc2, cc3, cc4 are whole
The intermediate variable of transformation of variables;
Finally complete following steps:
J.g1=b1 < < 3;G2=b2 < < 3;G3=b3 < < 3;G4=b4 < < 3;G5=b5 < < 3;G6=b6 < < 3;G7=b7 <
<3;G8=b8 < < 3;
K.e1=b1 < < 2;E2=b2 < < 2;E3=b3 < < 2;E4=b4 < < 2;E5=b5 < < 2;E6=b6 < < 2;E7=b7 <
<2;E8=b8 < < 2;
L.f1=b1 < < 1;F2=b2 < < 1;F3=b3 < < 1;F4=b4 < < 1;F5=b5 < < 1;F6=b6 < < 1;F7=b7 <
<1;F8=b8 < < 1;
M.d1=(g1-g7);D2=(-g2+g8)+e1;D3=(g3+g4);D4=(g5-g6);D5=(e1+e2);d6
=(-e2+e3);D7=(e3-e7)-g4;D8=(e4-e6);D9=(-e4-e8)-f6;D10=(e5-e8)-f7;D11=
(f1+f6);D12=(-f2+f5);D13=(f3-f8);D14=(f4+f7);D15=g1+e7;D16=g2+e5;D17=g5
+e6;D18=b1-b7;D19=b1+b7;D20=-b2-b8;D21=-b2+b8;D22=b3+b4;D23=-b3+b4;d24
=b5+b6;D25=-b5+b6;D26=(e5+e8)+(f3-f4)
N.y2=d3+d5+d11+d15+d16+d19-d20+d22+e6+ (f3+f4)+b5;
Y4=d1+d5+d9-d14-d17+d18-d21-d24-g6+ (-f5)+b3;
Y6=-d3-d8-d10-d13+d15+d19-d22+d25+g7+f1+b2;
Y8=d1+d10+d12+d17+d18+d23+d24-g3+ (-e2-e3)+f1-b8;
Y10=d2-d7+d8+d14+d23-d24+d21-g6+ (-f2+f8)+b1;
Y12=-d4+d6+d11-d16+d20+d22+d25+ (e1+e4)+(-f2-f8)+b7-g8;
Y14=d2+d7+d12+d18+d21-d23+g3+d26+b6;
Y16=d4+d6+d9+d13+d19-d20-d25+g3+d26-b4-g8;
Wherein g1, g2, g3, g4, g5, g6, g7, g8, e1, e2, e3, e4, e5, e6, e7, e8, f1, f2, f3, f4, f5,
F6, f7, f8, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19,
D20, d21, d22, d23, d24, d25 are the intermediate variable of integer transform;
Wherein " < < " represents shifted left computing, and priority is higher than addition and subtraction, and elementary cell y=Px needs 185 to add altogether
Method and 32 displacements.
The direct transform quick calculation method of this conversion base as shown in Figure 6, wherein computing module N1, N2, N3 respectively such as Fig. 7,
Shown in 8,9.Wherein
X1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 represents integer transform
Input four point value of one-dimensional direct transform;
Y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 is 4 points of direct transform
Output numerical value;It is from left to right that data process direction, and the intermediate variable value intersecting at a round dot is equal to what line on the left of round dot represented
Data are added;Square expression data take advantage of a coefficient;"-" represents and takes negative value;" 2 " expression takes advantage of 2, i.e. moves to left one;" 4 " expression is taken advantage of
4, i.e. move to left two;" 8 " expression takes advantage of 8, i.e. moves to left 3.
" in1 " " in2 " " in3 " " in4 " " in5 " " in6 " " in7 " " in8 " in N1 module in Fig. 6 represents N1 module
Input data, are connected with b16, b15, b14, b13, b12, b11, b10, b9 respectively;" out1 " " out2 " in N1 module
" out3 " " out4 " represents the output data of N1 module, is connected with y1, y5, y9, y13 respectively;
" in1 " " in2 " " in3 " " in4 " in N2 module in Fig. 6 represents the input data of N2 module, respectively with m4,
M3, m2, m1 are connected;" out1 " " out2 " " out3 " " out4 " in N2 module represents the output data of N2 module, respectively with y3,
Y7, y11, y15 are connected;
" in1 " " in2 " " in3 " " in4 " " in5 " " in6 " " in7 " " in8 " in N3 module in Fig. 6 represents N3 module
Input data, are connected with b8, b7, b6, b5, b4, b3, b2, b1 respectively;" out1 " " out2 " " out3 " " out4 " in N3 module
" out5 " " out6 " " out7 " " out8 " represent N3 module output data, respectively with y2, y4, y6, y8, y10, y12, y14,
Y16 is connected;
Data Y after 16x16 direct transform are zoomed in and out process by S305;
Being the point multiplication operation of matrix, Y is the data after 16x16 direct transform, and PF is scaled matrix, and Y' is this scaling
Output valve after process, represents the information that video data transforms on frequency domain.
The alternative approach energy of the embodiment of the present invention concentrates excellent performance, and encircled energy is close to 16x16DCT, Ke Yiji
The earth eliminates video data dependency on transformation space;Computation complexity is low, can be realized by addition and displacement, it is easy to
Hardware realizes, and operational precision is high, there is not the unmatched problem of positive inverse transformation.Those of ordinary skill in the art can manage
Solve, it is achieved all or part of step in above-described embodiment method can be by what programmed instruction related hardware completed, institute
The program stated can be stored in a computer read/write memory medium, described storage medium can be ROM, RAM, disk,
CD etc..
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all essences in the present invention
Any amendment, equivalent and the improvement etc. made within god and principle, should be included within the scope of the present invention.