CN102611883A - Coding method as well as decoding method and device - Google Patents

Coding method as well as decoding method and device Download PDF

Info

Publication number
CN102611883A
CN102611883A CN2011100218934A CN201110021893A CN102611883A CN 102611883 A CN102611883 A CN 102611883A CN 2011100218934 A CN2011100218934 A CN 2011100218934A CN 201110021893 A CN201110021893 A CN 201110021893A CN 102611883 A CN102611883 A CN 102611883A
Authority
CN
China
Prior art keywords
coefficient
rot
transform
group
matrix
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
CN2011100218934A
Other languages
Chinese (zh)
Other versions
CN102611883B (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.)
MIGU Culture Technology Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201110021893.4A priority Critical patent/CN102611883B/en
Priority to PCT/CN2011/082591 priority patent/WO2012097639A1/en
Publication of CN102611883A publication Critical patent/CN102611883A/en
Application granted granted Critical
Publication of CN102611883B publication Critical patent/CN102611883B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiment of the application discloses a coding method as well as a decoding method and device. The coding method comprises the following steps of: respectively carrying out ROT (Rotational Transform) forward transform on an input signal after DCT (Discrete Cosine Transform) is carried out according to a plurality of preset ROT forward transform matrixes to obtain a transform coefficient after the ROT forward transform, wherein each coefficient in the ROT forward transform matrixes can be decomposed into a plurality of shifting coefficients, and each shifting coefficient is composed of a shifting bit and a sign bit; after the transformation coefficient subjected to the ROT forward transform is quantified, comparing distortions of output signals obtained by calculating according to the quantified transform coefficients; and selecting the ROT forward transformation matrix corresponding to the output signal with minimum distortion as the optimal ROT forward transformation matrix of the current coding block, and coding according to the optimal ROT forward transformation matrix. According to the application, a multiply operation in an ROT transformation process is replaced by a shift operation and an addition operation, so that the computational efficiency is improved.

Description

