Transform design with scaled and non-scaled interfaces
09727530 · 2017-08-08
Assignee
Inventors
- Yuriy Reznik (San Diego, CA)
- Albert Scott Ludwin (San Diego, CA, US)
- Hyukjune Chung (San Diego, CA)
- Harinath Garudadri (San Diego, CA)
- Naveen B. Srinivasamurthy (Bangalore, IN)
- Phoom Sagetong (Orange, CA)
Cpc classification
H04N19/42
ELECTRICITY
G06F17/147
PHYSICS
International classification
G06F17/14
PHYSICS
H04N19/42
ELECTRICITY
Abstract
Techniques for efficiently performing full and scaled transforms on data received via full and scaled interfaces, respectively, are described and comprise (1) performing a first transform on a block of first input values to obtain a block of first output values by scaling the block to obtain scaled input values, performing a scaled one-dimensional (1D) transform on each row of the block, and performing a scaled 1D transform on each column of the block; and (2) performing a second transform on a block of second input values to obtain a block of second output values by performing a scaled 1D transform on each row of the block, performing a scaled 1D transform on each column of the block, and scaling the block.
Claims
1. An apparatus for image/video compression utilizing spatially decorrelated blocks of picture elements (pixels) in at least one image or at least one video frame comprising: a memory; and a processor coupled to the memory, the processor configured to: receive a block of input sample values corresponding to a block of pixels via an interface, determine if the block of input sample values comprises full input value or scaled input values and: if the block of input sample values comprises full input values, then perform a full two-dimensional (2D) transform on the block of input sample values to obtain a block of output values corresponding to a block of encoded pixels, comprising: performing a scaled one-dimensional (1D) transform on each row of the block of input sample values to obtain a first intermediate block, performing a scaled 1D transform on each column of the first intermediate block to obtain a second intermediate block comprising scaled transform coefficients, and scaling the second intermediate block to obtain a block of output values, and if the block of input sample values comprises scaled input values, then perform a scaled two-dimensional (2D) transform on the block of input sample values to obtain a block of output values corresponding to a block of encoded pixels, comprising: performing a scaled one-dimensional (1D) transform on each row of the block of input sample values to obtain a first intermediate block, performing a scaled 1D transform on each column of the first intermediate block to obtain a second intermediate block comprising scaled transform coefficients, and scaling the second intermediate block to obtain a block of output values, quantizing and entropy encoding the block of output values to form a compressed data unit, and transmitting the compressed data unit.
2. The apparatus of claim 1, wherein the processor is further configured to output the block of scaled transform coefficients and the block of output values.
3. The apparatus of claim 1, wherein the full two-dimensional (2D) transform is a full two-dimensional (2D) discrete cosine transform.
4. The apparatus of claim 1, wherein the block of output values are a block of full transform coefficients.
5. The apparatus of claim 1, wherein the processor is configured to scale each transform coefficient in a first block of transform coefficients with a respective scale factor to obtain a corresponding scaled transform coefficient in a second block of transform coefficients.
6. The apparatus of claim 1, wherein the processor is configured to scale a first block of transform coefficients row-wise and column-wise to obtain a second block of scaled transform coefficients.
7. A method for image/video compression utilizing spatially decorrelated blocks of picture elements (pixels) in at least one image or at least one video frame, the method comprising: receiving a block of input sample values corresponding to a block of pixels via an interface; determining by a processor if the block of input sample values comprises full input value or scaled input values and: if the block of input sample values comprises full input values, then performing a full two-dimensional (2D) transform on the block of input sample values to obtain a block of output values corresponding to a block of encoded pixels, comprising: performing a scaled one-dimensional (1D) transform on each row of the block of input values to obtain a first intermediate block, performing a scaled 1D transform on each column of the first intermediate block to obtain a second intermediate block comprising scaled transform coefficients, and scaling the second intermediate block to obtain a block of output values, and if the block of input sample values comprises scaled input values, then performing a scaled two-dimensional (2D) transform on the block of input sample values to obtain a block of output values corresponding to a block of encoded pixels, comprising: performing a scaled one-dimensional (1D) transform on each row of the block of input sample values to obtain a first intermediate block, performing a scaled 1D transform on each column of the first intermediate block to obtain a second intermediate block comprising scaled transform coefficients, and scaling the second intermediate block to obtain a block of output values; quantizing and entropy encoding the block of output values to form a compressed data unit; and transmitting the compressed data unit.
8. The method of claim 7, further comprising outputting the block of scaled transform coefficients and the block of output values.
9. The method of claim 7, wherein the full two-dimensional (2D) transform is a full two-dimensional (2D) discrete cosine transform.
10. The method of claim 7, wherein the block of output values are a block of full transform coefficients.
11. The method of claim 7, further comprising scaling each transform coefficient in a first block of transform coefficients with a respective scale factor to obtain a corresponding scaled transform coefficient in a second block of transform coefficients.
12. The method of claim 7, further comprising scaling a first block of transform coefficients row-wise and column-wise to obtain a second block of scaled transform coefficients.
13. An apparatus for image/video compression utilizing spatially decorrelated blocks of picture elements (pixels) in at least one image or at least one video frame comprising: means for receiving a block of input sample values corresponding to a block of pixels via an interface; means for determining if the block of input sample values comprises full input value or scaled input values and: if the block of input sample values comprises full input values, then performing a full two-dimensional (2D) transform on the block of input sample values to obtain a block of output values corresponding to a block of encoded pixels, comprising: performing a scaled one-dimensional (1D) transform on each row of the block of input sample values to obtain a first intermediate block, performing a scaled 1D transform on each column of the first intermediate block to obtain a second intermediate block comprising scaled transform coefficients, and scaling the second intermediate block to obtain a block of output values, and if the block of input sample values comprises scaled input values, then performing a scaled two-dimensional (2D) transform on the block of input sample values to obtain a block of output values corresponding to a block of encoded pixels, comprising: performing a scaled one-dimensional (1D) transform on each row of the block of input sample values to obtain a first intermediate block, performing a scaled 1D transform on each column of the first intermediate block to obtain a second intermediate block comprising scaled transform coefficients, and scaling the second intermediate block to obtain a block of output values; means for quantizing and entropy encoding the block of output values to form a compressed data unit; and means for transmitting the compressed data unit.
14. The apparatus of claim 13, further comprising means for outputting the block of scaled transform coefficients and the block of output values.
15. The apparatus of claim 13, wherein the full two-dimensional (2D) transform is a full two-dimensional (2D) discrete cosine transform.
16. The apparatus of claim 13, wherein the block of output values are a block of full transform coefficients.
17. The apparatus of claim 13, further comprising means for scaling each transform coefficient in a first block of transform coefficients with a respective scale factor to obtain a corresponding scaled transform coefficient in a second block of transform coefficients.
18. The apparatus of claim 13, further comprising means for scaling a first block of transform coefficients row-wise and column-wise to obtain a second block of scaled transform coefficients.
19. An apparatus for image/video compression utilizing spatially decorrelated blocks of picture elements (pixels) in at least one image or at least one video frame comprising: an input for receiving a block of input sample values corresponding to a block of pixels via an interface; a processor for determining if the block of input sample values comprises full input value or scaled input values; a full two-dimensional (2D) transform engine for performing, when the block of input sample values comprises full input values, a full two-dimensional (2D) transform on the block of input sample values to obtain a block of output values corresponding to a block of encoded pixels by: performing a scaled one-dimensional (1D) transform on each row of the block of input sample values to obtain a first intermediate block, performing a scaled 1D transform on each column of the first intermediate block to obtain a second intermediate block comprising scaled transform coefficients, and scaling the second intermediate block to obtain a block of output values; and a scaled two-dimensional (2D) transform engine for performing, when the block of input sample values comprises scaled input values, a scaled two-dimensional (2D) transform on the block of input sample values to obtain a block of output values corresponding to a block of encoded pixels by: performing a scaled one-dimensional (1D) transform on each row of the block of input sample values to obtain a first intermediate block, performing a scaled 1D transform on each column of the first intermediate block to obtain a second intermediate block comprising scaled transform coefficients, and scaling the second intermediate block to obtain a block of output values; a quantizer for quantizing and entropy encoding the block of output values to form a compressed data unit; and a transmitter for transmitting the compressed data unit.
20. The apparatus of claim 19, further comprising an output for outputting the block of scaled transform coefficients and the block of output values.
21. The apparatus of claim 19, wherein the full two-dimensional (2D) transform is a full two-dimensional (2D) discrete cosine transform.
22. The apparatus of claim 19, wherein the block of output values are a block of full transform coefficients.
23. The apparatus of claim 19, further comprising a scaling unit for scaling each transform coefficient in a first block of transform coefficients with a respective scale factor to obtain a corresponding scaled transform coefficient in a second block of transform coefficients.
24. The apparatus of claim 19, further comprising a scaling unit for scaling a first block of transform coefficients row-wise and column-wise to obtain a second block of scaled transform coefficients.
25. A non-transitory processor-readable media for storing instructions for image/video compression utilizing spatially decorrelated blocks of picture elements (pixels) in at least one image or at least one video frame, said instructions causing a processor to: receive a block of input sample values corresponding to a block of pixels via an interface, determine if the block of input sample values comprises full input value or scaled input values and: if the block of input sample values comprises full input values, then perform a full two-dimensional (2D) transform on the block of input sample values to obtain a block of output values corresponding to a block of encoded pixels, comprising: performing a scaled one-dimensional (1D) transform on each row of the block of input sample values to obtain a first intermediate block, performing a scaled 1D transform on each column of the first intermediate block to obtain a second intermediate block comprising scaled transform coefficients, and scaling the second intermediate block to obtain a block of output values, and if the block of input sample values comprises scaled input values, then perform a scaled two-dimensional (2D) transform on the block of input sample values to obtain a block of output values corresponding to a block of encoded pixels, comprising: performing a scaled one-dimensional (1D) transform on each row of the block of input sample values to obtain a first intermediate block, performing a scaled 1D transform on each column of the first intermediate block to obtain a second intermediate block comprising scaled transform coefficients, and scaling the second intermediate block to obtain a block of output values; quantize and entropy encoding the block of output values to form a compressed data unit; and transmit the compressed data unit.
26. The processor-readable media of claim 25, further comprising instructions to output the block of scaled transform coefficients and the block of output values.
27. The processor-readable media of claim 25, wherein the full two-dimensional (2D) transform is a full two-dimensional (2D) discrete cosine transform.
28. The processor-readable media of claim 25, wherein the block of output values are a block of full transform coefficients.
29. The processor-readable media of claim 25, further comprising instructions to scale each transform coefficient in a first block of transform coefficients with a respective scale factor to obtain a corresponding scaled transform coefficient in a second block of transform coefficients.
30. The processor-readable media of claim 25, further comprising instructions to scale a first block of transform coefficients row-wise and column-wise to obtain a second block of scaled transform coefficients.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
DETAILED DESCRIPTION
(17) The techniques described herein may be used for various types of transforms such as DCT, IDCT, discrete Fourier transform (DFT), inverse DFT (IDFT), modulated lapped transform (MLT), inverse MLT, modulated complex lapped transform (MCLT), inverse MCLT, etc. The techniques may also be used for various applications such as image, video, and audio processing, communication, computing, data networking, data storage, graphics, etc. In general, the techniques may be used for any application that uses a transform. For clarity, the techniques are described below for DCT and IDCT, which are commonly used in image and video processing.
(18) An N-point 1D DCT and an N-point 1D IDCT of type II may be defined as follows:
(19)
(20) The 1D DCT in equation (1) operates on N input samples or spatial domain values x[0] through x[N−1] and generates N transform coefficients X[0] through X[N−1]. The 1D IDCT in equation (2) operates on N transform coefficients and generates N output samples. Type II DCT is one type of transform and is commonly believed to be one of the most efficient transforms among various energy compacting transforms often proposed for image/video compression.
(21) The 1D DCT and 1D IDCT may be implemented in their original forms shown in equations (1) and (2), respectively. However, substantial reduction in computational complexity may be realized by finding factorizations that result in as few multiplications and additions as possible, as described below.
(22) The 1D DCT in equation (1) may be expressed in matrix form, as follows:
x=Ty, Eq (3)
where y is an N×1 vector of input samples, T is an N×N matrix of a full 1D DCT, and x is an N×1 vector of transform coefficients.
(23) y contains input samples x[0] through x[N−1], and x contains transform coefficients X[0] through X[N−1]. The elements of T may be obtained based on equation (1).
(24) The 1D DCT may be factored into a product of matrices, as follows:
T=ST.sub.S, Eq (4)
where S=diag(A.sub.0, . . . , A.sub.N-1) is a diagonal matrix of scale factors, and T.sub.S is an N×N matrix of a scaled 1D DCT.
Equations (3) and (4) indicate that a full 1D DCT may be performed on y by first performing a scaled 1D DCT on y and then scaling the results with S.
(25) An advantage of decomposing a full transform into a scaled transform and a scaling operation, e.g., as shown in equation (4), is that by properly choosing the scale factors, the multiplicative complexity of the scaled transform may be reduced. For example, a well-known decomposition of Arai, Agui, and Nakajima (AAN) in “A Fast DCT-SQ Scheme for Images,” Transactions of the IEICE, November 1988, produces a scaled 8-point DCT that may be implemented with only five multiplications by irrational factors. In contrast, the best-known full 8-point DCT requires 11 such multiplications.
(26) An N×N 2D DCT may be defined as follows:
T{circle around (x)}T=(ST.sub.S){circle around (x)}(ST.sub.S)=(S{circle around (x)}S)(T.sub.S{circle around (x)}T.sub.S), Eq (5)
where T{circle around (x)}T is a Kroneker product of T with itself and is a matrix of a full 2D DCT, T.sub.S{circle around (x)}T.sub.S is a matrix of a scaled 2D DCT, and S{circle around (x)}S is a matrix of scale factors for the scaled 2D DCT.
The result of the operation in equation (5) is a matrix of an N×N 2D DCT.
(27) A 2D DCT may be performed on an N×N matrix of input samples Y in a separable manner, for one dimension at a time. For example, a 1D DCT may be performed on each row of Y to obtain an intermediate matrix, and a 1D DCT may then be performed on each column of the intermediate matrix. Alternatively, a 1D DCT may be performed on each column of Y followed by a 1D DCT on each row of the intermediate matrix.
(28) Equation (5) indicates that a 2D DCT may be performed on Y by first performing a scaled 2D DCT on Y and then scaling the results. Equation (5) also indicates that the scaling for the row and column 1D DCTs may be merged into a single step (which is matrix product by S{circle around (x)}S) applied to the results of the scaled 2D DCT.
(29) The 1D IDCT in equation (2) may be expressed in matrix form, as follows:
T.sup.−1=T.sup.t=T.sub.S.sup.tS, Eq (6)
where T.sup.t is an N×N matrix of a full 1D IDCT and “.sup.t” denotes the transpose.
(30) A 2D IDCT may be expressed as:
(T{circle around (x)}T).sup.−1=T.sup.−1{circle around (x)}T.sup.−1=(T.sub.S.sup.tS){circle around (x)}(T.sub.S.sup.tS)=(T.sub.S.sup.t{circle around (x)}T.sub.S.sup.t)(S{circle around (x)}S). Eq (7)
(31) Equation (7) indicates that a 2D IDCT may be performed on an N×N matrix of transform coefficients X by first scaling the transform coefficients and then performing a scaled 2D IDCT on the scaled transform coefficients. Equation (7) also indicates that the scaling for the row and column 1D IDCTs may be merged into a single step preceding the scaled 2D IDCT.
(32) A scaled architecture is a design that uses a scaled transform, and a full architecture is a design that uses a full transform. A scaled architecture may have lower multiplicative complexity than a full architecture. For example, a scaled architecture may perform a scaled 2D IDCT (T.sup.t.sub.S {circle around (x)}T.sup.t.sub.S) in a separable row-column fashion and may use an 8-point scaled 1D IDCT T.sub.S from the AAN decomposition for each row and each column. The multiplicative complexity of this scaled architecture may be 8*8+16*5=64+80=144, or 64 multiplications for scaling and 5 multiplications for each of the 8 rows and 8 columns. In certain situations, the scaling may be combined with quantization, in which case the multiplicative complexity of the scaled architecture may be reduced to about 80 multiplications. A full architecture may perform a 2D IDCT (T{circle around (x)}T) in a row-column fashion and may use the best-known full 8-point 1D IDCT T for each row and each column. The multiplicative complexity of this full architecture may be 16*11=176, or 11 multiplications for each of the 8 rows and 8 columns. For the separable implementation, the scaled architecture may have lower multiplicative complexity than the full architecture.
(33) A scaled architecture may be used in designs that favor low complexity. The scaled architecture may be advantageous when there are only few non-zero transform coefficients to scale, which may often be the case for 2D IDCT in an image/video decoder. The scaled architecture may also be advantageous in designs that allow the scaling of transform coefficients to be combined with quantization and/or inverse quantization in an image/video encoder/decoder (codec), e.g., as shown in
(34) A full architecture may be desirable in designs that favor ease of use. For example, many computing environments and applications may support multiple image and video coding standards. In these instances, it may be more convenient to have a transform engine that implements full transform and to provide a flexible input/output interface to allow the transform engine to be used with various quantizers and codecs. The full architecture may provide simple interface and may be more suitable in such environments.
(35) A transform design that can flexibly support different applications via scaled and full interfaces are described herein. The transform design may receive full input values via the full interface, perform a full transform on these input values, and provide full output values, similar to the full architecture. The transform design may also receive scaled input values via the scaled interface, perform a scaled transform on these input values, and provide scaled output values, similar to the scaled architecture. The transform design may internally implement a separable scaled transform to potentially achieve lower complexity and/or improved precision. The transform design may thus be able to achieve lower complexity for certain applications, provide ease of use for other applications, or provide both lower complexity and ease of use in certain instances. The transform design may be used for both forward transforms (e.g., DCT) and inverse transforms (e.g., IDCT). For clarity, the transform design is specifically described below for IDCT.
(36) The scaled and non-scaled/full 2D IDCT architectures may be expressed as follows.
scaled 2D IDCT:T.sup.−1{circle around (x)}T.sup.−1=(T.sub.S.sup.t{circle around (x)}T.sub.S.sup.t)(S{circle around (x)}S), and Eq (8)
non-scaled 2D IDCT:T.sup.−1{circle around (x)}T.sup.−1=(T.sub.S.sup.tS){circle around (x)}(T.sub.S.sup.tS). Eq (9)
(37) A full/non-scaled interface may receive transform coefficients. A full 2D IDCT may be performed on these transform coefficients, as follows:
Y=Θ(X)≈T.sup.tXT, Eq (10)
where X is a matrix of transform coefficients, Θ(.) is an approximation of the full 2D IDCT, and Y is a matrix of output samples.
The operator notation (.) in equation (10) is used to indicate that fixed-point approximations may not be based solely on linear operations.
(38) The full 2D IDCT may be achieved by performing a full 1D IDCT on each row and each column of X, as follows:
θ(x.sub.i)≈T.sup.tx.sub.i, Eq (11)
where x.sub.i is the i-th row or column of X, and θ(.) is an approximation of the full 1D IDCT.
θ(.) may be used for row-column implementation of 2D operator Θ(.).
(39) A scaled interface may receive scaled transform coefficients, which may be obtained as follows:
X.sub.S=Σ(X)≈S.sup.tXS, Eq (12) where Σ(.) is an approximation of the 2D scaling operation, and X.sub.S is a matrix of scaled transform coefficients.
(40) A scaled 2D IDCT may be performed on the scaled transform coefficients, as follows:
Y=(X.sub.S)=T.sub.S.sup.tX.sub.ST.sub.S, Eq (13)
where (.) is an approximation of the scaled 2D IDCT.
(41) The scaled 2D IDCT may be achieved by performing a scaled 1D IDCT on each row and each column of X.sub.S, as follows:
ξ(x.sub.S,i)≈T.sub.S.sup.tx.sub.S,i, Eq (14)
where x.sub.S,i is the i-th row or column of X.sub.S, and ξ(.) is an approximation of the scaled 1D IDCT.
ξ(.) may be used for row-column implementation of 2D operator (.).
(42) As shown in equation (13), the scaled interface may be realized by implementing the 2D operator (.). As shown in equations (12) and (13), the full interface may be realized by implementing the 2D scaling operator Σ(.) in addition to the 2D operator
(.). The full 2D IDCT may then be performed as follows:
Y=(Σ(X))=:Θ(X). Eq (15)
(43) Equation (15) indicates that a full 2D IDCT may be performed on full transform coefficients X by first scaling these transform coefficients with the 2D scaling operator Σ(.) and then performing a scaled 2D IDCT on the scaled transformed coefficients with the 2D operator (.). The 2D operator
(.) may, in turn, be implemented by a row-column cascade of 1D operators ξ(.).
(44) The 2D operator Θ(.) for a separable full 2D IDCT may thus be implemented with the 2D operator (.) for a separable scaled 2D IDCT and the 2D scaling operator Σ(.). The 2D scaling may be implemented in various manners, as described below. The resulting complexity and performance of the separable full 2D IDCT implemented with separable scaled 2D IDCT and 2D scaling may be comparable with a natively implemented full 2D IDCT.
(45)
(46) IDCT stage 114 performs an N-point scaled 1D IDCT on each row of the block of scaled transform coefficients from 2D scaling stage 112. IDCT stage 116 performs an N-point scaled 1D IDCT on each column of an intermediate block generated by IDCT stage 114. The scaled 1D IDCTs for stages 114 and 116 may operate directly on their input data without doing any internal pre- or post scaling. After all of the rows and columns are processed, output formatting stage 118 may shift the resulting quantities from IDCT stage 116 by P bits to the right to generate an N×N block of output samples Y for the full 2D IDCT. The scale factors and the precision constant P may be chosen such that the entire 2D IDCT may be implemented using registers of the desired width.
(47) The 2D scaling in stage 112 may be expressed as:
X.sub.S,ij=(X.sub.ij.Math.A.sub.i.Math.A.sub.j)>>R, Eq (16) where X.sub.ij is a transform coefficient in the i-th row and j-th column of X, A.sub.i and A.sub.j are the i-th and j-th diagonal elements, respectively, of S, X.sub.S,ij is a scaled transform coefficient in the i-th row and j-th column of X.sub.S, and “>>R” denotes a signed right shift operation by R bits.
R is a constant ensuring P bits of added fixed-point precision in scaled transform coefficients X.sub.S,ij.
(48) A table may store scale factors A.sub.ij=A.sub.i.Math.A.sub.j, for i=0, . . . , N−1 and j=0, . . . , N−1. Each element of X may be multiplied by a corresponding scale factor in the table. Up to N.Math.N multiplications may be performed for the N.Math.N elements of X.
(49)
X′.sub.ij=X.sub.ij.Math.A.sub.i,
X.sub.S,ij=(X′.sub.ij.Math.A.sub.j)>>R. Eq (17)
(50) Scaling stage 122 may thus perform 2D scaling in a separable manner on rows followed by columns (or on columns followed by rows). Separable row-column scaling may allow the same hardware to be used for scaling of rows and scaling of columns, which may reduce implementation complexity. Up to 2.Math.N.Math.N multiplications may be performed for the N.Math.N elements of X. However, the actual number of multiplications may be much fewer than 2.Math.N.Math.N since some of the scale factors A.sub.0 through A.sub.N-1 may have trivial values (e.g., 256), and multiplication with these trivial scale factors may be implemented with simple shift operations. Stages 124, 126, and 128 may operate in the same manner as stages 114, 116, and 118, respectively, in
(51)
(52)
(53) As shown in
(54) Various types of scaled 1D IDCT may be used for the row-column 1D IDCTs in
(55)
α.sub.1=α.sub.2=1,
β.sub.1=β.sub.2=C.sub.π/4=cos(π/4)≈0.707106781
β.sub.1=C.sub.3π/8=cos(3π/8)≈0.382683432, and
δ.sub.1=S.sub.3π/8=sin(3π/8)≈0.923879533. Eq (18)
(56) Flow graph 200 may receive eight transform coefficients X[0] through X[7] and scale these transform coefficients with scale factors A.sub.0 through A.sub.7 to obtain eight scaled transform coefficients A.sub.0.Math.X[0] through A.sub.7.Math.X [7]. Alternatively, flow graph 200 may receive the eight scaled transform coefficients directly. In either case, flow graph 200 performs an 8-point 1D IDCT on the eight scaled transform coefficients and generates eight output samples x[0] through x[7]. The scale factors A.sub.0 through A.sub.7 are as follows:
(57)
(58) Flow graph 200 includes a number of butterfly operations. A butterfly operation receives two input values and generates two output values, where one output value is the sum of the two input values and the other output value is the difference of the two input values. For example, the butterfly operation on input values A.sub.0.Math.X[0] and A.sub.4.Math.X[4] generates an output value A.sub.0.Math.X[0]+A.sub.4.Math.X[4] for the top branch and an output value A.sub.0.Math.X[0]−A.sub.4.Math.X[4] for the bottom branch.
(59) The factorization shown in
(60) Multiplication of an integer variable x with an irrational constant μ in fixed-point integer arithmetic may be achieved by approximating the irrational constant with a rational dyadic constant, as follows:
μ≈c/2.sup.b, Eq (19)
where μ is the irrational constant to be approximated, and
(61) c/2.sup.b is the rational dyadic constant.
(62) Given integer variable x and rational dyadic constant u=c/2.sup.b, an integer-valued product
y=(x.Math.c)/2.sup.b Eq (20)
may be approximated using a series of intermediate values
x.sub.0, x.sub.1, x.sub.2, . . . , x.sub.t, Eq (21)
where x.sub.0=0, x.sub.1=x, and for all 2≦i≦t values, x.sub.i is obtained as follows:
x.sub.i=±x.sub.j±x.sub.k.Math.2.sup.s.sup.
where x.sub.k.Math.2.sup.s.sup.
(63) In equation (22), x.sub.i may be equal to x.sub.j+x.sub.k.Math.2.sup.s.sup.
x.sub.t≈y. Eq (23)
(64) Multiplication of an integer variable x with two irrational constants μ and η in fixed-point integer arithmetic may be achieved by approximating the irrational constants with rational dyadic constants, as follows:
μ≈c/2.sup.b and η≈e/2.sup.d, Eq (24)
where c/2.sup.b and e/2.sup.d are two rational dyadic constants, and
(65) b, c, d and e are integers, with b>0 and d>0.
(66) Given integer variable x and rational dyadic constants u=c/2.sup.b and v=e/2.sup.d, two integer-valued products
y=(x.Math.c)/2.sup.b and z=(x.Math.e)/2.sup.d Eq (25)
may be approximated using a series of intermediate values
x.sub.0,x.sub.1,x.sub.2, . . . ,x.sub.t. Eq (26)
(67) where x.sub.0=0, x.sub.1=x, and for all 2≦i≦t values, x.sub.i is obtained as follows:
x.sub.i=±x.sub.j±x.sub.k.Math.2.sup.s.sup.
The series is defined such that the desired integer-valued products are obtained at steps m and n, as follows:
x.sub.m≈y and x.sub.n≈z, Eq (28)
where m, n≦t and either m or n is equal to t.
(68) As shown in equations (24) through (28), the multiplication of integer variable x with irrational constants μ and η may be approximated with a common series of intermediate values generated by shift and add operations and using intermediate results to reduce the total number of operations.
(69) In the computation described above, trivial operations such as additions and subtractions of zeros and shifts by zero bits may be omitted. The following simplifications may be made:
x.sub.i=±x.sub.0x.sub.k±2.sup.s.sup.x.sub.i=±x.sub.k.Math.2.sup.s.sup.
x.sub.i=±x.sub.j±x.sub.k.Math.2.sup.0x.sub.i=±x.sub.j±x.sub.k. Eq (30)
(70) In equation (29), the expression to the left of “” involves an addition or subtraction of zero (denoted by x.sub.0) and may be performed with one shift, as shown by the expression to the right of “
”. In equation (30), the expression to the left of “
” involves a shift by zero bits (denoted by 2.sup.0) and may be performed with one addition, as shown by the expression to the right of “
”. Equations (29) and (30) may be applied to equations (22) and (27) in the computation of x.sub.i.
(71) To reduce computation, a first common factor F.sub.1 may be applied to constant factors α.sub.1 and β.sub.1 in flow graph 200, and second common factor F.sub.2 may be applied to constant factors α.sub.2, β.sub.2, δ.sub.1 and γ.sub.1 as follows:
α′.sub.1=α.sub.1.Math.F.sub.1,β′.sub.1=β.sub.1.Math.F.sub.1, and
α′.sub.2=α.sub.2.Math.F.sub.2,β′.sub.2=β.sub.2.Math.F.sub.2,γ′.sub.1=γ.sub.1.Math.F.sub.2,δ.sub.1=δ.sub.1.Math.F.sub.2. Eq (31)
(72) The scale factors A.sub.0 through A.sub.7 may also be scaled to account for the common factors F.sub.1 and F.sub.2, as follows:
A′.sub.0=A.sub.0,A′.sub.4=A.sub.4,
A′.sub.2=A.sub.2/F.sub.2,A′.sub.6=A.sub.6/F.sub.1,and
A′.sub.1=A.sub.1/F.sub.2,A′.sub.5=A.sub.5/F.sub.2,A′.sub.3=A.sub.3/F.sub.2,A′.sub.7=A.sub.7/F.sub.2. Eq (32)
(73) Different combinations of values for common factors F.sub.1 and F.sub.2 may be evaluated. For each combination of F.sub.1 and F.sub.2 values, the total number of logical and arithmetic operations for the 1D IDCT and the precision of the output samples may be determined.
(74) Table 1 shows an example fixed-point approximation for the 1D IDCT in
(75) TABLE-US-00001 TABLE 1 Rational Num Num Dyadic Multiplication of variable x with of of Times Factor Constant one or two rational dyadic constants Adds Shifts Used A.sub.0.sup.′ 256 y = x << 8; 0 1 1 A.sub.1.sup.′ 256 y = x << 8; 0 1 1 A.sub.2.sup.′ 384 y = (x + (x << 1)) << 7; 1 2 1 A.sub.3.sup.′ 145 x.sub.2 = x + (x << 3); y = x + (x.sub.2 << 4); 2 2 1 A.sub.4.sup.′ 256 y = x << 8; 0 1 1 A.sub.5.sup.′ 729 x.sub.2 = x + (x << 2); x.sub.3 = x + (x.sub.2 << 4); y = x.sub.3 + (x.sub.3 << 3); 3 3 1 A.sub.6.sup.′ 159 x.sub.2 = x + (x << 2); y = (x.sub.2 << 5) − x; 2 2 1 A.sub.7.sup.′ 171 x.sub.2 = (x << 1) + (x << 3); x.sub.3 = x + x.sub.2; y = x.sub.3 + (x.sub.2 << 4); 3 3 1 α.sub.1.sup.′ 2523/2048 x.sub.2 = x − (x >> 9); x.sub.3 = x.sub.2 − (x >> 4); y = x.sub.2 + (x.sub.3 >> 2); 3 3 1 β.sub.1.sup.′ 223/256 x.sub.2 = x + (x >> 5); y = x − (x.sub.2 >> 3); 2 2 1 α.sub.2.sup.′ 2607/2048 x.sub.2 = x − (x >> 6); x.sub.3 = x.sub.2 + (x >> 5); y = x.sub.3 + (x.sub.3 >> 5); 3 3 1 β.sub.2.sup.′ 3687/4096 x.sub.2 = x + (x >> 9); x.sub.3 = x.sub.2 − (x >> 2); x.sub.4 = x.sub.3 + (x >> 4); 4 4 1 y = x.sub.2 − (x.sub.4 >> 3); γ.sub.1.sup.′ 1995/4096 x.sub.2 = x + (x >> 5); x.sub.3 = x.sub.2 + (x >> 7); x.sub.4 = x.sub.3 + (x.sub.2 >> 3); 5 6 2 δ.sub.1.sup.′ 4817/4096 y = x.sub.4 + (x.sub.2 >> 7); z = (x.sub.3 − (x.sub.3 >> 4)) >> 1; Complexity of scaled 1D IDCT: 50 24 Complexity of full 1D IDCT: 61 39
(76) In Table 1, right shift by 8 cancels out multiplication by a factor of 256 in scale factors A′.sub.0, A′.sub.1, A′.sub.2, and A′.sub.4, which enables additional complexity reduction.
(77) In the design shown in Table 1, an 8-point scaled 1D IDCT may be performed with 50 add operations and 24 shift operations. An 8-point full 1D IDCT may be performed with 61 add operations and 39 shift operations. The scaling with scale factors A′.sub.0 through A′.sub.7 may be performed prior to the scaled 1D IDCT (as shown in
(78) Table 1 shows an example fixed-point approximation for the 1D IDCT in
(79)
(80)
(81)
(82)
(83) As shown in
(84) Various types of scaled 1D DCT may be used for the scaled 1D DCTs in
(85)
α.sub.a=β.sub.b=1,
β.sub.a=β.sub.b=1/C.sub.π/4=1/cos(π/4)
γ.sub.a=2C.sub.3π/8=2 cos(3π/8), and
δ.sub.a=2S.sub.3π/8=2 sin(3π/8). Eq (33)
(86) The flow graphs for the IDCT and DCT in
(87)
(88) IDCT engine 516 may perform scaled 1D IDCTs on rows of the block of scaled transform coefficients from multiplexer 512 and provide rows of a block of intermediate results to buffer 518. IDCT engine 516 may then perform scaled 1D IDCTs on columns of the block of intermediate results from buffer 518 and provide a block of final results to buffer 518. A unit 520 performs output formatting on the final results in buffer 518 and provides output samples.
(89)
(90) For clarity, much of the description above is for DCT and IDCT. In general, the techniques described herein may be used for any type of transform such as DCT, IDCT, DFT, IDFT, MLT, inverse MLT, MCLT, inverse MCLT, etc. The techniques may also be used for any factorization of a transform, with several example factorizations being given in
(91)
(92) The full transform may be a full 2D inverse transform. In this case, a block of first input values may be received via the first interface and scaled to obtain a block of scaled input values. A scaled 1D transform may be performed on each row of the block of scaled input values to obtain an intermediate block. A scaled 1D transform may be performed on each column of the intermediate block to obtain a block of first output values. The scaled 1D transforms may also be performed on columns followed by rows.
(93) The full transform may also be a full 2D forward transform. In this case, a block of first input values may be received via the first interface. A scaled 1D transform may be performed on each row of the block of input values to obtain a first intermediate block. A scaled 1D transform may be performed on each column of the first intermediate block to obtain a second intermediate block. The second intermediate block may be scaled to obtain a block of first output values.
(94) The full transform may be a full 2D IDCT. In this case, a block of transform coefficients may be received via the first interface and scaled to obtain a block of scaled transform coefficients. Each transform coefficient may be scaled with a respective scale factor to obtain a corresponding scaled transform coefficient, e.g., as shown in
(95) The scaled transform may be a scaled 2D IDCT. In this case, a block of scaled transform coefficients may be received via the second interface. A scaled 1D IDCT may then be performed on each row of the block of scaled transform coefficients to obtain an intermediate block. A scaled 1D IDCT may be performed on each column of the intermediate block to obtain a block of output samples.
(96) The full transform may be a full 2D DCT, and the scaled transform may be a scaled 2D DCT. A full 2D DCT may be performed on a block of input samples as described above to obtain a block of full transform coefficients for the first interface. A scaled 2D DCT may also be performed on the block of input samples to obtain a block of scaled transform coefficients for the second interface.
(97)
(98) At decoding system 850, an entropy decoder 860 may perform entropy decoding on the compressed data in a manner complementary to the entropy encoding by encoder 826 and provide quantized coefficients. An inverse quantizer 862 may map the quantized coefficients to full or scaled transform coefficients. A unit 862 may perform full 2D IDCT on full transform coefficients or scaled 2D IDCT on scaled transform coefficients and provide blocks of output samples. Unit 862 may support both full and scaled interfaces. An image/video decoder 866 may perform decompression on the blocks of output samples and provide blocks of pixels.
(99) At encoding system 810, unit 822 may perform scaled 2D DCT and provide scaled transform coefficients. Quantizer 824 may perform scaling (e.g., stage 318 in
(100)
(101) A storage unit 940 may store the compressed data from processor 920. A transmitter 942 may transmit the compressed data. A controller/processor 950 controls the operation of various units in encoding system 900. A memory 952 stores data and program codes for encoding system 900. One or more buses 960 interconnect various units in encoding system 900.
(102)
(103) A display unit 1040 displays reconstructed images and video from processor 1020. A controller/processor 1050 controls the operation of various units in decoding system 1000. A memory 1052 stores data and program codes for decoding system 1000. One or more buses 1060 interconnect various units in decoding system 1000.
(104) Processors 920 and 1020 may each be implemented with one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), and/or some other type of processors. Alternatively, processors 920 and 1020 may each be replaced with one or more random access memories (RAMs), read only memory (ROMs), electrical programmable ROMs (EPROMs), electrically erasable programmable ROMs (EEPROMs), magnetic disks, optical disks, and/or other types of volatile and nonvolatile memories known in the art.
(105) The techniques described herein may be implemented in various types of apparatus. For example, the techniques may be implemented in different types of processors, different types of integrated circuits, different types of electronics devices, different types of electronics circuits, etc.
(106) Those of skill in the art would understand that information and signals may be represented using any of a variety of different technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that may be referenced throughout the above description may be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.
(107) Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
(108) The various illustrative logical blocks, modules, and circuits described in connection with the disclosure may be implemented or performed with a general-purpose processor, a DSP, an ASIC, a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
(109) The steps of a method or algorithm described in connection with the disclosure may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
(110) The previous description of the disclosure is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to the disclosure may be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other designs without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the examples shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.