1. Introduction
To remove the correlation within audio, image, and video, transform coding is widely used for data compression. In particular, the type II DCT (DCT-II) was largely applied as a basis transform in many image and video coding standards, such as AVC, HEVC, JPEG, and MPEG-2 [
1,
2]. Even types of trigonometric transforms, like type II, III, and IV DCT, were studied more often compared with transforms of odd types. Based on the several relationships between the even types of trigonometric transforms, the factorizations of even transform matrices were obtained. Also, numerous effective algorithms for even transform computation already exist [
3,
4,
5,
6,
7,
8,
9]. As a consequence, the DCT-II is used in image and video compression formats such as JPEG, MPEG-I to MPEG-IV, and the ITU-T H.26x series [
10,
11]. The DCT-IV is applied to audio coding in ITU-T Rec. G.722.1, MPEG-4 AAC, and other standards. The type III DCT is used as the inverse transform of the DCT-II [
12].
Less commonly used odd trigonometric transforms have recently attracted attention in the field of image and video coding, particularly the DCT and DST of types V, VI, VII, and VIII [
12,
13,
14]. In [
15], it was shown that transforms other than the DCT-II can better represent signals generated by intra-prediction in image and video coding. Specifically, it demonstrated that the DST type VII (DST-VII) closely approximates the optimal Karhunen–Loève transform in decorrelating intra-predicted signals. As a result, the DST-VII was adopted in the HEVC standard for coding intra-predicted 4 × 4 luminance blocks [
16]. The DCT-VII is used in image coding through fast factorized algorithms, enabling reduced computational complexity for transforms on small block sizes, and efficient implementation in codecs requiring real-time operation. The types V, VI, and VII DCTs were examined in experimental research of video coding but were not included in video coding standards.
The recent Versatile Video Coding (VVC) standard significantly improves compression efficiency compared to the HEVC standard by enhancing frame partitioning, intra- and inter-prediction, and the transform stage [
17,
18].
For example, the Multiple-Transform Selection (MTS) scheme is used in this standard for residual coding in intra-coded blocks [
19]. The encoder selects the best combination of transform types, such as DCT-II, DCT-VIII, and DST-VII, for the horizontal and vertical directions. This selection aims to minimize the rate-distortion cost
J, defined as
J =
D + λ
R, where
D represents distortion,
R is the bit rate, and λ is a weighting factor that balances image quality and compression efficiency [
20,
21].
The application of MTS achieves a significant coding gain, reducing bit rates by approximately 0.9% to 2% in VTM-4.0 compared with HEVC, which uses only DCT-II and DST-VII for intra-predicted 4 × 4 luminance blocks. However, this improvement comes with a considerable increase in complexity and memory usage, with estimated increases of 160% in encoder and 105% in decoder complexity under the All-Intra setting [
10].
Several studies were focused on developing fast algorithms for computing DCTs and DSTs to reduce the number of multiplications and additions compared to the direct matrix product in the two-dimensional case, which requires
multiplications and
additions, i.e., has
O(
) computational complexity. Fast implementations of the DCT-II were extensively researched [
22,
23,
24]. However, only a few papers have been devoted to establishing the relations among the DST-VII, DCT-VIII, and other odd trigonometric transforms, as well as to developing fast algorithms for these transforms [
13,
14,
18,
25,
26].
It should also be noted that in this paper, we use trigonometrical transform definitions from [
1]. In [
18,
27,
28], the type VI and VII DCT/DST are defined in reverse. Then, we aim to develop fast algorithms for implementing the DCT-VII due to its close relationship to the DCT-II. Specifically, the decomposition of the (2
N + 1)-point DCT-II is obtained by means of the (
N + 1)-point DCT-VI and the
N-point DST-VII [
27].
1.1. Related Papers
The development of fast algorithms for odd-type DCTs and DSTs is based on the following relations:
- (a)
between type VI and VII DCTs, DSTs, and the discrete Fourier transform (DFT) [
27,
28,
29];
- (b)
among different types of DCTs and DSTs [
10,
26,
28];
- (c)
between the DCT-II matrix and a sparse adjustment matrix that approximates the matrix of the considered odd-type transform [
18,
27];
- (d)
among the coefficients of the odd-transform matrix [
25].
In [
27,
28,
29], the different odd types of DCTs and DSTs were represented as special cases of the DFT with appropriate input and output selection. It was also shown in [
27] that the (2N − 1)-point DFT can be computed using the N-point DCT-VII and (N − 1)-point DST-VII. Based on these relationships, fast algorithms DCT-VII can be obtained via pruning the data flow graph of the DFT algorithm. Only paths leading to valid output data are retained.
In [
28], it was shown how to decompose the (2
N + 1)-point DCT-II matrix into an (
N + 1)-point type VI DCT and an
N-point DST-VII. Since the odd-length DCT-II can be viewed as a real-valued DFT of the same length, it was proposed to use existing DFT factorizations from the literature to design low-complexity algorithms for the (
N + 1)-point type VI DCT and the
N-point DST-VII. The fast DCT-VIII algorithms are then easily developed because this transform is an inverse type VI DCT.
Also, a fast implementation for DST-VII and DCT-VIII was proposed in [
10], where the odd-type transform matrix is approximated by combining the DCT-II matrix with a sparse matrix. This approach allows the reuse of existing fast DCT-II algorithms, reducing the computational complexity of DST-VII. Integrating the obtained fast algorithms into the VVC standard substantially lowers the transform module’s computational cost at both the encoder and decoder, particularly benefiting hardware implementations on embedded platforms with limited computing power and memory.
In [
18], a new class of relationships among odd-type DCTs and DSTs was derived. In particular, the authors considered the relationship between the type V DCT and type VII DCT, as well as between the DST-VII and DCT-VIII. To compute the type V DCT and DCT-VIII for
N = 4 and
N = 8, transform matrix factorizations were obtained. The data flow graphs have shown that corresponding fast algorithms reduce computational complexity relative to a direct matrix-vector product. Hardware architectures implementing these algorithms were synthesized on an FPGA.
In [
25], a fast transform scheme was presented based on the symmetric and anti-symmetric properties of submatrices of the initial DST-VII matrix. The scheme uses butterfly-type structures to further reduce the calculations needed for the DST-VII implementation. Based on the proposed scheme, fast DST-VII/DCT-VIII algorithms are developed, saving the number of arithmetic operations by approximately 50%. They support dual implementation options: either full matrix multiplication or a fast partial butterfly-type implementation.
The paper [
25] focuses on 16-, 32-, and 64-point transforms because a similar fast algorithm already exists for four-point transforms, and no comparable anti-symmetric properties have been identified for other sizes. Moreover, the advantages are limited for smaller sizes like four-point and eight-point transforms, due to their relatively small scale.
In [
30], a transfer matrix between DCT-II and DST-VII was defined. A least-squares approach was used to increase its sparsity, enabling low-cost and high-precision computation of the DST-VII. Also, a matrix decomposition algorithm was introduced that significantly reduces the computational complexity of DCT-II. Together, these novelties support highly efficient and resource-optimized transform-circuit designs.
1.2. The Main Contributions of the Paper
The above review identifies the limitations of existing techniques for constructing fast algorithms for odd-type DCTs and DSTs. The algorithms available in the literature are often only developed for input sequence lengths that are powers of two; although they reduce the number of multiplications compared to the direct matrix-vector product, the total still remains considerable. These algorithms are designed for large N, and only when N is large do they offer a significant reduction in the number of arithmetic operations.
To overcome the limitations mentioned above, we propose fast DCT-VII algorithms based on the structural approach described in [
31,
32]. The relevance of applying the structural approach for developing fast DCT-VII algorithms lies primarily in its ability to identify, analyze, and exploit block and block-cyclic structures in the transform matrix. Unlike the fast transform scheme from [
25], the structural approach utilizes a broader range of matrix templates, allowing the transform matrix to be split into larger components than those in the aforementioned fast transform scheme. The structural approach enables the factorization of submatrices with repeated entries, as outlined in templates from [
31]. Additionally, cyclic convolution blocks can be represented as a product of sparse matrices, resulting in significant computational savings [
32]. This approach also easily depicts the obtained algorithms as data flow graphs with only one multiplication on each path connecting the input and output. This peculiarity reduces computational complexity by avoiding redundant calculations and enables efficient organization of computations.
The main contribution of the article is the construction of fast DCT-VII algorithms for small-sized input sequences, specifically, for lengths ranging from 3 to 8. We have designed a collection of fast DCT-VII algorithms based on the factorizations of the initial DCT-VII matrices into sparse and diagonal matrices. The derived data flow graphs are well-suited for hardware implementation, while the developed pseudocodes support efficient software implementation. Compared to direct matrix-vector multiplication, the proposed algorithms have lower computational complexity and, in combination with other methods, apply to image, video, and audio coding, as well as other data processing tasks.
In image and video processing, improving the efficiency and robustness of local block transforms remains an important research direction. Papers such as [
33,
34] demonstrate that the recovery of structural information and the stability of local feature representations rely on interpretable transform-domain properties, which aligns with the motivation behind this paper’s fine-grained decomposition of the small-size DCT-VII.
In [
35,
36], the value of lightweight transforms in watermarking and video security is highlighted. It is further indicated that building efficient and implementable small-size orthogonal transforms (such as the fast DCT-VII proposed in this paper) is relevant to multimedia forensics, security, and coding systems.
The paper is structured as follows.
Section 1 introduces the problem and reviews related papers, along with stating the research objectives.
Section 2 contains the necessary mathematical background and notations.
Section 3 presents the fast DCT-VII algorithms.
Section 4 and
Section 5 evaluate the computational complexity of these algorithms.
Section 6 offers the concluding remarks. Finally,
Appendix A presents the pseudocode of the proposed algorithms.
4. Results
The correctness of the DCT-VII matrix factorizations presented in
Section 3 was verified experimentally. Using MATLAB R2023b, we compared the original DCT-VII matrices, computed via Equations (3), (7), (11), (17), (22) and (28), with the products of the factorized matrices obtained from Expressions (6), (10), (16), (21), (27) and (34). For matrix sizes
N ranging from 3 to 8, the factorized matrices matched the original ones, confirming the validity of the developed algorithms.
Next, we evaluated the number of arithmetic operations needed by the proposed DCT-VII algorithms and compared them to the counts for direct matrix-vector multiplication. The number of multiplications was determined from the data flow graphs by counting vertices marked with factors (circles). The number of additions was estimated by counting vertices where two edges converge. Overall, the designed DCT-VII algorithms decrease the number of multiplications by about 66% and the number of additions by around 6% for input lengths between 3 and 8.
Table 1 presents the number of arithmetic operations for the proposed DCT-VII algorithms, with percentage differences relative to direct matrix-vector products shown in parentheses. An upward arrow indicates an increase in operations, while a downward arrow shows a reduction.
Table 2 lists the number of additions and multiplications for existing DCT-VII algorithms, along with percentage differences compared to those reported in the literature. Additionally, for existing DCT-VII algorithms that do not include normalization, we indicate in parentheses the number of multiplications required for normalization.
5. Discussion
Before comparing the proposed and existing fast DCT-VII algorithms, several clarifications are necessary. Unlike the transform definitions in [
1], the DCT-VII matrix in [
18] is presented without normalization constants for the sake of simplicity. The authors of [
18] argue that normalization does not affect the factorization of the transforms. In our view, this is not entirely accurate. Including the normalization of the considered transform can influence both the number of arithmetic operations required for a DCT-VII implementation and, in some cases, the structure of the matrix itself.
Many publications assume that the normalization constants can be applied at later stages of data processing and merged with other operations. However, this simplification is not always feasible. When it cannot be used, normalization must be introduced explicitly, resulting in N additional multiplications. Therefore, to obtain correct quantitative estimates of computational complexity, these N extra multiplications must be included in any N-point algorithm; otherwise, the reported estimates are incomplete. To avoid such issues, it is essential to include the normalization constants directly in the original transform matrix. Keeping normalization explicit throughout also enables the obtaining of new and interesting solutions.
Accordingly, we consider here the factorization of original DCT-VII matrices whose entries already include the appropriate normalization constants. Our analysis shows that for
N = 8, the proposed DCT-VII algorithm requires the same number of multiplications as the corresponding algorithm in [
18], though it requires 14% more additions. However, once normalization constants were not included, the eight-point DCT-VII algorithm of [
18] requires eight additional multiplications. Similarly, for
N = 4, the proposed DCT-VII algorithm requires the same number of additions as the four-point algorithm in [
18], but its multiplication count increases by 75% (7 versus 4). When normalization constants are not included, the four-point DCT-VII algorithm of [
18] also requires four additional multiplications. To the best of our knowledge, no other algorithms are available in the literature for direct comparison. Furthermore, comparing the proposed fast DCT-VII algorithms with integer transform algorithms is, in our opinion, inappropriate due to their different mathematical background.
Using the structural approach, we have derived data-flow graphs for fast DCT-VII algorithms in which each path from an input to an output contains only a single multiplication. If such a path contains more than one multiplication, additional implementation problems arise. The data-flow graph of the four-point DCT-VII algorithm in [
18] satisfies this property, whereas the eight-point algorithm in [
18] does not.
Table 3 shows the memory consumption results for the proposed DCT-VII algorithms. The number of required memory cells was calculated based on the pseudocode implementations described in
Section 3, which are provided in
Appendix A. On average, our solutions require 38% more memory than the direct matrix-vector product, measured across input sizes from 3 to 8.
It is important to note that memory consumption is highly dependent on implementation details, such as platform, coding approach, and designer experience, unlike the more objective measure of arithmetic complexity. The developed DCT-VII algorithms are suitable for software implementation, where memory usage, timing delays, and resource requirements may vary. Memory cells can often be reused across different algorithm stages, and the algorithms can be executed sequentially, in parallel, or in sequential-parallel forms, all of which influence latency. Therefore, assessing memory efficiency is inherently subjective. As a result, arithmetic complexity remains the most reliable and implementation-independent index for evaluating the efficiency of the proposed algorithms.
6. Conclusions
This paper presents novel fast algorithms for computing the DCT-VII, specifically developed for short-length input sequences. These algorithms significantly reduce the number of multiplications required for DCT-VII implementation compared to the direct matrix-vector product. A comprehensive, step-by-step description of each computational stage is provided, including the output results at every step.
Furthermore, data-flow graphs for the proposed algorithms are introduced to represent the space-time structure of the computational processes visually. These graphs not only clarify the computational flow but also enable estimation of the number of arithmetic operations, specifically, multiplications and additions, required for DCT-VII calculation. Each path connecting the input and output in the constructed data flow graphs includes only a single multiplication operation. This is an advantage over alternative designs, in which such a path may involve multiple sequential multiplications. Reducing the number of multiplications along the input-to-output paths in the constructed data flow graphs accelerates computation and simplifies hardware implementation design.
Additionally, pseudocodes for the constructed algorithms were developed with variable reuse. This reduces the memory required for software implementation of the proposed algorithms. The designed pseudocodes ensure that these algorithms can be directly applied to audio, image, and video coding, as well as to data processing tasks, including image watermarking, encryption, and wireless communication systems.
A comparative analysis between the computational complexity of the presented fast DCT-VII algorithms and direct matrix-vector products reveals significant improvements. For input sequence lengths varying from 3 to 8, the number of multiplications is reduced on average by approximately 66%, while the number of additions decreases on average by nearly 6% within the same input range.