Coding method, coding/decoding method and device
Technical field
The application relates to communication technical field, particularly relates to a kind of coding method, coding/decoding method and device.
Background technology
DCT (Discrete Cosine Transform, discrete cosine transform) is a widely used mapping mode in the video image encoding and decoding process.Because the dct transform matrix has symmetry characteristic, therefore when hardware is realized this conversion, adopt dish-shaped algorithm usually.Because dct transform is realized through two one-dimensional transforms; Be respectively vertically and along continuous straight runs; Therefore when the two-dimentional data to be encoded of input have significant directional characteristic; For example, the main direction of data then is difficult to describe better characteristics of signals through DCT not on vertical direction or horizontal direction.
In view of this,, improve the encoding and decoding compression effectiveness, introduce MDDT (mode dependent directional transform, different transform coding) technology in order to describe characteristics of signals better.Because MDDT conversion more complicated needs a large amount of internal memories to come the store transformed matrix, so selects ROT (Rotational Transform, rotation transformation) that the conversion coefficient signal that still has directional characteristic behind the dct transform is handled in the prior art.A horizontal transformation matrix and a vertical transformation matrix are adopted in the ROT conversion.
Cataloged procedure based on dct transform and ROT conversion can be formulated as follows:
m o = R v T D T m i D R h
In the following formula, m iBe the signal of input, m oBe that D is the DCT matrix, R through the signal after dct transform and the ROT conversion hBe ROT horizontal transformation matrix, R vIt is the vertical transformation matrix of ROT.
ROT transformation matrix with 8 * 8 is an example, and in carrying out the matrix multiplication operation process, the coefficient that position in the DCT matrix (1,1) is located needs and R hThe multiplication that position in the matrix (1,1) is located (being positioned at the coefficient that first row and first lists in the representing matrix of position (1,1)), and the coefficient that position (1,1) is located among the corresponding output matrix m is first row coefficient and R in the DCT matrix hThe result of summation after coefficient in the matrix on the first row correspondence position multiplies each other respectively.Suppose R hRemove first line position (1,1) in the matrix, outside the coefficient on position (1,2) and position (1,3), all the other coefficients all are zero, then carry out matrix multiplication accordingly after, the coefficient on position among the output signal matrix m (1,1) is according to computes:
m(1,1)=D(1,1)×R h(1,1)+D(2,1)×R h(1,2)+D(3,1)×R h(1,3)
In coding techniques, adopt binary mode to carry out multiplication usually and calculate, promptly need convert the decimal system coefficient of each non-zero in the above-mentioned matrix into binary coefficient, so D (1,1) * R h(1,1) is actual to be the multiplying of two binary numbers.Suppose D (1,1) * R h(1,1) corresponding decimal number is respectively 10 and 5, then convert binary multiplication into after, be 1010 and 0101 to multiply each other, its multiplication procedure is shown in Figure 1A.Can know by Figure 1A; Because the binary number of decimal number 5 is four; Therefore four groups of intermediate object programs are arranged in multiplication procedure, displacement in order between four groups of intermediate object programs, the add operation of carrying out the numerical value on the same position after the displacement obtains final binary multiplication operation result.Hence one can see that, when the hardware that carries out the binary multiplication computing is realized, has and how much organize the multiplier that multiplying just need be provided with respective numbers, for example for the calculating of above-mentioned m (1,1), needs three groups of multipliers of design; And the figure place according to binary number is different, need carry out the shifting function of different number of times.Shown in Figure 1B, in the prior art based on the hardware implementation structure sketch map of the ROT conversion of above-mentioned example.Wherein, each multiplier is used for one group of multiplication component of computing, and promptly first multiplier is used for computing D (1,1) * R h(1,1), second multiplier is used for computing D (2,1) * R h(1,2), the 3rd multiplier is used for computing D (3,1) * R h(1,3), the corresponding register of each multiplier after multiplier move multiplying, is stored in intermediate object program in the register of correspondence, wait for that all registers are all stored data after, will store in the data input summer and add up.
Describe and to know by above-mentioned simple description the ROT conversion in the encoding-decoding process in the prior art; When the ROT conversion being carried out the hardware realization; Accomplish the needed asynchronism(-nization) of multiplying between each multiplier; After having only the slowest multiplier of processing by the time to accomplish computing, just can carry out next group operation of data, cause the waste of calculation resources in the encoding-decoding process thus.
Summary of the invention
In order to solve the problems of the technologies described above, the application embodiment provides a kind of coding method, coding/decoding method and device, and the ROT conversion process is wasted computational resource easily during with the encoding and decoding of solution prior art, reduces the problem of hardware utilance.
The application embodiment discloses following technical scheme:
A kind of transcoding, coding transform method comprises:
Input signal is carried out dct transform;
Input signal behind the dct transform is carried out the ROT direct transform respectively according to some groups of preset ROT direct transform matrixes; Obtain the conversion coefficient after the ROT direct transform; Each coefficient in the said ROT direct transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed;
After conversion coefficient after the said ROT direct transform quantized, the conversion coefficient after relatively quantizing based on each group calculated the distortion situation of the output signal that obtains;
Selecting the minimum pairing ROT direct transform of the output signal matrix of distortion is the optimum ROT direct transform matrix of present encoding piece, encodes according to said optimum ROT direct transform matrix.
A kind of code device comprises:
The dct transform unit is used for input signal is carried out dct transform;
The ROT forward transformation unit; Be used for the input signal behind the dct transform is carried out the ROT direct transform respectively according to some groups of preset ROT direct transform matrixes; Obtain the conversion coefficient after the ROT direct transform; Each coefficient in the said ROT direct transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed;
Quantifying unit is used for the conversion coefficient after the said ROT direct transform is quantized;
Comparing unit is used for the distortion situation that conversion coefficient after comparison quantizes according to each group calculates the output signal that obtains;
Coding unit, being used to select the minimum pairing ROT direct transform of the output signal matrix of distortion is the optimum ROT direct transform matrix of present encoding piece, encodes according to said optimum ROT direct transform matrix.
A kind of coding/decoding method comprises:
From input code flow, obtain the conversion coefficient after the quantification that obtains in the cataloged procedure;
Conversion coefficient after the said quantification is carried out the ROT inverse transformation respectively according to some groups of preset ROT inverse-transform matrixs; Matrix coefficient behind the acquisition dct transform; Each coefficient in the said ROT inverse-transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed;
Matrix coefficient behind the said dct transform is carried out the DCT inverse transformation;
Matrix coefficient based on after the said DCT inverse transformation is decoded.
A kind of decoding device comprises:
Acquiring unit is used for the conversion coefficient after input code flow obtains the quantification that obtains the cataloged procedure;
The ROT inverse transformation block; Be used for the conversion coefficient after the said quantification is carried out the ROT inverse transformation respectively according to some groups of preset ROT inverse-transform matrixs; Matrix coefficient behind the acquisition dct transform; Each coefficient in the said ROT inverse-transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed;
DCT inverse transformation unit is used for the matrix coefficient behind the said dct transform is carried out the DCT inverse transformation;
Decoding unit is used for decoding according to the matrix coefficient after the said DCT inverse transformation.
Can find out by the foregoing description; During the ROT map function of the application embodiment in realizing the Code And Decode process, owing in advance the coefficient in the ROT transformation matrix is trained according to preset training pattern, therefore can be when the hardware realization of carrying out the ROT conversion according to training result; Convert multiply operation into shifting function and add operation; Because need not to design a large amount of multipliers carries out multiply operation, therefore reduced hard-wired complexity, and the needed clock number of ROT conversion; And because each coefficient in the ROT transformation matrix is through after training; Needed shift count is all consistent with the addition number of times in computational process; Be that each coefficient needed clock number when carrying out multiply operation is consistent; Therefore compared with prior art, can not cause the waste of calculation resources in the encoding-decoding process, improve operation efficiency.
Description of drawings
In order to be illustrated more clearly in the application embodiment or technical scheme of the prior art; To do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below; Obviously; For those of ordinary skills, under the prerequisite of not paying creative work property, can also obtain other accompanying drawing according to these accompanying drawings.
Figure 1A is the computing sketch map of binary multiplication in the prior art;
Figure 1B is the hardware implementation structure sketch map of ROT conversion in the prior art;
Fig. 2 A is a coding side ROT direct transform matrix coefficient sketch map in the prior art;
Fig. 2 B is a decoding end ROT inverse-transform matrix coefficient sketch map in the prior art;
Fig. 2 C is the structural representation of transformation matrix coefficient training pattern among the application embodiment;
Fig. 3 A carries out the hardware configuration sketch map of ROT conversion for the application embodiment;
Fig. 3 B is the structural representation of each processing unit PE among Fig. 3 A;
Fig. 4 is the embodiment flow chart of the application's coding method;
Fig. 5 is the embodiment flow chart of the application's coding/decoding method;
Fig. 6 is the embodiment flow chart of the application's code device;
Fig. 7 is the embodiment flow chart of the application's decoding device.
Embodiment
The present invention following embodiment provide a kind of coding method, coding/decoding method and device.In view of ROT conversion more complicated in the existing encoding-decoding process; Be unfavorable for hard-wired shortcoming; The application embodiment aims to provide a kind of hard-wired ROT transformation matrix that is easy to; Carry out encoding-decoding process through this ROT transformation matrix, when guaranteeing encoding-decoding efficiency, reduce computational complexity to be implemented in.
In order to make those skilled in the art person understand the technical scheme in the embodiment of the invention better; And make the above-mentioned purpose of the embodiment of the invention, feature and advantage can be more obviously understandable, below in conjunction with accompanying drawing technical scheme in the embodiment of the invention done further detailed explanation.
All need carry out dct transform and ROT conversion in cataloged procedure among the application embodiment and the decode procedure.Before the ROT conversion in describing the application's Code And Decode process, earlier ROT conversion of the prior art is described.
Can know by prior art, need use the transformation matrix of a horizontal direction and the transformation matrix of a vertical direction during ROT conversion, use R respectively hAnd R vExpression, R hAnd R vCan specifically explain with following formula:
R h=R z1)R x2)R z3)
R v=R z4)R x5)R z6)
Wherein, R x ( θ ) = 1 0 0 0 0 0 0 0 0 Cos ( θ ) - Sin ( θ ) 0 0 0 0 0 0 Sin ( θ ) Cos ( θ ) 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 Cos ( θ ) - Sin ( θ ) 0 0 0 0 0 0 Sin ( θ ) Cos ( θ ) 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 ;
R x ( θ ) = cos ( θ ) - sin ( θ ) 0 0 0 0 0 0 sin ( θ ) cos ( θ ) 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 cos ( θ ) - sin ( θ ) 0 0 0 0 0 0 sin ( θ ) cos ( θ ) 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 ;
In the following formula, one group of anglec of rotation θ 1 to θ 6 can distinguish value for (α 1, and α 2, and α 3) with (α 4, and α 5; α 6), wherein (α 1, and α 2, and α 3) is the anglec of rotation in the horizontal transformation matrix; (α 4, and α 5, and α 6) are the anglec of rotation in the vertical transformation matrix, bring above-mentioned six angle values into above-mentioned R hAnd R vCalculate in the formula and can obtain the ROT transformation matrix.In the Practical Calculation process, need not to know the occurrence at each angle, get final product but derive transformation matrix.In concrete encoding-decoding process, can select for use four groups of angles to carry out the ROT conversion, so that therefrom select one group of optimum transformation matrix, in the ROT conversion process, each element in the transformation matrix is normalized to the form of 2^p.For example, coding side and decoding end can be used p=12 and p=8 respectively.
ROT transformation matrix with 8 * 8 is an example, at four groups of coefficients after the element in the coding side transformation matrix is according to p=12 normalization shown in Fig. 2 A, at four groups of coefficients after the element in the coding side transformation matrix is according to p=8 normalization shown in Fig. 2 B: wherein; The numbering (1 on the left side; 2,3,4) be illustrated respectively in the ROT conversion coefficient in the ROT transformation matrix under 4 groups of angles; Every group of coefficient is made up of 36 values, uses R respectively 0To R 35Expression.FWD is expressed as the ROT direct transform in the cataloged procedure, and the value among the direct transform matrix g_FWD_ROT_MATRIX_8 [4] [36] is all normalized to 2^12=4096, and gets approximation; INV is expressed as the ROT inverse transformation in the cataloged procedure, and the value among the inverse-transform matrix g_INV_ROT_MATRIX_8 [4] [36] is all normalized to 2^8=256, and gets approximation.
The ROT transformation matrix that utilizes each the group coefficient among Fig. 2 A and Fig. 2 B to constitute, carry out following cataloged procedure operation:
R 0 R 1 R 2 0 0 0 0 0 R 3 R 4 R 5 0 0 0 0 0 R 6 R 7 R 8 0 0 0 0 0 0 0 0 R 18 R 19 R 20 0 0 0 0 0 R 21 R 22 R 23 0 0 0 0 0 R 24 R 25 R 26 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 * D T m i D * R 9 R 12 R 15 0 0 0 0 0 R 10 R 13 R 16 0 0 0 0 0 R 11 R 14 R 17 0 0 0 0 0 0 0 0 R 27 R 30 R 33 0 0 0 0 0 R 28 R 31 R 34 0 0 0 0 0 R 29 R 32 R 35 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1
With the direct transform matrix in the cataloged procedure is example, then the conversion coefficient among Fig. 2 A is returned to 8 * 8 direct transform matrix after, as shown in table 1 below, show the transformation matrix of vertical direction:
Table 1
R v(1,1) R v(1,2) R v(1,3) 0 0 0 0 0
R v(2,1) R v(2,2) R v(2,3) 0 0 0 0 0
R v(3,1) R v(3,2) R v(3,3) 0 0 0 0 0
0 0 0 R v(4,4) R v(4,5) R v(4,6) 0 0
0 0 0 R v(5,4) R v(5,5) R v(5,6) 0 0
0 0 0 R v(6,4) R v(6,5) R v(6,6) 0 0
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1
In the last table 1, except 9 coefficients in the upper left corner and 9 coefficients of bottom right, and outside two " 1 " of position (7,7) and position (8,8), all the other coefficients all are 0.Wherein two groups of 9 coefficients are in full accord, that is to say R v(4,4) and R v(1,1) is equal fully, in like manner, and R v(6,5) and R v(3,2) are equal fully.Therefore in the actual calculation process, one group of 9 coefficient can only considering to calculate in two groups of coefficients get final product, and the computational process of 9 coefficients of another group is identical with it with the result.
Below with the row of first in the table 1, i.e. R v(1,1), R v(1,2), R vConversion process of the prior art is explained in the multiplying of (1,3).Suppose that the 2nd group of coefficient is example, wherein R among employing Fig. 2 A vThe value of (1,1) is 3903, and corresponding binary value is 111100111111, R vThe value of (1,2) is-983, and corresponding binary value is 1111010111, R vThe value of (1,3) is-802, and corresponding binary value is 1100100010, when carrying out multiplying with matrix D, D (1,1) will and R vBinary multiplication is carried out in (1,1), obtains intermediate operands, in like manner, D (2,1) will and R vBinary multiplication is carried out in (1,2), obtains intermediate operands, D (3,1) will and R vBinary multiplication is carried out in (1,3), obtains intermediate operands, and then through adder all intermediate operands is added up, and has been the Coefficient m (1,1) that obtains in the output matrix, need calculate as follows:
m(1,1)=D(1,1)×R h(1,1)+D(2,1)×R h(1,2)+D(3,1)×R h(1,3)
Characteristic according to binary multiplication can know that the arithmetic operation of each group multiplication component need carry out different shifting functions according to the figure place difference of binary number in the matrix multiplication operation process.In the following formula, the multiplication components R v(1,1) * D (1,1) needs 10 shifting functions and the operation of 9 sub-additions, and the multiplication components R v(1,3) * D (3,1) only needs the operation of four shifting functions and 3 sub-additions.The number of times of multiplication shift operation here is by the non-zero number decision of binary number Rv, i.e. R vNon-zero number is 10 in the binary number of (1,1), and corresponding shifting function needs ten times, and add operation is lacked once than shifting function, promptly needs nine times.As shown in table 2 below, the shifting function of each coefficient and the number of times of add operation during for calculating m (1,1):
Table 2
Binary number The shifting function number The add operation number
R v(1,1) 111100111111 10 9
R v(1,2) 1111010111 8 7
R v(1,3) 1100100010 4 3
Suppose that shifting function and add operation all only need clock cycle, then a R v(1,1) * D (1,1) needs 19 clock cycle to accomplish, and R v(1,3) * D (3,1) only needs 7 clock cycle to accomplish.If we use three groups of same hardware to come computing R respectively v(1,1) * D (1,1), R v(1,2) * D (2,1) and R v(1,3) * D (3,1), m (1,1) such as has only just can obtain after accomplishing at three groups of computings so, just need wait until after a slowest group component is accomplished computing just can obtain.Can know in conjunction with Figure 1B, at first accomplish R v(1,3) * D (3,1) afterwards need be with R vThe result of (1,3) * D (3,1) is kept in the relevant register, because R v(1,3) * D (3,1) only needs 7 clock cycle, let R so need to wait for 19-7=11 clock cycle v(1,1) * D (1,1) accomplishes computing, causes the service efficiency of hardware to reduce thus.
Owing to when application transformation matrix coefficient of the prior art carries out the ROT conversion, need carry out binary matrix multiplication, therefore in the hardware configuration of correspondence design, need use the not multiplier of isotopic number according to the figure place of matrix coefficient.And what determine whole calculation process efficient is the longest coefficient of figure place, and the coefficient of other figure place all is in idle state after computing is accomplished, consumed the encoding and decoding resource.Therefore, the application embodiment designs existing ROT transformation matrix coefficient again, to obtain to be beneficial to hard-wired ROT transformation matrix.
Referring to Fig. 2 C, be the structural representation of transformation matrix coefficient training pattern among the application embodiment:
Utilize the training pattern among Fig. 2 C; Respectively each coefficient in each the group matrixing coefficient among Fig. 2 A and Fig. 2 B is trained; Is the form of several component additions according to training result with each transformation of coefficient, and each component is made up of sign bit (sign bit) and mobile position (a shift bits).The process that matrix is trained is equivalent to transformation matrix is quantized, and with in the input module among each the conversion coefficient input Fig. 2 C in the ROT transformation matrix to be quantified, at first obtains the sign bit of this coefficient respectively; Obtain the absolute value of this coefficient then through absolute value block, through computing module this coefficient is carried out the calculating of log2 (), the result of calculation round numbers; This integer as the quantity that moves the position, should be moved the position as K then, asked 2^K; With asking poor between coefficient of importing in the input module and the 2^K; And the result turned back in the input module through the difference feedback module, repeat aforementioned flow process, until each sign bit that obtains this coefficient with move the position.
With the inverse-transform matrix in the decode procedure is example; Matrix after the n position of supposing to go for original inverse-transform matrix quantizes is then imported original inverse transformation in the above-mentioned training flow process, to each coefficient in the inverse-transform matrix; It is inferior to repeat whole flow process (n-1); Then results added, can obtain one and new be used for hard-wired inverse-transform matrix, each value in this inverse-transform matrix is used following equation expression:
sign(1)*2 1bit+sign(2)*2 2bit+…sign(n)*2 nbit
In the following formula, sign () representes sign bit, and () bit representes to move the position, and the n value is for obtain the quantization digit of inverse-transform matrix in advance according to result of the test.
Suppose that through the inverse-transform matrix that obtains after the training be hf_inv_nbit,, in order to keep its invertibity, can be directly the inverse-transform matrix transformation matrix of inverting be obtained that promptly the direct transform matrix is shown below then for the direct transform matrix:
fwd=(hf_inv_nbit) -1
In like manner, direct transform matrix hf_fwd_mbit also can obtain according to aforementioned flow process, and wherein the m value is for obtain the quantization digit of direct transform matrix in advance according to result of the test.In same encoding-decoding process, m and n can equate also can be unequal.The size of m and n can be based on different application scenarios, different data types, and different video size, different system requirements selects respectively, so that between code efficiency and hardware complexity, obtain different balance.Can know according to experimental result, can obtain and the immediate result of original ROT transformation matrix (four groups of coefficients among Fig. 2 A and Fig. 2 B) when the quantized value n=3 that the inverse-transform matrix of ROT is got, the quantized value m=5 of the direct transform matrix of ROT.
Further, among Fig. 2 C, in rounding the process that module rounds, can specifically adopt the strategy that rounds that is provided with in advance, for example, round downwards after input signal added certain displacement, rounding formulate is round (R Ij+ P Ij), R wherein IjBe the numerical value of computing module output, p IjBe displacement, it can be along with different numerical be got in the variation of position, or gets the consistent numerical value of the overall situation for different positions.Among the application embodiment, the preferred employing for different positions got the consistent p value of the overall situation.Confirming in the optimum p value process through test, can be through changing the value of displacement p, for example; P from-0.9 to 0.9, and step-length is 0.01, under each specific p value; Calculate the difference of approximate matrix and original matrix, therefrom select an optimum p value that can obtain minimum difference.According to experimental result, it is minimum that the error when p=0.47 reaches.
Be example with a coefficient-3788 in the direct transform matrix below, describe the process that adopts the training pattern among Fig. 2 C that coefficient is trained and further specify.At first, incite somebody to action-3788 and be input in the input module, then sign bit " 1 " is stored in the sign bit bit matrix; Then through absolute value block get-3788 thoroughly deserve 3788; In 3788 input computing module log2 (), result of calculation is 11.887, supposes to round the strategy of selecting in the module that rounds and is p=0.47; It is 12 that the mobile position that then obtains rounds numerical value; Calculate 2^12 through the evaluation module, calculate then (3788-2^12), and the difference that obtains is continued to be input to mobile position and the sign bit that obtains remainder in the input module.
Based on aforementioned each transformation matrix coefficient that obtains through training pattern; Still be example with 8 * 8 matrixes; Suppose that g_FWD_ROT_MATRIX_8 [4] [36] expression has the direct transform matrix of four groups of matrixing coefficients, g_INV_ROT_MATRIX_8 [4] [36] then representes to have the inverse-transform matrix of four groups of matrixing coefficients.Suppose to align transformation matrix and carry out the m position and quantize, use the n position to quantize inverse-transform matrix, wherein, m and n can be identical also can be inequality.
Then according to training result, the coefficient in the direct transform matrix can be according to following formulate:
FWD_Rv(i,j)=sign_8_1*ROT_shift_FWD_8_1+...+sign_8_m*ROT_shift_FWD_8_m;
In the following formula, sign_8_m representes sign bit, and ROT_shift_FWD_8_m representes to move the position;
In like manner, the coefficient in the inverse-transform matrix can be according to following formulate:
INV_Rv(i,j)=sign_8_1*ROT_shift_INV_8_1+...+sign_8_n*ROT_shift_INV_8_n;
In the following formula, sign_8_n representes sign bit, and ROT_shift_INV_8_n representes to move the position.
Can know by above-mentioned description the training pattern among Fig. 2 C; Because each the transformation matrix coefficient after the training can be expressed as identical with quantization digit by the summation form that moves the component that position and sign bit form; Therefore removed multiply operation; Change into by being shifted and the add operation realization, therefore corresponding transformation matrix is beneficial to hardware and realizes, and owing to all coefficients quantize according to identical figure place; Therefore the required clock number of the operation result of each coefficient is in full accord in the transformation matrix, has therefore improved hardware utilization.
Fig. 3 A is seen in participation, the hardware configuration sketch map that provides a kind of the application embodiment to carry out the ROT conversion:
Can know like preceding description prior art; ROT transformation matrix for 8x8; In fact need carry out multiply operation to one group of 9 coefficient; And each row of matrix has only three coefficients to need operation simultaneously to obtain the result of matrix after the specific conversion, so proposes a time-multiplexed hardware structure among Fig. 3 A.Wherein, comprise three processing unit PE (processing element), two adders (adder) and a register (register).Processing unit PE is used for importing the judgement that data move position and sign bit, wherein imports data and is through the transformation matrix coefficient after the training pattern training; The adder that links to each other with processing unit PE is responsible for the i of three input data (is supposed that quantization digit is m; I from 1 to m) inferior shift result adds up; Interim result after adding up for the i time is input to deposit in the register through second adder and preserves; And when the interim result after the i+1 time is added up is input to second adder, the interim results added after second adder adds up the interim result after the i time that stores in the register add up and this again, by that analogy; After carrying out altogether adding up for m-1 time, thereby get result to the end.
Further, referring to Fig. 3 B, be the structural representation of each processing unit PE among Fig. 3 A:
Among Fig. 3 B, processing unit PE comprises: multibit shift unit MSE (multi-shift element), data register DR (data register) and symbol decision cell S DE (sign determinationelement).At first according to from the transformation matrix coefficient after the training, obtaining to move position control signal Shift_bit; To move the position is input among the MSE; According to moving the position input data are carried out shifting function by MSE, with the input of the data after shifting function DR, the sign bit sign_bit input SDE that will from the transformation matrix coefficient after the training, obtain simultaneously; By the sign bit of SDE according to corresponding symbol position sign_bit and each input signal; Decide the sign bit of output signal, and the intermediate data that DR is input to SDE is at every turn added up, a final PE is input in the first order adder the result of a matrixing coefficient.
In order to further specify the handling process of above-mentioned PE, citing an actual example below in conjunction with Fig. 3 A and Fig. 3 B row describes.
Among Fig. 3 B, suppose that the transformation matrix coefficient carries out the m position and quantizes, and the dct transform matrix D of input signal is 1 entirely, then three PE are responsible for computing Rv (1 respectively; 1) * and D (1,1), Rv (1,2) * D (2; 1) and Rv (1,3) * D (3,1), because the calculating process of three PE is consistent; Therefore only Rv (1,1) * D (1,1) is handled and describes with PE:
In first clock cycle:
MSE will move the ROT_shift_8_1 position to input signal D (1,1), and the result is kept among the DR;
Second clock cycle:
MSE moves the ROT_shift_8_2 position to input signal D (1,1), and the result is kept among the DR; Simultaneously, the result after the shifting function first time that DR will preserve originally is input among the SDE, and SDE carries out sign bit to sign_8_1 and judges, and based on the intermediate data of judged result after adder adder output shifting function for the first time;
By that analogy, to m clock cycle:
MSE moves the ROT_shift_8_m position to input signal D (1,1), and the result is kept among the DR; Simultaneously, the result after the m-1 time shifting function that DR will preserve originally is input among the SDE, and SDE carries out sign bit to sign_8_m-1 and judges, and according to the intermediate data of judged result after adder adder exports the m-1 time shifting function;
M+1 clock cycle:
Result after the m time shifting function that DR will preserve originally is input among the SDE, and SDE carries out sign bit to sign_8_m and judges, and according to the intermediate data of judged result after adder adder exports the m time shifting function.
The adder adder that mentions in the said process first adder for linking to each other with PE among Fig. 3 A; Because the flow chart of data processing of two other PE is consistent with above-mentioned PE handling process; So the needed clock cycle is also consistent, is m+1 clock cycle, repeats no more at this.
In conjunction with Fig. 3 A; With three shifting functions is example; Second clock cycle; Three PE export the intermediate object program after the shifting function the 1st time to first adder, and then first adder is input to second adder after three intermediate object programs are added up, and are input in the register by second adder and preserve; The 3rd clock cycle; Three PE are the 2nd intermediate object program after the shifting function to first adder output; Then first adder is input in second adder after three intermediate object programs are added up; Deposit the result after second adder taken out and last time added up from register, and after the results added after adding up with this, be input to register and preserve; The 4th clock cycle; Three PE are the 3rd intermediate object program after the shifting function to first adder output; Then first adder is input in second adder after three intermediate object programs are added up; After taking out and last time added up, second adder deposit the result from register, and the results added after adding up with this, export final result data.
Hence one can see that, compares with the hardware configuration of the existing ROT conversion shown in Figure 1A, and the hardware structure among the application embodiment has adopted processing unit PE (processing element) to replace multiplier, and has increased one-level flowing water, removes the one-level register.Because the needed area of PE is merely 1/10th or 1/tens of former multiplier, therefore reduces hardware and realize shared area; Secondly, because the quantization digit of each coefficient is identical, therefore three PE are identical to the processing time of data flow, and cumulative process need not to wait for, can improve the efficient of the data throughout and the raising system hardware of system.
The beneficial effect of using above-mentioned hardware configuration further specifies as follows: suppose to be inversely transformed into example with ROT; If the quantization digit that the ROT inverse-transform matrix is trained is m, then all coefficients are when carrying out multiply operation, and needed shift count is all consistent with the addition number of times; Be that each coefficient is when carrying out multiply operation; Only need m shifting function, and the operation of m-1 sub-addition, as shown in table 3 below; The shifting function of each coefficient and the number of times of add operation when calculating m (1,1) when the application embodiment carries out the ROT inverse transformation for using:
Table 3
The shifting function number The add operation number
R v(1,1) m m-1
R v(1,2) m m-1
R v(1,3) m m-1
Can know that by last table 3 when m was 3, the clock number of the required operation of each inverse-transform matrix coefficient was merely 5 clock cycle; Compared with prior art, owing to need not to confirm needed clock number according to the number of bits of each coefficient, therefore needed clock quantity significantly reduces; And all coefficients are accomplished multiplying all only needs 2m-1 clock cycle, because the computing of data flow is highly regular, the clock cycle is all consistent; Therefore being beneficial to hardware realizes
The front is to the training process of the ROT transformation matrix that uses in the application's Code And Decode process; Hardware structure when carrying out multiply operation with the new ROT transformation matrix that generates behind the application training is described, and below in conjunction with aforementioned content the cataloged procedure of the application embodiment and decode procedure is carried out integral body and describes.
Referring to Fig. 4, be the embodiment flow chart of the application's coding method:
Step 401: input signal is carried out dct transform.
Step 402: the input signal behind the dct transform is carried out the ROT direct transform respectively according to some groups of preset ROT direct transform matrixes; Obtain the conversion coefficient after the ROT direct transform; Each coefficient in the ROT direct transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed.
Wherein, some groups of ROT direct transform matrixes specifically can be four groups of ROT direct transform matrixes.Each coefficient in the said ROT direct transform matrix can be decomposed into the displacement coefficient consistent with preset quantization digit, so that said each coefficient has identical displacement coefficient.Can train each coefficient through training pattern during concrete the realization; When realization is trained each coefficient; Each coefficient for the said training pattern of input; According to preset quantization digit repetition training flow process, obtain the displacement coefficient consistent, so that said each coefficient has identical displacement coefficient with said quantization digit.
Concrete, when carrying out the ROT direct transform,, obtain the mobile position and the sign bit of the N group displacement coefficient of forming each coefficient in each group direct transform coefficient for each the group direct transform coefficient in the ROT direct transform matrix, wherein N is a natural number; For the M group displacement coefficient in the N group displacement coefficient; Shifting function is carried out to the matrix coefficient behind the dct transform in mobile position according to M group displacement coefficient; And the sign bit of said M group displacement coefficient judged, obtain the intermediate object program of shifting function according to said judged result; The intermediate object program of the shifting function that will obtain according to the M group displacement coefficient of each coefficient adds up, and obtains M accumulation result; After all N accumulation result additions, obtain the conversion coefficient that the matrix coefficient of each group direct transform coefficient after to said dct transform carries out the ROT direct transform.
Step 403: after the conversion coefficient after the said ROT direct transform quantized, the conversion coefficient after relatively quantizing according to each group calculated the distortion situation of the output signal that obtains.
Step 404: selecting the minimum pairing ROT direct transform of the output signal matrix of distortion is the optimum ROT direct transform matrix of present encoding piece, encodes according to said optimum ROT direct transform matrix.
Referring to Fig. 5, be the embodiment flow chart of the application's coding/decoding method:
Step 501: from input code flow, obtain the conversion coefficient after the quantification that obtains in the cataloged procedure.
Step 502: the conversion coefficient to after quantizing carries out the ROT inverse transformation respectively according to some groups of preset ROT inverse-transform matrixs; Matrix coefficient behind the acquisition dct transform; Each coefficient in the ROT inverse-transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed.
Wherein, some groups of ROT inverse-transform matrixs are specially four groups of ROT inverse-transform matrixs.Each coefficient in the said ROT inverse-transform matrix can be decomposed into the displacement coefficient consistent with preset quantization digit, so that said each coefficient has identical displacement coefficient.Can train each coefficient through training pattern during concrete the realization; When realization is trained each coefficient; Each coefficient for the said training pattern of input; According to preset quantization digit repetition training flow process, obtain the displacement coefficient consistent, so that said each coefficient has identical displacement coefficient with said quantization digit.
Concrete, when carrying out the ROT inverse transformation,, obtaining mobile position and the sign bit of forming the N group displacement coefficient of each coefficient in said each group inverse transformation coefficient for each the group inverse transformation coefficient in the said ROT inverse-transform matrix, said N is a natural number; For the M group displacement coefficient in the said N group displacement coefficient; Shifting function is carried out to the conversion coefficient after quantizing in mobile position according to said M group displacement coefficient; And the sign bit of said M group displacement coefficient judged, obtain the intermediate object program of shifting function according to said judged result; The intermediate object program of the shifting function that will obtain according to the M group displacement coefficient of each coefficient adds up, and obtains M accumulation result; After all N accumulation result additions, obtain the conversion coefficient that the conversion coefficient of each group inverse transformation coefficient after to said quantification carries out the ROT inverse transformation.
Step 503: the matrix coefficient behind the dct transform is carried out the DCT inverse transformation.
Step 504: the matrix coefficient according to after the DCT inverse transformation is decoded.
Can know by foregoing description; During the ROT map function of the application embodiment in realizing the Code And Decode process, owing in advance the coefficient in the ROT transformation matrix is trained according to preset training pattern, therefore can be when the hardware realization of carrying out the ROT conversion according to training result; Convert multiply operation into shifting function and add operation; Because need not to design a large amount of multipliers carries out multiply operation, therefore reduced hard-wired complexity, and the needed clock number of ROT conversion; And because each coefficient in the ROT transformation matrix is through after training; Needed shift count is all consistent with the addition number of times in computational process; Be that each coefficient needed clock number when carrying out multiply operation is consistent; Therefore compared with prior art, can not cause the waste of calculation resources in the encoding-decoding process, improve operation efficiency.
When using the application embodiment and carrying out Code And Decode, aligning the quantization digit that transformation matrix and inverse-transform matrix quantize can have multiple combination.According to result of the test, several kinds of compound modes that are listed below, cited combination is an example with 8 * 8 matrixes still, and each matrix provides four groups of coefficients:
First kind of compound mode: the direct transform matrix adopts 5 quantifications, and inverse-transform matrix adopts 3 quantifications.Need to prove that to result of the test, the result optimal of this compound mode can be obtained a good balance between coding and decoding efficient and hardware realization.
Wherein, g_INV_ROT_MATRIX_8 is the inverse-transform matrix of 3 half quantifications of use of correspondence, and its four groups of transformation matrix coefficients are:
const?Int?g_INV_ROT_MATRIX_8[4][36]=
[252,-36,-31,24,240,-94,48,96,240,240,-100,3,100,240,-25,7,24,255,252,-36,-31,24,240,-94,48,96,240,240,-100,3,100,240,-25,7,24,255;
244,-61,-50,-80,-232,-96,-25,94,-240,254,-28,-18,24,249,-56,24,56,249,244,-61,-50,-80,-232,-96,-25,94,-240,254,-28,-18,24,249,-56,24,56,249;
244,-80,12,80,232,-72,12,72,248,252,-48,-9,-48,-252,-28,-4,29,-254,244,-80,12,80,232,-72,12,72,248,252,-48,-9,-48,-252,-28,-4,29,-254;
192,-192,24,192,160,-96,49,80,240,240,-100,-10,-100,-240,-25,1,28,-255,192,-192,24,192,160,-96,49,80,240,240,-100,-10,-100,-240,-25,1,28,-255;]
ROT_shift_INV_8_m is the figure place of the m time displacement of inverse transformation, and ROT_shift_INV_8_1 is the figure place that is shifted for the first time, then
const?Int?ROT_shift_INV_8_1_[4][36]=
{
{8,5,5,4,8,7,5,6,8,8,7,2,7,8,5,3,5,8,8,5,5,4,8,7,5,6,8,8,7,2,7,8,5,3,5,8,},
{8,6,6,6,8,6,5,7,8,8,5,4,4,8,6,5,6,8,8,6,6,6,8,6,5,7,8,8,5,4,4,8,6,5,6,8,},
{8,6,4,6,8,6,3,6,8,8,5,3,5,8,5,2,5,8,8,6,4,6,8,6,3,6,8,8,5,3,5,8,5,2,5,8,},
{7,8,4,7,7,6,6,6,8,8,7,3,7,8,5,0,5,8,7,8,4,7,7,6,6,6,8,8,7,3,7,8,5,0,5,8,},
};
ROT_shift_INV_8_2 is the figure place that is shifted for the second time, then
const?Int?ROT_shift_INV_8_2[4][36]=
{
{2,2,0,3,4,5,3,5,4,4,5,0,5,4,3,0,3,0,2,2,0,3,4,5,3,5,4,4,5,0,5,4,3,0,3,0,},
{4,2,4,3,5,4,3,5,4,1,2,1,3,3,3,3,3,3,4,2,4,3,5,4,3,5,4,1,2,1,3,3,3,3,3,3,},
{4,4,2,4,5,3,2,3,3,2,3,0,3,2,2,0,2,1,4,4,2,4,5,3,2,3,3,2,3,0,3,2,2,0,2,1,},
{5,6,3,6,5,4,4,3,4,4,5,1,5,4,3,0,2,0,5,6,3,6,5,4,4,3,4,4,5,1,5,4,3,0,2,0,},
};
ROT_shift_INV_8_3 is the figure place that is shifted for the third time, then
const?Int?ROT_shift_INV_8_3[4][36]=
{
{0,0,0,0,2,1,1,3,2,2,2,0,2,3,0,0,0,0,0,0,0,0,2,1,1,3,2,2,2,0,2,3,0,0,0,0,},
{2,0,1,2,3,2,0,1,2,0,0,0,1,0,0,0,1,0,2,0,1,2,3,2,0,1,2,0,0,0,1,0,0,0,1,0,},
{2,0,0,0,3,1,0,0,1,0,0,0,1,0,0,0,0,0,2,0,0,0,3,1,0,0,1,0,0,0,1,0,0,0,0,0,},
{4,3,0,3,1,3,0,2,0,2,2,0,2,2,0,0,0,0,4,3,0,3,1,3,0,2,0,2,2,0,2,2,0,0,0,0,},
};
Sign_INV_8_1 is be shifted the for the first time sign bit of ROT_shift_INV_8_1 of inverse-transform matrix, then
const?Int?sign_INV_8_1[4][36]=
{
{1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1,},
{1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1,},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,},
};
Sign_INV_8_2 is be shifted the for the second time sign bit of ROT_shift_INV_8_2 of inverse-transform matrix, then
const?Int?sign_INV_8_2[4][36]=
{
{-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,},
{-1,1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,-1,-1,-1,1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,-1,-1,},
{-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,0,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,0,-1,1,},
{1,1,1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,0,-1,1,1,1,1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,0,-1,1,},
};
Sign_INV_8_3 is be shifted the for the third time sign bit of ROT_shift_INV_8_3 of inverse-transform matrix, then
const?Int?sign_INV_8_3[4][36]=
{
{-1,0,0,-1,-1,1,1,-1,-1,-1,-1,0,1,-1,-1,0,0,0,-1,0,0,-1,-1,1,1,-1,-1,-1,-1,0,1,-1,-1,0,0,0,},
{1,-1,-1,-1,-1,-1,-1,-1,1,0,1,0,-1,1,0,0,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1,0,1,0,-1,1,0,0,-1,1,},
{1,-1,0,1,1,1,-1,-1,-1,0,-1,0,-1,1,0,0,1,0,1,-1,0,1,1,1,-1,-1,-1,0,-1,0,-1,1,0,0,1,0,},
{1,1,-1,-1,-1,-1,1,1,0,-1,-1,0,-1,1,-1,0,-1,0,1,1,-1,-1,-1,-1,1,1,0,-1,-1,0,-1,1,-1,0,-1,0,},
};
Wherein, g_FWD_ROT_MATRIX_8 is the direct transform matrix of 5 half quantifications of use of correspondence, and its four groups of transformation matrix coefficients are:
const?Int?g_FWD_ROT_MATRIX_8[4][36]=
[4008,-624,-560,352,3728,-1560,656,1408,3688,3728,-1548,44,1541,3688,-390,108,380,4074,4008,-624,-560,352,3728,-1560,656,1408,3688,3728,-1548,44,1541,3688,-390,108,380,4074;
3888,-1008,-799,-1160,-3588,-1284,-352,1648,-3696,4058,-456,-289,372,3967,-928,377,864,3982,3888,-1008,-799,-1160,-3588,-1284,-352,1648,-3696,4058,-456,-289,372,3967,-928,377,864,3982;
3870,-1278,184,1278,3728,-1144,184,1144,3887,4016,-752,-152,-771,-3965,-441,-57,464,-4076,3870,-1278,184,1278,3728,-1144,184,1144,3887,4016,-752,-152,-771,-3965,-441,-57,464,-4076;
2572,-2848,420,2688,2512,-1408,816,1286,3774,3728,-1535,-154,-1551,-3680,-412,6,424,-4066,2572,-2848,420,2688,2512,-1408,816,1286,3774,3728,-1535,-154,-1551,-3680,-412,6,424,-4066;]
ROT_shift_FWD_8_m is the figure place of the m time displacement of direct transform, and ROT_shift_FWD_8_1 is the figure place that is shifted for the first time, then
const?Int?ROT_shift_FWD_8_1[4][36]=
{
{12,9,9,8,12,11,9,10,12,12,11,6,11,12,9,7,9,12,12,9,9,8,12,11,9,10,12,12,11,6,11,12,9,7,9,12,},
{12,10,10,10,12,10,9,11,12,12,9,8,8,12,10,9,10,12,12,10,10,10,12,10,9,11,12,12,9,8,8,12,10,9,10,12,},
{12,10,8,10,12,10,7,10,12,12,9,7,9,12,9,6,9,12,12,10,8,10,12,10,7,10,12,12,9,7,9,12,9,6,9,12,},
{11,12,9,11,11,10,10,10,12,12,11,7,11,12,9,3,9,12,11,12,9,11,11,10,10,10,12,12,11,7,11,12,9,3,9,12,},
};
ROT_shift_FWD_8_2 is the figure place that is shifted for the second time, then
const?Int?ROT_shift_8_2[4][36]=
{
{6,6,4,7,8,9,7,9,8,8,9,4,9,8,7,4,7,5,6,6,4,7,8,9,7,9,8,8,9,4,9,8,7,4,7,5,},
{8,5,8,7,9,8,7,9,8,5,6,5,7,7,7,7,7,7,8,5,8,7,9,8,7,9,8,5,6,5,7,7,7,7,7,7,},
{8,8,6,8,8,7,6,7,7,6,7,3,7,6,6,2,5,4,8,8,6,8,8,7,6,7,7,6,7,3,7,6,6,2,5,4,},
{9,10,7,10,9,8,8,8,8,8,9,5,9,9,7,0,6,5,9,10,7,10,9,8,8,8,8,8,9,5,9,9,7,0,6,5,},
};
ROT_shift_FWD_8_3 is the figure place that is shifted for the third time, then
const?Int?ROT_shift_8_3[4][36]=
{
{0,4,0,4,5,6,5,7,6,6,6,0,6,6,4,1,3,3,0,4,0,4,5,6,5,7,6,6,6,0,6,6,4,1,3,3,},
{6,3,5,5,6,6,4,5,5,1,4,3,5,3,0,3,5,4,6,3,5,5,6,6,4,5,5,1,4,3,5,3,0,3,5,4,},
{4,3,3,4,7,4,4,5,5,4,4,2,5,4,0,1,4,3,4,3,3,4,7,4,4,5,5,4,4,2,5,4,0,1,4,3,},
{8,6,2,8,3,7,3,6,4,6,5,3,6,7,4,0,4,1,8,6,2,8,3,7,3,6,4,6,5,3,6,7,4,0,4,1,},
};
ROT_shift_FWD_8_4 is the figure place of the 4th displacement, then
const?Int?ROT_shift_8_4[4][36]=
{
{0,0,0,2,3,4,1,5,3,4,4,0,3,3,0,0,1,0,0,0,0,2,3,4,1,5,3,4,4,0,3,3,0,0,1,0,},
{4,0,2,0,1,4,1,2,3,0,3,2,3,1,0,1,0,2,4,0,2,0,1,4,1,2,3,0,3,2,3,1,0,1,0,2,},
{2,0,0,2,4,1,2,2,2,0,3,0,1,0,0,0,1,1,2,0,0,2,4,1,2,2,2,0,3,0,1,0,0,0,1,1,},
{6,2,0,5,2,4,1,3,0,3,4,0,2,4,0,0,2,0,6,2,0,5,2,4,1,3,0,3,4,0,2,4,0,0,2,0,},
};
ROT_shift_FWD_8_5 is the figure place of the 5th displacement, then
const?Int?ROT_shift_8_5[4][36]=
{
{0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,},
{0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,},
{0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,},
{4,0,0,1,0,2,0,0,0,0,2,0,0,2,0,0,0,0,4,0,0,1,0,2,0,0,0,0,2,0,0,2,0,0,0,0,},
};
Sign_FWD_8_1 is be shifted the for the first time sign bit of ROT_shift_FWD_8_1 of direct transform matrix, then
const?Int?sign_8_1[4][36]=
{
{1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1},
{1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1},
};
Sign_FWD_8_2 is be shifted the for the second time sign bit of ROT_shift_FWD_8_2 of direct transform matrix, then
const?Int?sign_8_2[4][36]=
{
{-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,},
{-1,1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,-1,-1,-1,1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,-1,-1,},
{-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,},
{1,1,-1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,0,-1,1,1,1,-1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,0,-1,1,},
};
Sign_FWD_8_3 is be shifted the for the third time sign bit of ROT_shift_FWD_8_3 of direct transform matrix, then
const?Int?sign_8_3[4][36]=
{
{0,-1,-1,-1,-1,1,1,-1,-1,-1,-1,1,1,-1,-1,1,1,1,0,-1,-1,-1,-1,1,1,-1,-1,-1,-1,1,1,-1,-1,1,1,1,},
{1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,1,},
{1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,0,-1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,0,-1,-1,1,},
{1,1,1,-1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,-1,0,-1,-1,1,1,1,-1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,-1,0,-1,-1,},
};
Sign_FWD_8_4 is the sign bit of the 4th displacement of direct transform matrix ROT_shift_FWD_8_4, then
const?Int?sign_8_4[4][36]=
{
{0,1,0,-1,1,-1,1,1,1,-1,-1,0,1,1,0,0,-1,0,0,1,0,-1,1,-1,1,1,1,-1,-1,0,1,1,0,0,-1,0,},
{-1,1,-1,-1,-1,1,-1,1,1,0,1,-1,1,1,0,-1,0,1,-1,1,-1,-1,-1,1,-1,1,1,0,1,-1,1,1,0,-1,0,1,},
{1,0,-1,-1,1,1,1,1,-1,0,-1,0,1,0,0,0,1,-1,1,0,-1,-1,1,1,1,1,-1,0,-1,0,1,0,0,0,1,-1,},
{-1,1,-1,1,-1,1,1,1,-1,-1,-1,0,1,-1,0,0,-1,-1,-1,1,-1,1,-1,1,1,1,-1,-1,-1,0,1,-1,0,0,-1,-1,},
};
Sign_FWD_8_5 is the sign bit of the 5th displacement of direct transform matrix ROT_shift_FWD_8_5, then
const?Int?sign_8_5[4][36]=
{
{0,0,0,0,-1,0,0,1,1,-1,1,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,1,1,-1,1,0,0,0,0,0,0,0,},
{-1,0,1,0,0,0,0,0,0,0,-1,1,-1,0,0,0,0,0,-1,0,1,0,0,0,0,0,0,0,-1,1,-1,0,0,0,0,0,},
{0,0,0,1,-1,0,0,-1,-1,0,1,0,0,0,0,0,0,0,0,0,0,1,-1,0,0,-1,-1,0,1,0,0,0,0,0,0,0,},
{1,-1,0,-1,1,1,0,-1,0,-1,1,0,1,1,0,0,-1,0,1,-1,0,-1,1,1,0,-1,0,-1,1,0,1,1,0,0,-1,0,},
};
Second kind of compound mode: the direct transform matrix adopts 5 quantifications, and inverse-transform matrix adopts 4 quantifications.
Wherein, g_INV_ROT_MATRIX_8 is the inverse-transform matrix of 4 half quantifications of use of correspondence, and its four groups of transformation matrix coefficients are:
const?Int?g_INV_ROT_MATRIX_8[4][36]=
[251,-36,-31,23,236,-94,40,88,236,236,-100,3,100,232,-25,7,24,255,251,-36,-31,23,236,-94,40,88,236,236,-100,3,100,232,-25,7,24,255;
243,-61,-50,-72,-230,-80,-25,94,-236,254,-27,-18,22,249,-56,24,54,249,243,-61,-50,-72,-230,-80,-25,94,-236,254,-27,-18,22,249,-56,24,54,249;
243,-81,12,81,232,-70,11,71,246,252,-40,-9,-40,-251,-28,-4,29,-254,243,-81,12,81,232,-70,11,71,246,252,-40,-9,-40,-251,-28,-4,29,-254;
160,-184,23,176,158,-80,49,72,240,236,-99,-10,-99,-232,-25,1,27,-255,160,-184,23,176,158,-80,49,72,240,236,-99,-10,-99,-232,-25,1,27,-255;]
ROT_shift_INV_8_m is the figure place of the m time displacement of inverse transformation, and ROT_shift_INV_8_1 is the figure place that is shifted for the first time, then
const?Int?ROT_shift_INV_8_1[4][36]=
{
{8,5,5,4,8,6,5,6,8,8,7,1,7,8,5,3,4,8,8,5,5,4,8,6,5,6,8,8,7,1,7,8,5,3,4,8,},
{8,6,6,6,8,6,5,6,8,8,5,4,4,8,6,4,6,8,8,6,6,6,8,6,5,6,8,8,5,4,4,8,6,4,6,8,},
{8,6,3,6,8,6,3,6,8,8,5,3,5,8,5,2,5,8,8,6,3,6,8,6,3,6,8,8,5,3,5,8,5,2,5,8,},
{7,7,4,7,7,6,6,6,8,8,7,3,7,8,5,0,5,8,7,7,4,7,7,6,6,6,8,8,7,3,7,8,5,0,5,8,},
};
ROT_shift_INV_8_2 is the figure place that is shifted for the second time, then
const?Int?ROT_shift_INV_8_2[4][36]=
{
{2,2,0,3,4,5,3,5,4,4,5,0,5,4,3,0,3,0,2,2,0,3,4,5,3,5,4,4,5,0,5,4,3,0,3,0,},
{4,1,4,3,5,4,3,5,4,1,2,1,2,3,3,3,3,3,4,1,4,3,5,4,3,5,4,1,2,1,2,3,3,3,3,3,},
{4,4,2,4,4,2,1,3,3,2,3,0,3,2,2,0,1,1,4,4,2,4,4,2,1,3,3,2,3,0,3,2,2,0,1,1,},
{5,6,3,6,5,4,4,3,4,4,5,1,5,4,3,0,2,0,5,6,3,6,5,4,4,3,4,4,5,1,5,4,3,0,2,0,},
};
ROT_shift_INV_8_3 is the figure place that is shifted for the third time, then
const?Int?ROT_shift_INV_8_3[4][36]= //optimal
{
{0,0,0,1,1,1,2,2,2,2,0,2,2,0,0,0,0,0,0,0,0,1,1,1,2,2,2,2,0,2,2,0,0,0,0,},
{0,1,1,2,1,0,1,1,0,0,0,1,0,0,0,1,0,1,0,1,1,2,1,0,1,1,0,0,0,1,0,0,0,1,0,},
{0,0,0,3,1,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,3,1,0,0,1,0,0,0,1,0,0,0,0,0,},
{2,0,3,1,3,0,1,0,2,1,0,1,2,0,0,0,0,4,2,0,3,1,3,0,1,0,2,1,0,1,2,0,0,0,0,},
};
ROT_shift_INV_8_4 is the figure place of the 4th displacement, then
const?Int?ROT_shift_INV_8_4[4][36]=
{
{0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,},
{0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},
{1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},
};
Sign_INV_8_1 is be shifted the for the first time sign bit of ROT_shift_INV_8_1 of inverse-transform matrix, then
const?Int?sign_INV_8_1[4][36]= //optimal
{
{1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1,},
{1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1,},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,},
};
Sign_INV_8_2 is be shifted the for the second time sign bit of ROT_shift_INV_8_2 of inverse-transform matrix, then
const?Int?sign_INV_8_2[4][36]= //optimal
{
{-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,-1,},
{-1,1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,-1,-1,},
{-1,-1,1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,0,-1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,0,-1,1,},
{1,-1,1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,0,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,0,-1,1,},
};
Sign_INV_8_3 is be shifted the for the second time sign bit of ROT_shift_INV_8_3 of inverse-transform matrix, then
const?Int?sign_INV_8_3[4][36]=
{
{-1,0,0,-1,-1,1,1,-1,-1,-1,-1,0,1,-1,-1,0,0,0,-1,0,0,-1,-1,1,1,-1,-1,-1,-1,0,1,-1,-1,0,0,0,},
{1,1,-1,-1,-1,-1,-1,-1,1,0,1,0,1,1,0,0,-1,1,1,1,-1,-1,-1,-1,-1,-1,1,0,1,0,1,1,0,0,-1,1,},
{1,-1,0,1,-1,-1,1,-1,-1,0,-1,0,-1,1,0,0,-1,0,1,-1,0,1,-1,-1,1,-1,-1,0,-1,0,-1,1,0,0,-1,0,},
{1,1,-1,-1,-1,-1,1,1,0,-1,-1,0,-1,1,-1,0,-1,0,1,1,-1,-1,-1,-1,1,1,0,-1,-1,0,-1,1,-1,0,-1,0,},
};
Sign_INV_8_4 is be shifted the for the second time sign bit of ROT_shift_INV_8_4 of inverse-transform matrix, then
const?Int?sign_INV_8_4[4][36]=
{
{0,0,0,0,-1,0,0,-1,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,-1,0,0,-1,0,0,0,0,0,-1,0,0,0,0,},
{1,0,0,-1,-1,-1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,-1,-1,-1,0,0,1,0,0,0,0,0,0,0,0,0,},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},
{-1,1,0,-1,0,1,0,1,0,0,-1,0,-1,1,0,0,0,0,-1,1,0,-1,0,1,0,1,0,0,-1,0,-1,1,0,0,0,0,},
};
Wherein, g_FWD_ROT_MATRIX_8 is the direct transform matrix of 5 half quantifications of use of correspondence, and its four groups of transformation matrix coefficients are:
const?Int?g_FWD_ROT_MATRIX_8[4][36]=
[4037,-580,-468,368,3816,-1488,704,1472,3792,3776,-1616,49,1608,3784,-400,113,390,4072,4037,-580,-468,368,3816,-1488,704,1472,3792,3776,-1616,49,1608,3784,-400,113,390,4072;
3920,-952,-793,-1216,-3711,-1408,-420,1472,-3824,4062,-432,-304,360,3978,-897,376,864,3988,3920,-952,-793,-1216,-3711,-1408,-420,1472,-3824,4062,-432,-304,360,3978,-897,376,864,3988;
3876,-1292,200,1296,3728,-1136,180,1124,3936,4056,-632,-136,-656,-4024,-449,-72,466,-4074,3876,-1292,200,1296,3728,-1136,180,1124,3936,4056,-632,-136,-656,-4024,-449,-72,466,-4074;
2936,-3104,336,3080,2512,-1408,752,1136,3880,3776,-1592,-154,-1608,-3792,-408,10,434,-4066,2936,-3104,336,3080,2512,-1408,752,1136,3880,3776,-1592,-154,-1608,-3792,-408,10,434,-4066;]
ROT_shift_FWD_8_1 is the figure place that the direct transform matrix is shifted for the first time, then
const?Int?ROT_shift_FWD_8_1[4][36]=
{
{12,9,9,8,12,10,9,10,12,12,11,5,11,12,9,7,8,12,12,9,9,8,12,10,9,10,12,12,11,5,11,12,9,7,8,12,},
{12,10,10,10,12,10,9,10,12,12,9,8,8,12,10,8,10,12,12,10,10,10,12,10,9,10,12,12,9,8,8,12,10,8,10,12,},
{12,10,8,10,12,10,7,10,12,12,9,7,9,12,9,6,9,12,12,10,8,10,12,10,7,10,12,12,9,7,9,12,9,6,9,12,},
{11,11,8,11,11,10,10,10,12,12,11,7,11,12,9,3,9,12,11,11,8,11,11,10,10,10,12,12,11,7,11,12,9,3,9,12,},
};
ROT_shift_FWD_8_2 is the figure place that the direct transform matrix is shifted for the second time, then
const?Int?ROT_shift_FWD_8_2[4][36]=
{
{6,6,4,7,8,9,7,9,8,8,9,4,9,8,7,4,7,4,6,6,4,7,8,9,7,9,8,8,9,4,9,8,7,4,7,4,},
{7,5,8,7,9,8,7,9,8,5,6,5,7,7,7,7,7,7,7,5,8,7,9,8,7,9,8,5,6,5,7,7,7,7,7,7,},
{8,8,6,8,8,7,6,7,7,5,7,3,7,6,6,2,5,4,8,8,6,8,8,7,6,7,7,5,7,3,7,6,6,2,5,4,},
{9,10,7,10,9,8,8,7,8,8,9,4,9,8,7,0,6,5,9,10,7,10,9,8,8,7,8,8,9,4,9,8,7,0,6,5,},
};
ROT_shift_FWD_8_3 is the figure place that the direct transform matrix is shifted for the third time, then
const?Int_ROT_shift_FWD_8_3[4][36]=//optimal
{
{0,3,1,5,6,5,5,7,6,6,6,0,6,6,4,0,2,3,0,3,1,5,6,5,5,7,6,6,6,0,6,6,4,0,2,3,},
{6,3,5,5,7,6,4,5,6,1,4,3,5,3,0,3,5,4,6,3,5,5,7,6,4,5,6,1,4,3,5,3,0,3,5,4,},
{5,4,3,4,7,4,3,5,5,4,4,2,5,4,0,1,4,3,5,4,3,4,7,4,3,5,5,4,4,2,5,4,0,1,4,3,},
{8,6,4,7,4,7,4,6,3,6,5,3,6,6,4,0,4,1,8,6,4,7,4,7,4,6,3,6,5,3,6,6,4,0,4,1,},
};
ROT_shift_FWD_8_4 is the figure place of the 4th displacement of direct transform matrix, then
const?Int?ROT_shift_FWD_8_4[4][36]=
{
{0,2,0,2,4,2,0,5,0,4,2,0,2,4,1,0,0,0,0,2,0,2,4,2,0,5,0,4,2,0,2,4,1,0,0,0,},
{0,0,1,4,5,3,2,2,3,0,2,2,3,1,0,1,0,2,0,0,1,4,5,3,2,2,3,0,2,2,3,1,0,1,0,2,},
{1,2,0,1,4,1,2,1,2,0,2,0,1,0,0,0,1,1,1,2,0,1,4,1,2,1,2,0,2,0,1,0,0,0,1,1,},
{5,4,0,5,2,4,0,3,0,0,3,0,3,5,2,0,1,0,5,4,0,5,2,4,0,3,0,0,3,0,3,5,2,0,1,0,},
};
ROT_shift_FWD_8_5 is the figure place of the 5th displacement of direct transform matrix, then
const?Int?ROT_shift_FWD_8_5[4][36]=
{
{0,0,0,0,0,0,0,3,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,2,0,0,0,0,},
{0,0,0,0,2,0,0,1,2,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,2,0,1,0,0,0,0,0,0,0,},
{0,0,0,0,2,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,1,0,0,0,0,0,0,0,},
{3,1,0,4,1,3,0,0,0,0,0,0,1,2,0,0,0,0,3,1,0,4,1,3,0,0,0,0,0,0,1,2,0,0,0,0,},
};
Sign_FWD_8_1 is be shifted the for the first time sign bit of ROT_shift_FWD_8_1 of direct transform matrix, then
const?Int_sign_FWD_8_1[4][36]=
{
{1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1},
{1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1},
};
Sign_FWD_8_2 is be shifted the for the second time sign bit of ROT_shift_FWD_8_2 of direct transform matrix, then
const?Int_FWD_sign_8_2[4][36]=//optimal
{
{-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,-1,},
{-1,1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,-1,-1,},
{-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,},
{1,-1,1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,0,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,0,-1,1,},
};
Sign_FWD_8_3 is be shifted the for the third time sign bit of ROT_shift_FWD_8_3 of direct transform matrix, then
const?Int_sign_FWD_8_3[4][36]=//optimal
{
{0,-1,1,-1,-1,1,1,-1,-1,-1,-1,0,1,-1,-1,0,1,-1,0,-1,1,-1,-1,1,1,-1,-1,-1,-1,0,1,-1,-1,0,1,-1,},
{-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,1,},
{1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,-1,1,0,-1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,-1,1,0,-1,-1,1,},
{1,1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,1,-1,0,-1,-1,1,1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,1,-1,0,-1,-1,},
};
Sign_FWD_8_4 is the sign bit of the 4th displacement of direct transform matrix ROT_shift_FWD_8_4, then
const?Int_sign_FWD_8_4[4][36]=
{
{0,-1,0,1,1,-1,0,1,1,-1,-1,0,-1,-1,1,0,-1,0,0,-1,0,1,1,-1,0,1,1,-1,-1,0,-1,-1,1,0,-1,0,},
{0,0,-1,-1,1,1,-1,-1,-1,0,1,-1,1,1,0,-1,0,1,0,0,-1,-1,1,1,-1,-1,-1,0,1,-1,1,1,0,-1,0,1,},
{1,1,0,1,1,1,-1,1,-1,0,-1,0,1,0,0,0,1,-1,1,1,0,1,1,1,-1,1,-1,0,-1,0,1,0,0,0,1,-1,},
{-1,1,1,-1,-1,1,0,-1,0,0,-1,0,1,1,-1,0,-1,0,-1,1,1,-1,-1,1,0,-1,0,0,-1,0,1,1,-1,0,-1,0,},
};
Sign_FWD_8_5 is the sign bit of the 5th displacement of direct transform matrix ROT_shift_FWD_8_5, then
const?Int_sign_FWD_8_5[4][36]=
{
{0,1,0,1,-1,-1,0,-1,0,1,1,0,0,-1,0,0,0,0,0,1,0,1,-1,-1,0,-1,0,1,1,0,0,-1,0,0,0,0,},
{0,0,0,0,-1,0,1,-1,-1,0,1,1,-1,0,0,0,0,0,0,0,0,0,-1,0,1,-1,-1,0,1,1,-1,0,0,0,0,0,},
{0,0,0,0,-1,1,0,1,-1,0,-1,0,0,0,0,0,0,0,0,0,0,0,-1,1,0,1,-1,0,-1,0,0,0,0,0,0,0,},
{-1,-1,0,-1,-1,1,0,-1,0,0,1,0,1,-1,1,0,0,0,-1,-1,0,-1,-1,1,0,-1,0,0,1,0,1,-1,1,0,0,0,},
};
The third compound mode: the direct transform matrix still adopts 5 quantifications, and inverse-transform matrix still adopts 4 quantifications.Be that with the different of second kind of compound mode wherein sign bit only can represent that just sign bit does not get zero with 1 or-1.
Wherein, g_FWD_ROT_MATRIX_8 is the direct transform matrix of 5 half quantifications of use of correspondence, and its four groups of transformation matrix coefficients are:
const?Int?g_FWD_ROT_MATRIX_8[4][36]=
{
{4032,-587,-494,357,3791,-1509,672,1432,3777,3762,-1603,48,1597,3756,-397,112,387,4073,4032,-587,-494,357,3791,-1509,672,1432,3777,3762,-1603,48,1597,3756,-397,112,387,4073,},
{3903,-983,-802,-1200,-3684,-1335,-403,1498,-3788,4062,-426,-299,359,3978,-897,374,864,3988,3903,-983,-802,-1200,-3684,-1335,-403,1498,-3788,4062,-426,-299,359,3978,-897,374,864,3988,},
{3874,-1292,200,1298,3724,-1133,180,1123,3930,4048,-662,-139,-669,-4016,-448,-70,466,-4074,3874,-1292,200,1298,3724,-1133,180,1123,3930,4048,-662,-139,-669,-4016,-448,-70,466,-4074,},
{2776,-2994,369,2896,2538,-1384,784,1207,3832,3776,-1575,-152,-1590,-3748,-403,8,429,-4067,2776,-2994,369,2896,2538,-1384,784,1207,3832,3776,-1575,-152,-1590,-3748,-403,8,429,-4067,},
};
ROT_shift_FWD_8_1 is the figure place that the direct transform matrix is shifted for the first time, then
const?Int_ROT_shift_FWD_8_1[4][36]=
{
{12,9,9,8,12,10,9,10,12,12,11,5,11,12,9,7,8,12,12,9,9,8,12,10,9,10,12,12,11,5,11,12,9,7,8,12,},
{12,10,10,10,12,10,9,10,12,12,9,8,8,12,10,8,10,12,12,10,10,10,12,10,9,10,12,12,9,8,8,12,10,8,10,12,},
{12,10,8,10,12,10,7,10,12,12,9,7,9,12,9,6,9,12,12,10,8,10,12,10,7,10,12,12,9,7,9,12,9,6,9,12,},
{11,11,8,11,11,10,10,10,12,12,11,7,11,12,9,3,9,12,11,11,8,11,11,10,10,10,12,12,11,7,11,12,9,3,9,12,},
};
ROT_shift_FWD_8_2 is the figure place that the direct transform matrix is shifted for the second time, then
const?Int_ROT_shift_FWD_8_2[4][36]=
{
{6,6,4,7,8,9,7,9,8,8,9,4,9,8,7,4,7,4,6,6,4,7,8,9,7,9,8,8,9,4,9,8,7,4,7,4,},
{7,5,8,7,9,8,7,9,8,5,6,5,7,7,7,7,7,7,7,5,8,7,9,8,7,9,8,5,6,5,7,7,7,7,7,7,},
{8,8,6,8,8,7,6,7,7,5,7,3,7,6,6,2,5,4,8,8,6,8,8,7,6,7,7,5,7,3,7,6,6,2,5,4,},
{9,10,7,10,9,8,8,7,8,8,9,4,9,8,7,0,6,5,9,10,7,10,9,8,8,7,8,8,9,4,9,8,7,0,6,5,},
}
ROT_shift_FWD_8_3 is the figure place that the direct transform matrix is shifted for the third time, then
const?Int_ROT_shift_FWD_8_3[4][36]=
{
{0,3,1,5,6,5,5,7,6,6,6,0,6,6,4,0,1,3,0,3,1,5,6,5,5,7,6,6,6,0,6,6,4,0,1,3,},
{6,3,5,5,7,6,4,5,6,1,4,3,5,3,0,3,5,4,6,3,5,5,7,6,4,5,6,1,4,3,5,3,0,3,5,4,},
{5,4,3,4,7,4,3,5,5,4,4,1,5,4,0,1,4,2,5,4,3,4,7,4,3,5,5,4,4,1,5,4,0,1,4,2,},
{8,6,4,7,4,7,4,6,3,6,5,3,6,6,4,0,4,1,8,6,4,7,4,7,4,6,3,6,5,3,6,6,4,0,4,1,},
}
ROT_shift_FWD_8_4 is the figure place of the 4th displacement of direct transform matrix, then
const?Int?ROT_shift_FWD_8_4[4][36]=
{
{0,1,0,2,4,2,0,5,0,4,2,0,1,4,1,0,0,0,0,1,0,2,4,2,0,5,0,4,2,0,1,4,1,0,0,0,},
{0,0,1,4,5,3,1,2,3,0,2,1,3,1,0,1,0,2,0,0,1,4,5,3,1,2,3,0,2,1,3,1,0,1,0,2,},
{1,2,0,1,4,1,2,1,2,0,2,0,1,0,0,0,1,1,1,2,0,1,4,1,2,1,2,0,2,0,1,0,0,0,1,1,},
{5,4,0,5,2,4,0,3,0,0,3,0,3,5,1,0,1,0,5,4,0,5,2,4,0,3,0,0,3,0,3,5,1,0,1,0,},
}
ROT_shift_FWD_8_5 is the figure place of the 5th displacement of direct transform matrix, then
const?Int?ROT_shift_FWD_8_5[4][36]=
{
{0,0,0,0,0,0,0,3,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,2,0,0,0,0,},
{0,0,0,0,2,0,0,1,2,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,2,0,1,0,0,0,0,0,0,0,},
{0,0,0,0,2,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,1,0,0,0,0,0,0,0,},
{3,1,0,4,1,3,0,0,0,0,0,0,1,2,0,0,0,0,3,1,0,4,1,3,0,0,0,0,0,0,1,2,0,0,0,0,},
};
Sign_FWD_8_1 is be shifted the for the first time sign bit of ROT_shift_FWD_8_1 of direct transform matrix, then
const?Int?sign_FWD_8_1[4][36]=
{
{1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1,},
{1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1,},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,},
};
Sign_FWD_8_2 is be shifted the for the second time sign bit of ROT_shift_FWD_8_2 of direct transform matrix, then
const?Int?sign_FWD_8_2[4][36]=
{
{-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,-1,},
{-1,1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,-1,-1,},
{-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,},
{1,-1,1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,-1,-1,1,},
};
Sign_FWD_8_3 is be shifted the for the third time sign bit of ROT_shift_FWD_8_3 of direct transform matrix, then
const?Int?sign_FWD_8_3[4][36]=
{
{-1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,-1,-1,1,1,-1,},
{-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,1,},
{1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,},
{1,1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,},
};
Sign_FWD_8_4 is the sign bit of the 4th displacement of direct transform matrix ROT_shift_FWD_8_4, then
const?Int?sign_FWD_8_4[4][36]=
{
{-1,-1,1,1,1,-1,-1,1,1,-1,-1,1,-1,-1,1,-1,1,1,-1,-1,1,1,1,-1,-1,1,1,-1,-1,1,-1,-1,1,-1,1,1,},
{-1,1,-1,-1,1,1,-1,-1,-1,1,1,-1,1,1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,-1,1,1,-1,1,1,-1,-1,-1,1,},
{1,1,-1,1,1,1,-1,1,-1,1,-1,-1,1,1,1,1,1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,-1,1,1,1,1,1,1,},
{-1,1,1,-1,-1,1,-1,-1,-1,1,-1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,-1,1,1,1,-1,-1,-1,-1,},
};
Sign_FWD_8_5 is the sign bit of the 5th displacement of direct transform matrix ROT_shift_FWD_8_5, then
const?Int?sign_FWD_8_5[4][36]=
{
{-1,-1,1,1,-1,-1,-1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,},
{1,1,-1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,1,-1,},
{1,-1,-1,1,-1,1,1,1,-1,-1,-1,1,1,1,-1,1,-1,-1,1,-1,-1,1,-1,1,1,1,-1,-1,-1,1,1,1,-1,1,-1,-1,},
{-1,-1,-1,-1,-1,1,1,-1,-1,-1,1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,-1,1,-1,1,-1,-1,-1,-1,-1,},
};
Wherein, g_INV_ROT_MATRIX_8 is the inverse-transform matrix of 4 half quantifications of use of correspondence, and its four groups of transformation matrix coefficients are:
const?Int_g_INV_ROT_MATRIX_8[4][36]=
{
{251,-36,-31,23,237,-94,42,90,236,236,-100,3,100,234,-25,7,24,255,251,-36,-31,23,237,-94,42,90,236,236,-100,3,100,234,-25,7,24,255,},
{243,-61,-50,-75,-230,-83,-25,94,-237,254,-27,-18,22,249,-56,24,54,249,243,-61,-50,-75,-230,-83,-25,94,-237,254,-27,-18,22,249,-56,24,54,249,},
{243,-81,12,81,232,-70,11,71,246,252,-41,-9,-42,-251,-28,-4,29,-254,243,-81,12,81,232,-70,11,71,246,252,-41,-9,-42,-251,-28,-4,29,-254,},
{174,-186,23,182,158,-87,49,75,240,236,-99,-10,-99,-235,-25,1,27,-255,174,-186,23,182,158,-87,49,75,240,236,-99,-10,-99,-235,-25,1,27,-255,},
};
ROT_shift_INV_8_m is the figure place of the m time displacement of inverse transformation, and ROT_shift_INV_8_1 is the figure place that is shifted for the first time, then
const?Int?ROT_shift_INV_8_1[4][36]=
{
{8,5,5,4,8,6,5,6,8,8,7,1,7,8,5,3,4,8,8,5,5,4,8,6,5,6,8,8,7,1,7,8,5,3,4,8,},
{8,6,6,6,8,6,5,6,8,8,5,4,4,8,6,4,6,8,8,6,6,6,8,6,5,6,8,8,5,4,4,8,6,4,6,8,},
{8,6,3,6,8,6,3,6,8,8,5,3,5,8,5,2,5,8,8,6,3,6,8,6,3,6,8,8,5,3,5,8,5,2,5,8,},
{7,7,4,7,7,6,6,6,8,8,7,3,7,8,5,0,5,8,7,7,4,7,7,6,6,6,8,8,7,3,7,8,5,0,5,8,},
};
ROT_shift_INV_8_2 is the figure place that is shifted for the second time, then
const?Int?ROT_shift_INV_8_2[4][36]=
{
{2,2,0,3,4,5,3,5,4,4,5,0,5,4,3,0,3,0,2,2,0,3,4,5,3,5,4,4,5,0,5,4,3,0,3,0,},
{4,1,4,3,5,4,3,5,4,1,2,1,2,3,3,3,3,3,4,1,4,3,5,4,3,5,4,1,2,1,2,3,3,3,3,3,}
{4,4,2,4,4,2,1,3,3,2,3,0,3,2,2,0,1,1,4,4,2,4,4,2,1,3,3,2,3,0,3,2,2,0,1,1,},
{5,6,3,6,5,4,4,3,4,4,5,1,5,4,3,0,2,0,5,6,3,6,5,4,4,3,4,4,5,1,5,4,3,0,2,0,},
};
ROT_shift_INV_8_3 is the figure place that is shifted for the third time, then
const?Int?ROT_shift_INV_8_3[4][36]=//optimal
{
{0,0,0,0,1,1,1,2,2,2,2,0,2,2,0,0,0,0,0,0,0,0,1,1,1,2,2,2,2,0,2,2,0,0,0,0,},
{1,0,1,1,2,1,0,1,1,0,0,0,1,0,0,0,1,0,1,0,1,1,2,1,0,1,1,0,0,0,1,0,0,0,1,0,},
{1,0,0,0,3,1,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,3,1,0,0,1,0,0,0,1,0,0,0,0,0,},
{4,2,0,3,1,3,0,1,0,2,1,0,1,2,0,0,0,0,4,2,0,3,1,3,0,1,0,2,1,0,1,2,0,0,0,0,},
}
ROT_shift_INV_8_4 is the figure place of the 4th displacement, then
const?Int?ROT_shift_INV_8_4[4][36]=//optimal?0.4
{
{0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,},
{0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},
{1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},
}
Sign_INV_8_1 is be shifted the for the first time sign bit of ROT_shift_INV_8_1 of inverse-transform matrix, then
const?Int?sign_INV_8_1[4][36]=//optimal
{
{1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1,},
{1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,1,},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,},
{1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,1,-1,1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,},
};
Sign_INV_8_2 is be shifted the for the second time sign bit of ROT_shift_INV_8_2 of inverse-transform matrix, then
const?Int?sign_INV_8_2[4][36]=//optimal
{
{-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,-1;
{-1,1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,-1,-1;
{-1,-1,1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,1,-1,1;
{1,-1,1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1;]
};
Sign_INV_8_3 is be shifted the for the second time sign bit of ROT_shift_INV_8_3 of inverse-transform matrix, then
const?Int?sign_INV_8_3[4][36]=
{
{-1,1,1,-1,-1,1,1,-1,-1,-1,-1,1,1,-1,-1,1,1,1,-1,1,1,-1,-1,1,1,-1,-1,-1,-1,1,1,-1,-1,1,1,1;
{1,1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1,-1,1,1,1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1,-1,1;
{1,-1,1,1,-1,-1,1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,1,1,-1,-1,1,-1,-1,1,-1,1,-1,1,1,1,-1,1;
{1,1,-1,-1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,1,-1,1,1,1,-1,-1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,1,-1,1;]
};
Sign_INV_8_4 is be shifted the for the second time sign bit of ROT_shift_INV_8_4 of inverse-transform matrix, then
const?Int?sign_INV_8_4[4][36]=
{
{1,1,1,1,-1,1,1,-1,1,1,1,1,1,-1,1,1,1,1,1,1,1,1,-1,1,1,-1,1,1,1,1,1,-1,1,1,1,1,},
{1,1,1,-1,-1,-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,-1,-1,-1,1,1,1,1,1,1,1,1,1,1,1,1,},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,},
{-1,1,1,-1,1,1,1,1,1,1,-1,1,-1,1,1,1,1,1,-1,1,1,-1,1,1,1,1,1,1,-1,1,-1,1,1,1,1,1,},
};
Corresponding with the embodiment of the application's coding staff and coding/decoding method, the application also provides the embodiment of code device and decoding device.
Referring to Fig. 6, be the embodiment block diagram of the application's code device:
This code device comprises: dct transform unit 610, ROT forward transformation unit 620, quantifying unit 630, comparing unit 640 and coding unit 650.
Wherein, dct transform unit 610 is used for input signal is carried out dct transform;
ROT forward transformation unit 620; Be used for the input signal behind the dct transform is carried out the ROT direct transform respectively according to some groups of preset ROT direct transform matrixes; Obtain the conversion coefficient after the ROT direct transform; Each coefficient in the said ROT direct transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed;
Quantifying unit 630 is used for the conversion coefficient after the said ROT direct transform is quantized;
Comparing unit 640 is used for the distortion situation that conversion coefficient after comparison quantizes according to each group calculates the output signal that obtains;
Coding unit 650, being used to select the minimum pairing ROT direct transform of the output signal matrix of distortion is the optimum ROT direct transform matrix of present encoding piece, encodes according to said optimum ROT direct transform matrix.
Further, each coefficient in the said ROT direct transform matrix can be decomposed into the displacement coefficient consistent with preset quantization digit, so that said each coefficient has identical displacement coefficient.When concrete the realization; This code device can also comprise (not shown among Fig. 6): training unit; Be used for each coefficient for the said training pattern of input; According to preset quantization digit repetition training flow process, obtain the displacement coefficient consistent, so that said each coefficient has identical displacement coefficient with said quantization digit.
Concrete, ROT forward transformation unit 620 can comprise (not shown among Fig. 6):
Information acquisition unit is used for each the group direct transform coefficient for said ROT direct transform matrix, obtains mobile position and the sign bit of forming the N group displacement coefficient of each coefficient in said each group direct transform coefficient, and said N is a natural number;
The coefficient operating unit; Be used for M group displacement coefficient for said N group displacement coefficient; Shifting function is carried out to the matrix coefficient behind the dct transform in mobile position based on said M group displacement coefficient; And the sign bit of said M group displacement coefficient judged, obtain the intermediate object program of shifting function based on said judged result;
First unit that adds up, the intermediate object program of the shifting function that is used for the M group displacement coefficient according to each coefficient is obtained adds up, and obtains M accumulation result;
Second unit that adds up is used for after all N the accumulation result addition, obtains the conversion coefficient that the input signal of each group direct transform coefficient after to said dct transform carries out the ROT direct transform.
Referring to Fig. 7, be the embodiment block diagram of the application's decoding device:
This decoding device comprises: acquiring unit 710, ROT inverse transformation block 720, DCT inverse transformation unit 730 and decoding unit 740.
Wherein, acquiring unit 710 is used for the conversion coefficient after input code flow obtains the quantification that obtains the cataloged procedure;
ROT inverse transformation block 720; Be used for the conversion coefficient after the said quantification is carried out the ROT inverse transformation respectively according to some groups of preset ROT inverse-transform matrixs; Matrix coefficient behind the acquisition dct transform; Each coefficient in the said ROT inverse-transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed;
DCT inverse transformation unit 730 is used for the matrix coefficient behind the said dct transform is carried out the DCT inverse transformation;
Decoding unit 740 is used for decoding according to the matrix coefficient after the said DCT inverse transformation.
Further, each coefficient in the said ROT inverse-transform matrix can be decomposed into the displacement coefficient consistent with preset quantization digit, so that said each coefficient has identical displacement coefficient.When concrete the realization; This code device can also comprise (not shown among Fig. 7): training unit; Be used for each coefficient for the said training pattern of input; According to preset quantization digit repetition training flow process, obtain the displacement coefficient consistent, so that said each coefficient has identical displacement coefficient with said quantization digit.
Concrete, ROT inverse transformation block 720 can comprise (not shown among Fig. 7):
Information acquisition unit is used for each the group inverse transformation coefficient for said ROT inverse-transform matrix, obtains mobile position and the sign bit of forming the N group displacement coefficient of each coefficient in said each group inverse transformation coefficient, and said N is a natural number;
The coefficient operating unit; Be used for M group displacement coefficient for said N group displacement coefficient; Shifting function is carried out to the conversion coefficient after quantizing in mobile position based on said M group displacement coefficient; And the sign bit of said M group displacement coefficient judged, obtain the intermediate object program of shifting function based on said judged result;
First unit that adds up, the intermediate object program of the shifting function that is used for the M group displacement coefficient according to each coefficient is obtained adds up, and obtains M accumulation result;
Second unit that adds up is used for after all N the accumulation result addition, obtains the conversion coefficient that the conversion coefficient of each group inverse transformation coefficient after to said quantification carries out the ROT inverse transformation.
Description through to above execution mode can be known; During the ROT map function of the application embodiment in realizing the Code And Decode process; Owing in advance the coefficient in the ROT transformation matrix is trained according to preset training pattern; Therefore can according to training result when the hardware that carries out the ROT conversion is realized, convert multiply operation into shifting function and add operation, carry out multiply operation owing to need not to design a large amount of multipliers; Therefore reduced hard-wired complexity, and the needed clock number of ROT conversion; And because each coefficient in the ROT transformation matrix is through after training; Needed shift count is all consistent with the addition number of times in computational process; Be that each coefficient needed clock number when carrying out multiply operation is consistent; Therefore compared with prior art, can not cause the waste of calculation resources in the encoding-decoding process, improve operation efficiency.
The technology that those skilled in the art can be well understood in the embodiment of the invention can realize by the mode that software adds essential general hardware platform.Based on such understanding; The part that technical scheme in the embodiment of the invention contributes to prior art in essence in other words can be come out with the embodied of software product; This computer software product can be stored in the storage medium, like ROM/RAM, magnetic disc, CD etc., comprises that some instructions are with so that a computer equipment (can be a personal computer; Server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the present invention or embodiment.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, and identical similar part is mutually referring to getting final product between each embodiment, and each embodiment stresses all is the difference with other embodiment.Especially, for system embodiment, because it is basically similar in appearance to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
Above-described embodiment of the present invention does not constitute the qualification to protection range of the present invention.Any modification of within spirit of the present invention and principle, being done, be equal to replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (14)

1. a coding method is characterized in that, comprising:
Input signal is carried out dct transform;
Input signal behind the dct transform is carried out the ROT direct transform respectively according to some groups of preset ROT direct transform matrixes; Obtain the conversion coefficient after the ROT direct transform; Each coefficient in the said ROT direct transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed;
After conversion coefficient after the said ROT direct transform quantized, the conversion coefficient after relatively quantizing based on each group calculated the distortion situation of the output signal that obtains;
Selecting the minimum pairing ROT direct transform of the output signal matrix of distortion is the optimum ROT direct transform matrix of present encoding piece, encodes according to said optimum ROT direct transform matrix.
2. method according to claim 1 is characterized in that, said some groups of ROT direct transform matrixes are specially four groups of ROT direct transform matrixes;
Each coefficient in the said ROT direct transform matrix can be decomposed into several displacement coefficients and comprise:
Each coefficient in the said ROT direct transform matrix can be decomposed into the displacement coefficient consistent with preset quantization digit, so that said each coefficient has identical displacement coefficient.
3. method according to claim 2 is characterized in that, said preset quantization digit is 5, and said four groups of ROT direct transform matrixes are 8 * 8 matrixes, and the coefficient of said four groups of ROT direct transform matrixes comprises:
First group is:
4008,-624,-560,352,3728,-1560,656,1408,3688,3728,-1548,44,1541,3688,-390,108,380,4074,4008,-624,-560,352,3728,-1560,656,1408,3688,3728,-1548,44,1541,3688,-390,108,380,4074;
Second group is:
3888,-1008,-799,-1160,-3588,-1284,-352,1648,-3696,4058,-456,-289,372,3967,-928,377,864,3982,3888,-1008,-799,-1160,-3588,-1284,-352,1648,-3696,4058,-456,-289,372,3967,-928,377,864,3982;
The 3rd group is:
3870,-1278,184,1278,3728,-1144,184,1144,3887,4016,-752,-152,-771,-3965,-441,-57,464,-4076,3870,-1278,184,1278,3728,-1144,184,1144,3887,4016,-752,-152,-771,-3965,-441,-57,464,-4076:
The 4th group is:
2572,-2848,420,2688,2512,-1408,816,1286,3774,3728,-1535,-154,-1551,-3680,-412,6,424,-4066,2572,-2848,420,2688,2512,-1408,816,1286,3774,3728,-1535,-154,-1551,-3680,-412,6,424,-4066。
4. method according to claim 1 is characterized in that, carries out the ROT direct transform according to one group of preset ROT direct transform matrix and comprises:
For each the group direct transform coefficient in the said ROT direct transform matrix, obtain mobile position and the sign bit of forming the N group displacement coefficient of each coefficient in said each group direct transform coefficient, said N is a natural number;
For the M group displacement coefficient in the said N group displacement coefficient; Shifting function is carried out to the matrix coefficient behind the dct transform in mobile position based on said M group displacement coefficient; And the sign bit of said M group displacement coefficient judged, obtain the intermediate object program of shifting function based on said judged result;
The intermediate object program of the shifting function that will obtain according to the M group displacement coefficient of each coefficient adds up, and obtains M accumulation result;
After all N accumulation result additions, obtain the conversion coefficient that the matrix coefficient of each group direct transform coefficient after to said dct transform carries out the ROT direct transform.
5. a code device is characterized in that, comprising:
The dct transform unit is used for input signal is carried out dct transform;
The ROT forward transformation unit; Be used for the input signal behind the dct transform is carried out the ROT direct transform respectively according to some groups of preset ROT direct transform matrixes; Obtain the conversion coefficient after the ROT direct transform; Each coefficient in the said ROT direct transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed;
Quantifying unit is used for the conversion coefficient after the said ROT direct transform is quantized;
Comparing unit is used for the distortion situation that conversion coefficient after comparison quantizes according to each group calculates the output signal that obtains;
Coding unit, being used to select the minimum pairing ROT direct transform of the output signal matrix of distortion is the optimum ROT direct transform matrix of present encoding piece, encodes according to said optimum ROT direct transform matrix.
6. device according to claim 5 is characterized in that, each coefficient in the said ROT direct transform matrix can be decomposed into the displacement coefficient consistent with preset quantization digit, so that said each coefficient has identical displacement coefficient.
7. device according to claim 5 is characterized in that, said ROT forward transformation unit comprises:
Information acquisition unit is used for each the group direct transform coefficient for said ROT direct transform matrix, obtains mobile position and the sign bit of forming the N group displacement coefficient of each coefficient in said each group direct transform coefficient, and said N is a natural number;
The coefficient operating unit; Be used for M group displacement coefficient for said N group displacement coefficient; Shifting function is carried out to the matrix coefficient behind the dct transform in mobile position based on said M group displacement coefficient; And the sign bit of said M group displacement coefficient judged, obtain the intermediate object program of shifting function based on said judged result;
First unit that adds up, the intermediate object program of the shifting function that is used for the M group displacement coefficient according to each coefficient is obtained adds up, and obtains M accumulation result;
Second unit that adds up is used for after all N the accumulation result addition, obtains the conversion coefficient that the input signal of each group direct transform coefficient after to said dct transform carries out the ROT direct transform.
8. a coding/decoding method is characterized in that, comprising:
From input code flow, obtain the conversion coefficient after the quantification that obtains in the cataloged procedure;
Conversion coefficient after the said quantification is carried out the ROT inverse transformation respectively according to some groups of preset ROT inverse-transform matrixs; Matrix coefficient behind the acquisition dct transform; Each coefficient in the said ROT inverse-transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed;
Matrix coefficient behind the said dct transform is carried out the DCT inverse transformation;
Matrix coefficient based on after the said DCT inverse transformation is decoded.
9. method according to claim 8 is characterized in that, said some groups of ROT inverse-transform matrixs are specially four groups of ROT inverse-transform matrixs;
Each coefficient in the said ROT inverse-transform matrix can be decomposed into several displacement coefficients and comprise:
Each coefficient in the said ROT inverse-transform matrix can be decomposed into the displacement coefficient consistent with preset quantization digit, so that said each coefficient has identical displacement coefficient.
10. method according to claim 8 is characterized in that, said preset quantization digit is 3, and said four groups of ROT inverse-transform matrixs are 8 * 8 matrixes, and the coefficient of said four groups of ROT inverse-transform matrixs comprises:
First group is:
252,-36,-31,24,240,-94,48,96,240,240,-100,3,100,240,-25,7,24,255,252,-36,-31,24,240,-94,48,96,240,240,-100,3,100,240,-25,7,24,255;
Second group is:
244,-61,-50,-80,-232,-96,-25,94,-240,254,-28,-18,24,249,-56,24,56,249,244,-61,-50,-80,-232,-96,-25,94,-240,254,-28,-18,24,249,-56,24,56,249;
The 3rd group is:
244,-80,12,80,232,-72,12,72,248,252,-48,-9,-48,-252,-28,-4,29,-254,244,-80,12,80,232,-72,12,72,248,252,-48,-9,-48,-252,-28,-4,29,-254;
The 4th group is:
192,-192,24,192,160,-96,49,80,240,240,-100,-10,-100,-240,-25,1,28,-255,192,-192,24,192,160,-96,49,80,240,240,-100,-10,-100,-240,-25,1,28,-255。
11. method according to claim 8 is characterized in that, carries out the ROT inverse transformation according to one group of preset ROT inverse-transform matrix and comprises:
For each the group inverse transformation coefficient in the said ROT inverse-transform matrix, obtain mobile position and the sign bit of forming the N group displacement coefficient of each coefficient in said each group inverse transformation coefficient, said N is a natural number;
For the M group displacement coefficient in the said N group displacement coefficient; Shifting function is carried out to the conversion coefficient after quantizing in mobile position based on said M group displacement coefficient; And the sign bit of said M group displacement coefficient judged, obtain the intermediate object program of shifting function based on said judged result;
The intermediate object program of the shifting function that will obtain according to the M group displacement coefficient of each coefficient adds up, and obtains M accumulation result;
After all N accumulation result additions, obtain the conversion coefficient that the conversion coefficient of each group inverse transformation coefficient after to said quantification carries out the ROT inverse transformation.
12. a decoding device is characterized in that, comprising:
Acquiring unit is used for the conversion coefficient after input code flow obtains the quantification that obtains the cataloged procedure;
The ROT inverse transformation block; Be used for the conversion coefficient after the said quantification is carried out the ROT inverse transformation respectively according to some groups of preset ROT inverse-transform matrixs; Matrix coefficient behind the acquisition dct transform; Each coefficient in the said ROT inverse-transform matrix can be decomposed into several displacement coefficients, and each displacement coefficient moves the position by one and a sign bit is formed;
DCT inverse transformation unit is used for the matrix coefficient behind the said dct transform is carried out the DCT inverse transformation;
Decoding unit is used for decoding according to the matrix coefficient after the said DCT inverse transformation.
13. device according to claim 12 is characterized in that, each coefficient in the said ROT inverse-transform matrix can be decomposed into the displacement coefficient consistent with preset quantization digit, so that said each coefficient has identical displacement coefficient.
14. device according to claim 12 is characterized in that, said ROT inverse transformation block comprises:
Information acquisition unit is used for each the group inverse transformation coefficient for said ROT inverse-transform matrix, obtains mobile position and the sign bit of forming the N group displacement coefficient of each coefficient in said each group inverse transformation coefficient, and said N is a natural number;
The coefficient operating unit; Be used for M group displacement coefficient for said N group displacement coefficient; Shifting function is carried out to the conversion coefficient after quantizing in mobile position based on said M group displacement coefficient; And the sign bit of said M group displacement coefficient judged, obtain the intermediate object program of shifting function based on said judged result;
First unit that adds up, the intermediate object program of the shifting function that is used for the M group displacement coefficient according to each coefficient is obtained adds up, and obtains M accumulation result;
Second unit that adds up is used for after all N the accumulation result addition, obtains the conversion coefficient that the conversion coefficient of each group inverse transformation coefficient after to said quantification carries out the ROT inverse transformation.
CN201110021893.4A 2011-01-19 2011-01-19 Coding method as well as decoding method and device Active CN102611883B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201110021893.4A CN102611883B (en) 2011-01-19 2011-01-19 Coding method as well as decoding method and device
PCT/CN2011/082591 WO2012097639A1 (en) 2011-01-19 2011-11-22 Encoding method, decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110021893.4A CN102611883B (en) 2011-01-19 2011-01-19 Coding method as well as decoding method and device

Publications (2)

Publication Number Publication Date
CN102611883A true CN102611883A (en) 2012-07-25
CN102611883B CN102611883B (en) 2014-07-30

Family

ID=46515129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110021893.4A Active CN102611883B (en) 2011-01-19 2011-01-19 Coding method as well as decoding method and device

Country Status (2)

Country Link
CN (1) CN102611883B (en)
WO (1) WO2012097639A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010059970A (en) * 1999-12-31 2001-07-06 이계철 asynchronous matrix-vetcor multiplier for discrete cosine transform
CN1858998A (en) * 2006-04-20 2006-11-08 上海交通大学 No multiplication realizing method for digital audio frequency filter
WO2009148858A2 (en) * 2008-05-30 2009-12-10 Microsoft Corporation Factorization of overlapping transforms into two block transforms
CN101815992A (en) * 2007-08-17 2010-08-25 开放界面北美公司 Coding and/or decoding digital content

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010059970A (en) * 1999-12-31 2001-07-06 이계철 asynchronous matrix-vetcor multiplier for discrete cosine transform
CN1858998A (en) * 2006-04-20 2006-11-08 上海交通大学 No multiplication realizing method for digital audio frequency filter
CN101815992A (en) * 2007-08-17 2010-08-25 开放界面北美公司 Coding and/or decoding digital content
WO2009148858A2 (en) * 2008-05-30 2009-12-10 Microsoft Corporation Factorization of overlapping transforms into two block transforms

Also Published As

Publication number Publication date
WO2012097639A1 (en) 2012-07-26
CN102611883B (en) 2014-07-30

Similar Documents

Publication Publication Date Title
CN100463522C (en) Improved block transform and quantization for image and video coding
CN100412907C (en) Low complexity and unified transforms for video coding
CN101282476B (en) Method for transferring video and image process
KR20090007279A (en) Transforms with common factors
CN102695061A (en) Method and apparatus for determining weight factors, and method and apparatus for predicting intra-frame weighting
CN101836430B (en) Method and apparatus for compressing image signal
CN103369326A (en) Transition coder applicable to HEVC ( high efficiency video coding) standards
CN104320668B (en) HEVC/H.265 dct transform and the SIMD optimization methods of inverse transformation
CN101646080B (en) Method for fast switching parallel pipeline IDCT based on AVS and device thereof
CN116227630A (en) Federal learning method and related equipment
CN100405848C (en) Quantization method during video image coding
CN102611883A (en) Coding method as well as decoding method and device
CN100452881C (en) Countra-quantization method based on merging processing and apparatus thereof
KR101722215B1 (en) Apparatus and method for discrete cosine transform
KR20100074272A (en) Fixed-point implementation of an adaptive image filter with high coding efficiency
CN104661036A (en) Video encoding method and system
CN101729886B (en) Method, system and device for decoding videos
CN206962992U (en) 3 for digital video decoding multiply 3 Integer DCT Transform quantizers
CN1642280B (en) Image-video-signal converting apparatus and method thereof
CN100384253C (en) Method of hardware realizing AVS/II.264 colority interpolation and apparatus therefor
CN101977318A (en) Parallel device of DCT (Discrete Cosine Transformation) quantization and method thereof
CN108347603B (en) Moving image encoding device and moving image encoding method
Balam et al. Associative processors for video coding applications
CN113286150B (en) Transform coding hardware implementation method, device and equipment for video coding and decoding
Kumar et al. Implementation of an Efficient and Reconfigurable Architecture for DCT on FPGA

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: 20210112

Address after: Room 400, building 5, No.11 Deshengmenwai street, Xicheng District, Beijing 100032 (Desheng Park)

Patentee after: MIGU CULTURE TECHNOLOGY Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.