Next Article in Journal
AIDE: An Active Inference-Driven Framework for Dynamic Evaluation via Latent State Modeling and Generative Reasoning
Previous Article in Journal
MDB-YOLO: A Lightweight, Multi-Dimensional Bionic YOLO for Real-Time Detection of Incomplete Taro Peeling
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Fast Algorithms for Small-Size Type VII Discrete Cosine Transform

by
Marina Polyakova
1,*,
Aleksandr Cariow
2,* and
Mirosław Łazoryszczak
2
1
Institute of Computer Systems, Odesa Polytechnic National University, Shevchenko ave. 1, 65044 Odesa, Ukraine
2
Faculty of Computer Science and Information Technology, West Pomeranian University of Technology in Szczecin, Żołnierska 49, 71-210 Szczecin, Poland
*
Authors to whom correspondence should be addressed.
Electronics 2026, 15(1), 98; https://doi.org/10.3390/electronics15010098
Submission received: 3 December 2025 / Revised: 18 December 2025 / Accepted: 23 December 2025 / Published: 24 December 2025
(This article belongs to the Section Computer Science & Engineering)

Abstract

This paper presents new fast algorithms for the type VII discrete cosine transform (DCT-VII) applied to input data sequences of lengths ranging from 3 to 8. Fast algorithms for small-sized trigonometric transforms enable the processing of small data blocks in image and video coding with low computational complexity. To process the information in image and video coding standards, the fast DCT-VII algorithms can be used, taking into account the relationships between the DCT-VII and the type II discrete cosine transform (DCT-II). Additionally, such algorithms can be used in other digital signal processing tasks as components for constructing algorithms for large-sized transforms, leading to reduced system complexity. Existing fast odd DCT algorithms have been designed using relationships among discrete cosine transforms (DCTs), discrete sine transforms (DSTs), and the discrete Fourier transform (DFT); among different types of DCTs and DSTs; and between the coefficients of the transform matrix. However, these algorithms require a relatively large number of multiplications and additions. The process of obtaining such algorithms is difficult to understand and implement. To overcome these shortcomings, this paper applies a structural approach to develop new fast DCT-VII algorithms. The process begins by expressing the DCT-VII as a matrix-vector multiplication, then reshaping the block structure of the DCT-VII matrix to align with matrix patterns known from the basic papers in which the structural approach was introduced. If the matrix block structure does not match any known pattern, rows and columns are reordered, and sign changes are applied as needed. If this is insufficient, the matrix is decomposed into the sum of two or more matrices, each analyzed separately and transformed similarly if required. As a result, factorizations of DCT-VII matrices for different input sequence lengths are obtained. Based on these factorizations, fast DCT-VII algorithms with reduced arithmetic complexity are constructed and presented with pseudocode. To illustrate the computational flow of the resulting algorithms and their modular design, which is suitable for VLSI implementation, data-flow graphs are provided. The new DCT-VII algorithms reduce the number of multiplications by approximately 66% compared to direct matrix-vector multiplication, although the number of additions decreases by only about 6%.

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 N 3 multiplications and N 2 ( N 1 ) additions, i.e., has O( N 3 ) 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 (2N + 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 (2N + 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.

2. Mathematical Background

The DCT-VII is applied primarily in digital signal processing fields such as image and video coding [10,19]. This transform can be represented by the following expression [12]:
y k = 2 2 N 1   n = 0 N 1   σ kn   x n   cos π k 2 n + 1 2 N 1 ,   k = 0 ,   1 ,   ,   N 1 ,
where x n is an input signal, y k is the output signal after the DCT-VII, σ kn is a normalizing constant, σ kn = 1 2 , if k = 0 and n = 0 ,   1 ,   ,   N 1 ; or k = 0 ,   1 ,   ,   N 1 and n = N 1 .
We express the DCT-VII as a matrix-vector product:
Y N × 1   =   C N X N × 1 ,
where C N   = c 0 , 0 c 0 , 1 c 0 , N 1 c 1 , 0 c 1 , 1 c 1 , N 1 c N 1 , 0 c N 1 , 1 c N 1 , N 1 , c k n   = 2 2 N 1 σ kn cos π k 2 n + 1 2 N 1 , n, k = 0, 1,…, N – 1; Y N × 1 = y 0 ,   y 1 ,   ,   y N 1 T , X N × 1 = x 0 ,   x 1 , ,   x N     1 T .
The following notations are used in this article:
  • ⊕ is the direct sum of two matrices;
  • ⊗ is a Kronecker product of two matrices;
  • H 2 is a 2 × 2 Hadamard matrix;
  • I N is an order N identity matrix;
  • P N is an order N permutation matrix;
  • s m ( N ) is a constant coefficient multiplier;
  • T M × N and T N are matrices describing pre-additions and post-additions;
  • D N is a diagonal matrix of order N, whose elements represent the calculated values of the cosines.

3. Algorithms for the Small-Size DCT-VII with Reduced Complexity

3.1. Algorithm for the Three-Point DCT-VII

Let us express the three-point DCT-VII as follows:
Y 3 × 1   =   C 3 X 3 × 1 ,
where Y 3 × 1 = y 0 ,   y 1 ,   y 2 T , X 3 × 1 = x 0 ,   x 1 ,   x 2 T , C 3 = a 3 a 3 d 3 b 3 c 3 a 3 c 3 b 3 a 3 with a 3 = 2 5   0.6325, b 3 = 2 5 cos π 5 0.7236, c 3 = 2 5 cos 2 π 5 0.2764, d 3 = 1 5 0.4472.
To factorize matrix C 3 , we change the sign of the entries in the second column and decompose the resulted matrix C 3 ( a ) into two components:
C 3 ( a ) = C 3 ( b ) + C 3 ( c ) ,
where C 3 ( b ) = a 3 a 3 d 3 0 0 a 3 0 0 a 3 and C 3 ( c ) = 0 0 0 b 3 c 3 0 c 3 b 3 0 .
The first row and third column of matrix C 3 ( b )   consist of the identical entries that differ only in sign were obtained. As a result, the number of arithmetic operations for the three-point DCT-VII can be reduced without additional transforms of the matrix C 3 ( b ) [6]. In matrix C 3 ( c ) , the row and column with only zero entries were deleted. The resulting matrix C 2 ( c ) = b 3 c 3 c 3 b 3 can be factorized as follows [31]:
C 2 ( c ) = H 2 × diag ( ( b 3 + c 3 ) / 2 ,   ( b 3 c 3 ) / 2 ) H 2 .
Using Equation (5), we factorize the three-point DCT-VII matrix and yield the expression [6,31]:
Y 3 × 1 = ( 1 H 2 ) T 3 × 5 D 5 T 5 × 3 ( H 2 1 ) X 3 × 1
where T 3 × 5 = 1 1 0 0 0 0 0 1 0 0 0 0 0 1 1 , T 5 × 3 = 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 , D 5 = diag s 0 ( 3 ) ,   s 1 ( 3 ) ,   1 / 2 ,   s 2 ( 4 ) ,   s 3 ( 4 ) , s 0 ( 3 ) = d 3 , s 1 ( 3 ) = s 3 ( 3 ) = a 3 , ( b 3 + c 3 ) / 2 = 1 / 2 , s 2 ( 3 ) = ( b 3 c 3 ) / 2 .
Based on the DCT-VII matrix Factorization (6), we present a data flow graph of the three-point DCT-VII algorithm in Figure 1. Applying this algorithm, we can reduce the number of multiplications from 9 to 4; the number of additions remains the same, and a shift is required.

3.2. Algorithm for the Four-Point DCT-VII

We define the four-point DCT-VII as follows:
Y 4 × 1 = C 4 X 4 × 1 ,
where Y 4 × 1 = y 0 ,   y 1 ,   y 2 ,   y 3 T , X 4 × 1 = x 0 ,   x 1 ,   x 2 ,   x 3 T , C 4 = a 4 a 4 a 4 e 4 b 4 d 4 c 4 a 4 c 4 b 4 d 4 a 4 d 4 c 4 b 4 a 4 with a 4 = 2 7 0.5345 , b 4 = 2 7 cos π 7 0.6811 , c 4 = 2 7 cos 2 π 7 0.4713 , d 4 = 2 7 cos 3 π 7 0.1682 , e 4 = 1 7 0.3780 .
We have altered the sign of the third row of matrix C 4 . The resulting matrix C 4 ( a ) was decomposed into two components:
C 4 ( a ) = C 4 ( b ) + C 4 ( c ) ,
where C 4 ( b ) = a 4 a 4 a 4 e 4 0 0 0 a 4 0 0 0 a 4 0 0 0 a 4 and C 4 ( c ) = 0 0 0 0 b 4 d 4 c 4 0 c 4 b 4 d 4 0 d 4 c 4 b 4 0 .
The first row and the third column of matrix C 4 ( b ) have several identical entries that differ only in sign. Thus, the number of arithmetic operations can be reduced without performing additional transforms for this matrix [6]. In matrix C 4 ( c ) , we remove the row and column that contain only zero entries.
The obtained matrix C 3 ( d ) = b 4 d 4 c 4 c 4 b 4 d 4 d 4 c 4 b 4 matches the cyclic convolution template H 3 = h 1 h 0 h 2 h 2 h 1 h 0 h 0 h 2 h 1 where h 0 = d 4 , h 1 = b 4 , and h 2 = c 4 . The factorization of the template H 3 is known from [32]:
H 3 = A 3 × 4 × diag ( h 0 + h 1 + h 2 ) / 3 ,   ( 2 h 1 h 0 h 2 ) / 3 ,   ( h 1 2 h 0 + h 2 ) / 3 ,   ( h 0 + h 1 2 h 2 ) / 3 A 4 × 3
where A 3 × 4 = 1 0 1 1 1 1 0 1 1 1 1 0 , A 4 × 3 = 1 1 1 0 1 1 1 1 0 1 0 1 . Based on Expression (9), we obtain the factorization of the four-point DCT-VII matrix as follows:
Y 4 × 1 = T 4 × 5 T 5 × 7 D 7 T 7 × 5 T 5 × 4 X 4 × 1 ,
where T 5 × 4 = A 4 × 3 1 , D 7 = diag s 0 ( 4 ) ,   s 1 ( 4 ) ,   s 2 ( 4 ) ,   s 3 ( 4 ) ,   s 4 ( 4 ) ,   s 5 ( 4 ) ,   s 6 ( 4 ) , s 0 ( 4 ) = a 4 , s 1 ( 4 ) = ( d 4 + b 4 c 4 ) / 3 , s 2 ( 4 ) = ( 2 b 4 d 4 + c 4 ) / 3 , s 3 ( 4 ) = ( b 4 2 d 4 c 4 ) / 3 , s 4 ( 4 ) = ( d 4 + b 4 + 2 c 4 ) / 3 , s 5 ( 4 ) = e 4 , s 6 ( 4 ) = a 4 , T 4 × 5 = 1 0 0 0 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 0 , T 7 × 5 = 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 , T 5 × 7 = 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 .
The data flow graph of the four-point DCT-VII algorithm is presented in Figure 2. Compared to the direct matrix-vector product, the number of multiplications is reduced from 16 to 7. However, the number of additions is increased from 12 to 13.

3.3. Algorithm for the Five-Point DCT-VII

The five-point DCT-VII is expressed as follows
Y 5 × 1 = C 5 X 5 × 1 ,
where Y 5 × 1 = y 0 ,   y 1 ,   y 2 ,   y 3 ,   y 4 T , X 5 × 1 = x 0 ,   x 1 ,   x 2 ,   x 3 ,   x 4 T , C 5 = a 5 a 5 a 5 a 5 d 5 b 5 d 5 e 5 c 5 a 5 c 5 d 5 b 5 e 5 a 5 d 5 f 5 d 5 d 5 a 5 e 5 d 5 c 5 b 5 a 5 , with a 5 = 2 9 0.4714 , b 5 = 2 9 cos π 9 0.6265 , c 5 = 2 9 cos 2 π 9 0.5107 , d 5 = 2 9 cos π 3 0.3333 , e 5 = 2 9 cos 4 π 9 0.1158 , f 5 = 1 9 = 1 d 5 0.6667 .
Let us multiply the second row of matrix C 5 by 1 and decompose the resulting matrix C 5 ( a ) into two submatrices:
C 5 ( a ) = C 5 ( b ) + C 5 ( c ) ,
where C 5 ( b ) = a 5 a 5 a 5 a 5 d 5 0 d 5 0 0 a 5 0 d 5 0 0 a 5 d 5 1 + d 5 d 5 d 5 a 5 0 d 5 0 0 a 5 and C 5 ( c ) = 0 0 0 0 0 b 5 0 e 5 c 5 0 c 5 0 b 5 e 5 0 0 0 0 0 0 e 5 0 c 5 b 5 0 .
Firstly, we factorize matrix C 5 ( b ) , taking into account the similar entries:
C 5 ( b ) = A 5 ( 1 ) A 5 × 6 × diag s 0 ( 5 ) ,   s 1 ( 5 ) ,   s 2 ( 5 ) ,   1 ,   s 3 ( 5 ) ,   s 4 ( 5 ) A 6 × 5 A 5 ( 0 ) ,
where A 5 ( 1 ) = 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 1 0 1 1 0 0 0 1 0 0 , A 6 × 5 = 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 , A 5 × 6 = 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 , A 5 ( 0 ) = 1 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 , s 0 ( 5 ) = d 5 , s 1 ( 5 ) = a 5 , s 2 ( 5 ) = d 5 , s 3 ( 5 ) = d 5 , s 4 ( 5 ) = a 5 .
Secondly, matrix C 5 ( b ) is factorized. In matrix C 5 ( c ) we delete the row and column with only zero entries. The resulting matrix C 4 ( d ) = b 5 e 5 c 5 c 5 b 5 e 5 e 5 c 5 b 5 matches the cyclic convolution template H 3 = h 1 h 0 h 2 h 2 h 1 h 0 h 0 h 2 h 1 where h 0 = e 5 , h 1 = b 5 , and h 2 = c 5 . Then, based on Equation (9) matrix C 4 ( d ) is expressed as [32]:
C 4 ( d ) = A 3 × 4 × diag ( h 0 + h 1 + h 2 ) / 3 ,   ( 2 h 1 h 0 h 2 ) / 3 ,   ( h 1 2 h 0 + h 2 ) / 3 ,   ( h 0 + h 1 2 h 2 ) / 3 A 4 × 3 .
The first element of the diagonal matrix in Expression (14) is nearly equal to zero: ( h 0 + h 1 + h 2 ) / 3 = ( e 5 b 5 + c 5 ) / 3 ( 0.1158 0.6265 + 0.5107 ) / 3 0 . Then, Equation (14) can be transformed as follows:
C 4 ( d ) = A 3 ( 1 ) × diag s 5 ( 5 ) ,   s 6 ( 5 ) ,   s 7 ( 5 ) A 3 ( 0 ) ,
where A 3 ( 1 ) = 1 0 1 1 1 0 0 1 1 , A 3 ( 0 ) = 1 1 0 1 0 1 0 1 1 , s 5 ( 5 ) = ( 2 b 5 e 5 c 5 ) / 3 ,   s 6 ( 5 ) = ( b 5 2 e 5 + c 5 ) / 3 , s 7 ( 5 ) = ( e 5 b 5 2 c 5 ) / 3 .
Based on Expressions (12), (13), and (15), the factorization of the five-point DCT-VII matrix is obtained as:
Y 5 × 1 = T 5 × 8 T 8 × 9 D 9 T 9 × 8 T 8 × 5 X 5 × 1 ,
where
D 9 = diag s 0 ( 5 ) ,   s 1 ( 5 ) ,   s 2 ( 5 ) ,   1 ,   s 3 ( 5 ) ,   s 4 ( 5 ) ,   s 5 ( 5 ) ,   s 6 ( 5 ) ,   s 7 ( 5 ) , T 8 × 9 = A 5 × 6 A 3 ( 1 ) , T 9 × 8 = A 6 × 5 A 3 ( 0 ) , T 5 × 8 = 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 1 0 0 0 0 0 0 1 0 0 0 1 0 , T 8 × 5 = 1 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 .
We present the data flow graph of the five-point DCT-VII algorithm, which reduces the number of multiplications from 25 to 8 compared to the direct matrix-vector product. The number of additions has decreased from 20 to 16 (Figure 3).

3.4. Algorithm for Six-Point DCT-VII

Let us derive an algorithm for six-point DCT-VII, expressing this transform by the following equation:
Y 6 × 1 = C 6 X 6 × 1 ,
where Y 6 × 1 = y 0 y 1 y 2 y 3 y 4 y 5 , X 6 × 1 = x 0 x 1 x 2 x 3 x 4 x 5 , C 6 = a 6 a 6 a 6 a 6 a 6 g 6 b 6 d 6 f 6 e 6 c 6 a 6 c 6 f 6 b 6 d 6 e 6 a 6 d 6 c 6 e 6 b 6 f 6 a 6 e 6 b 6 c 6 f 6 d 6 a 6 f 6 e 6 d 6 c 6 b 6 a 6 with a 6 = 2 11 0.4264 , b 6 = 2 11 cos π 11 0.5786 , c 6 = 2 11 cos 2 π 11 0.5073 , d 6 = 2 11 cos 3 π 11 0.3949 , e 6 = 2 11 cos 4 π 11 0.2505 , f 6 = 2 11 cos 5 π 11 0.0858 , g 6 = 1 11 0.3015 .
We alter the sign in the third and fifth rows of matrix C 6 . Further, the permutations:
π 1 = 1 2 3 4 5 6 1 5 3 2 6 4   and   π 2 = 1 2 3 4 5 6 1 5 4 2 3 6 ,
were introduced. The order of rows and columns of matrix C 6 was changed in accordance with π 1 and π 2 , respectively. The matrices of such transforms are P 6 ( 1 ) = 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 and P 6 ( 0 ) = 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 .
The resulting matrix C 6 ( a ) = a 6 a 6 a 6 a 6 a 6 g 6 e 6 d 6 f 6 b 6 c 6 a 6 c 6 e 6 d 6 f 6 b 6 a 6 b 6 c 6 e 6 d 6 f 6 a 6 f 6 b 6 c 6 e 6 d 6 a 6 d 6 f 6 b 6 c 6 e 6 a 6 can be decomposed as:
C 6 ( a ) = C 6 ( b ) + C 6 ( c ) ,
where C 6 ( b ) = a 6 a 6 a 6 a 6 a 6 g 6 0 0 0 0 0 a 6 0 0 0 0 0 a 6 0 0 0 0 0 a 6 0 0 0 0 0 a 6 0 0 0 0 0 a 6 and C 6 ( c ) = 0 0 0 0 0 0 e 6 d 6 f 6 b 6 c 6 0 c 6 e 6 d 6 f 6 b 6 0 b 6 c 6 e 6 d 6 f 6 0 f 6 b 6 c 6 e 6 d 6 0 d 6 f 6 b 6 c 6 e 6 0 .
After deleting the zero entries from matrix C 6 ( c ) , we observe that the resulting matrix C 5 ( d ) = e 6 d 6 f 6 b 6 c 6 c 6 e 6 d 6 f 6 b 6 b 6 c 6 e 6 d 6 f 6 f 6 b 6 c 6 e 6 d 6 d 6 f 6 b 6 c 6 e 6 has the structure of the circular convolution matrix for N = 5. We denote this matrix as H 5 = h 0 h 4 h 3 h 2 h 1 h 1 h 0 h 4 h 3 h 2 h 2 h 1 h 0 h 4 h 3 h 3 h 2 h 1 h 0 h 4 h 4 h 3 h 2 h 1 h 0 with h 0 = e 6 , h 1 = c 6 , h 2 = b 6 , h 3   = f 6 , and h 4 = d 6 .
Matrix H 5 can be factorized into a matrix product [32]:
H 5 = T 5 T 5 × 7 T 7 × 10 D 10 T 10 × 7 T 7 × 5 T 5 P 5 ,
where D 10 = diag ( s 0 6 ,   s 1 6 ,   s 2 6 ,   s 3 6 ,   s 4 6 ,   s 5 6 ,   s 6 6 ,   s 7 6 ,   s 8 6 ,   s 9 ( 6 ) ) , s 0 6 = ( h 0 + h 1 + h 2 + h 3 + h 4 ) / 5 , s 1 6 = h 0 + h 2 h 3 h 4 ,   s 2 6 = h 0 + h 4 h 3 h 1 , s 3 6 = h 0 h 3 , s 4 6 = h 0 + h 1 h 2 h 4 , s 5 6 = h 0 + h 3 h 2 h 1 , s 6 6 = h 0 h 2 , s 7 6 = h 0 h 4 , s 8 6 = h 0 h 1 , s 9 6 = h 0 s 0 6 , T 5 × 7 = 1 ( T 2 × 3 ( 1 ) I 2 ) , T 2 × 3 ( 1 ) = 1 0 1 0 1 1 , T 7 × 10 = 1 T 2 × 3 ( 1 ) T 2 × 3 ( 1 ) T 2 × 3 ( 1 ) , T 10 × 7 = 1 T 3 × 2 ( 3 ) T 3 × 2 ( 3 ) T 3 × 2 ( 3 ) , T 3 × 2 ( 3 ) = 1 0 0 1 1 1 , T 7 × 5 = 1 ( T 3 × 2 ( 3 ) I 2 ) , T 5   = 1 1 1 1 1 1 1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 1 , and P 5 = 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 .
Based on Factorization (20), the matrices T 6 = T 5 1 , T 9 × 13 = T 7 × 10 1 1 0 0 0 1 , and T 13 × 9 = T 10 × 7 1 0 0 1 0 1 , were introduced. Then, the factorization of the matrix of the six-point DCT-VII can be given as [6]:
Y 6 × 1 = P 6 ( 2 ) T 6 T 6 × 9 T 9 × 13 D 13 T 13 × 9 T 9 × 6 T 6 P 6 ( 3 ) X 6 × 1
where D 13 = D 10 diag ( s 10 6 ,   s 11 6 ,   s 12 6 ) , s 10 6 = a 6 , s 11 6 = g 6 , s 12 6 = a 6 , P 6 ( 3 ) = ( P 5 1 ) P 6 ( 0 ) ,
P 6 ( 2 ) = P 6 ( 1 ) T 6 ( 1 ) = P 6 ( 1 ) 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 = 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 ,
T 9 × 6 = 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 ,   T 6 × 9 = 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 .
We show the algorithm of the six-point DCT-VII in Figure 4. The number of multiplications can be reduced from 36 to 13, but the number of additions is increased from 30 to 33.

3.5. Algorithm for Seven-Point DCT-VII

To construct the algorithm for seven-point DCT-VII, we use the representation:
Y 7 × 1 = C 7 X 7 × 1 ,
where Y 7 × 1 = y 0 y 1 y 2 y 3 y 4 y 5 y 6 , X 7 × 1 = x 0 x 1 x 2 x 3 x 4 x 5 x 6 , C 7 = a 7 a 7 a 7 a 7 a 7 a 7 h 7 b 7 d 7 f 7 g 7 e 7 c 7 a 7 c 7 g 7 d 7 b 7 f 7 e 7 a 7 d 7 e 7 c 7 f 7 b 7 g 7 a 7 e 7 b 7 g 7 c 7 d 7 f 7 a 7 f 7 c 7 b 7 e 7 g 7 d 7 a 7 g 7 f 7 e 7 d 7 c 7 b 7 a 7 with a 7 = 2 13 0.3922 , b 7 = 2 13 cos π 13 0.5386 , c 7 = 2 13 cos 2 π 13 0.4912 , d 7 = 2 13 cos 3 π 13 0.4152 , e 7 = 2 13 cos 4 π 13 0.3151 , f 7 = 2 13 cos 5 π 13 0.1967 , g 7 = 2 13 cos 6 π 13 0.0669 , h 7 = 1 13 0.2774 .
Let us define the permutations:
π 3 = 1 2 3 4 5 6 7 1 4 2 3 5 6 7 and π 4 = 1 2 3 4 5 6 7 1 2 3 5 6 4 7 ,
and after the order of the columns of matrix C 7 with π 3 and the order of rows of C 7 with π 4 . Also, the sign of the third, fourth, and seventh rows was changed. The permutation matrices were as follows:
P 7 ( 1 ) = 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 ,   P 7 ( 0 ) = 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1
Next, we decompose the resulting matrix C 7 ( a ) into the sum of two matrices:
C 7 ( a ) = C 7 ( b ) + C 7 ( c ) ,
where
C 7 ( b ) = a 7 a 7 a 7 a 7 a 7 a 7 h 7 0 0 0 0 0 0 a 7 0 0 0 0 0 0 a 7 0 0 0 0 0 0 a 7 0 0 0 0 0 0 a 7 0 0 0 0 0 0 a 7 0 0 0 0 0 0 a 7 ,   C 7 ( c ) = 0 0 0 0 0 0 0 b 7 g 7 d 7 f 7 e 7 c 7 0 c 7 b 7 g 7 d 7 f 7 e 7 0 e 7 c 7 b 7 g 7 d 7 f 7 0 f 7 e 7 c 7 b 7 g 7 d 7 0 d 7 f 7 e 7 c 7 b 7 g 7 0 g 7 d 7 f 7 e 7 c 7 b 7 0 .
Have eliminated the rows and columns with only zero entries in matrix C 7 ( c ) , we observe that the obtained matrix
C 6 ( d ) = b 7 g 7 d 7 f 7 e 7 c 7 c 7 b 7 g 7 d 7 f 7 e 7 e 7 c 7 b 7 g 7 d 7 f 7 f 7 e 7 c 7 b 7 g 7 d 7 d 7 f 7 e 7 c 7 b 7 g 7 g 7 d 7 f 7 e 7 c 7 b 7 .
has the structure of a circular convolution matrix [32]. The circular convolution matrix for N = 6 can be presented as follows:
H 6 = h 0 h 5 h 4 h 3 h 2 h 1 h 1 h 0 h 5 h 4 h 3 h 2 h 2 h 1 h 0 h 5 h 4 h 3 h 3 h 2 h 1 h 0 h 5 h 4 h 4 h 3 h 2 h 1 h 0 h 5 h 5 h 4 h 3 h 2 h 1 h 0 .
Based on the paper [32], we give the factorization of matrix H 6 :
H 6 = T 6 ( a ) T 6 ( 1 ) T 6 T 6 × 8 × diag ( s 2 7 ,     s 3 7 ,     s 4 7 ,   s 5 7 ,   s 6 7 ,   s 7 7 ,   s 8 7 ,   s 9 ( 7 ) ) T 8 × 6 T 6 T 6 ( 0 ) T 6 ( a ) ,
where T 6 × 8 = I 2 T 3 × 4 , T 8 × 6 = I 2 T 4 × 3 , T 6 ( a ) = H 2 I 3 , T 6   =   1 1 1 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 , T 3 × 4 = 1 1 1 1 1 , T 4 × 3 = 1 1 1 1 1 , T 6 ( 0 ) = 1 1 1 1 1 1 ,
s 2 7 = ( h 0 + h 1 + h 2 + h 3 + h 4 + h 5 ) / 6 ,   s 3 7 = ( h 2 + h 5 h 0 h 3 ) / 2 ,   s 4 7 = ( h 1 + h 4 h 0 h 3 ) / 2 ,   s 5 7 = ( h 0 +   h 3 ) / 2 s 2 7 ,   s 6 7 = ( h 0 h 1 + h 2 h 3 + h 4 h 5 ) / 6 ,   s 7 7 = ( h 2 h 5 h 0 + h 3 ) / 2 ,   s 8 7 = ( h 4 h 1 h 0 + h 3 ) / 2 ,   s 9 7 = ( h 0 h 3 ) / 2 s 6 7 ,   T 6 ( 1 ) = I 4 ( 1 ) 1 .
Let us take into account that h 0 = b 7 , h 1 = c 7 , h 2 = e 7 , h 3 = f 7 , h 4 = d 7 , h 5 = g 7 . Then, we derive the following scaling factors:
s 2 7 = ( b 7 c 7 e 7 + f 7 + d 7 g 7 ) / 6 ,   s 3 7 = ( e 7 g 7 b 7 f 7 ) / 2 ,   s 4 7 = ( c 7 + d 7 b 7 f 7 ) / 2 , s 5 7 = ( b 7 + f 7 ) / 2 s 2 7 ,   s 6 7 = ( b 7 + c 7 e 7 f 7 + d 7 + g 7 ) / 6 ,   s 7 7 = ( e 7 + g 7 b 7 +   f 7 ) / 2 ,   s 8 7 = ( d 7 + c 7 b 7 + f 7 ) / 2 ,   s 9 7 = ( b 7 f 7 ) / 2 s 6 7 .
For reducing the number of operations for seven-point DCT-VII, we also take into consideration the entries in the last column and the first row of matrix C 7 ( b ) which differ only in a sign [6]. As a result, the factorization of the matrix of the seven-point DCT-VII was obtained as:
Y 7 × 1 = P 7 ( 1 ) T 7 × 9 T 9 ( a ) T 9 ( 1 ) T 9 T 9 × 11 D 11 T 11 × 7 T 7 T 7 ( a ) P 7 ( 0 ) X 7 × 1 ,
where D 11 = diag ( s 0 7 ,   s 1 7 ,   s 2 7 ,   s 3 7 ,   s 4 7 ,   s 5 7 ,   s 6 7 ,   s 7 ( 7 ) ,   s 8 7 ,   s 9 ( 7 ) ,   s 10 7 ) , s 0 7 = a 7 , s 1 7 = d 7 , s 10 7 = a 7 , T 9 × 11 = I 3 T 2 × 3 ( 1 ) 1 T 2 × 3 ( 1 ) 1 , T 9 ( 1 ) = I 7 ( 1 ) 1 , T 7 ( a ) = T 6 ( a ) 1 , T 9 = I 2 T 6 1 , T 7 = ( T 6 1 ) ( T 6 ( 0 ) 1 ) ,
T 9 ( a ) = I 2 T 6 ( a ) 1 ,   T 7 × 9 = 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 1 ,   T 11 × 7 = 1 0 1 T 3 × 2 ( 3 ) 1 T 3 × 2 ( 3 ) 1 .
Thus, for the seven-point DCT-VII, the fast algorithm is developed and presented in Figure 5 by a data flow graph. Using this algorithm, we can reduce the number of multiplications from 49 to 11, but the number of additions decreased from 42 to 41.

3.6. Algorithm for Eight-Point DCT-VII

To develop the algorithm for the eight-point DCT-VII, we express this transform with a matrix-vector product:
Y 8 × 1 = C 8 X 8 × 1 ,
where Y 8 × 1 = y 0 y 1 y 2 y 3 y 4 y 5 y 6 y 7 , X 8 × 1 = x 0 x 1 x 2 x 3 x 4 x 5 x 6 x 7 , C 8 = a 8 a 8 a 8 a 8 a 8 a 8 a 8 f 8 b 8 d 8 f 8 h 8 g 8 e 8 c 8 a 8 c 8 g 8 f 8 b 8 d 8 h 8 e 8 a 8 d 8 g 8 p 8 g 8 d 8 d 8 g 8 a 8 e 8 d 8 f 8 c 8 g 8 b 8 h 8 a 8 f 8 p 8 f 8 f 8 p 8 f 8 f 8 a 8 g 8 d 8 p 8 d 8 g 8 g 8 d 8 a 8 h 8 g 8 f 8 e 8 d 8 c 8 b 8 a 8 with a 8 = 2 15 0.3651 , b 8 = 2 15 cos π 15 0.5051 , c 8 = 2 15 cos 2 π 15 0.4718 , d 8 = 2 15 cos π 5 0.4178 , e 8 = 2 15 cos 4 π 15 0.34 , f 8 = 2 15 cos π 3 0.2582 , g 8 = 2 15 cos 2 π 5 0.1596 , h 8 = 2 15 cos 7 π 15 0.0540 , p 8 = 1 15 0.5164 .
Let us change the sign of the third and fifth rows of matrix  C 8 . Next, to alter the order of rows and columns of matrix  C 8 , the permutations  π 5 = 1 2 3 4 5 6 7 8 1 6 4 7 2 3 5 8  and  π 6 = 1 2 3 4 5 6 7 8 1 4 6 7 2 5 3 8  were defined. The permutation matrices  P 8 ( 1 )  and  P 8 ( 0 )  are expressed as:
P 8 ( 1 ) = 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 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 1 ,   P 8 ( 0 ) = 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 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 0 0 0 0 1 .
The obtained matrix C 8 ( a ) = a 8 a 8 a 8 a 8 a 8 a 8 a 8 f 8 f 8 f 8 f 8 f 8 p 8 p 8 f 8 a 8 d 8 g 8 d 8 g 8 g 8 d 8 p 8 a 8 g 8 d 8 g 8 d 8 d 8 g 8 p 8 a 8 b 8 h 8 e 8 c 8 d 8 g 8 f 8 a 8 c 8 b 8 h 8 e 8 g 8 d 8 f 8 a 8 e 8 c 8 b 8 h 8 d 8 g 8 f 8 a 8 h 8 e 8 c 8 b 8 g 8 d 8 f 8 a 8 can be decomposed as follows:
C 8 ( a ) = C 8 ( b ) + C 8 ( c ) ,
where:
C 8 ( b ) = a 8 a 8 a 8 a 8 a 8 a 8 a 8 f 8 f 8 f 8 f 8 f 8 p 8 p 8 f 8 a 8 d 8 g 8 d 8 g 8 g 8 d 8 p 8 a 8 g 8 d 8 g 8 d 8 d 8 g 8 p 8 a 8 0 0 0 0 d 8 g 8 f 8 a 8 0 0 0 0 g 8 d 8 f 8 a 8 0 0 0 0 d 8 g 8 f 8 a 8 0 0 0 0 g 8 d 8 f 8 a 8 ,   C 8 ( c ) = 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 b 8 h 8 e 8 c 8 0 0 0 0 c 8 b 8 h 8 e 8 0 0 0 0 e 8 c 8 b 8 h 8 0 0 0 0 h 8 e 8 c 8 b 8 0 0 0 0 .
The submatrix C 4 ( d ) = b 8 h 8 e 8 c 8 c 8 b 8 h 8 e 8 e 8 c 8 b 8 h 8 h 8 e 8 c 8 b 8 of matrix C 8 ( c ) has the structure of a circular convolution matrix [32] for N = 4, which can be presented as H 4 = h 0 h 3 h 2 h 1 h 1 h 0 h 3 h 2 h 2 h 1 h 0 h 3 h 3 h 2 h 1 h 0 with h 0 = b 8 , h 1 = c 8 , h 2 = e 8 , and h 3   =   h 8 .
Using the entries of matrix H 4 , we introduce vector A 5 × 1 of scaling factors for the factorization of the circular convolution matrix C 4 ( d ) :
A 5 × 1 = 1 / 4 × diag ( 1 , 1 , 2 , 2 , 2 ) × A 5 × 4 ( 0 ) A 4 × h 0 , h 1 , h 2 , h 3 T ,
where A 5 × 4 ( 0 ) = 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 0 0 1 0 and A 4 = H 2 I 2 . Then, matrix H 4 is factorized with expression:
H 4 = A 4 A 4 × 5 × diag ( A 5 × 1 ) × A 5 × 4 P 4 A 4 ,
where A 4 × 1 = ( s 2 8 ,   s 3 8 ,   s 4 8 ,   s 5 8 ,   s 6 8 ) , s 2 8 = ( h 0 + h 1 + h 2 + h 3 ) / 4 , s 3 8 = ( h 0 h 1 + h 2 h 3 ) / 4 , s 4 8 = ( h 0 h 1 + h 2 + h 3 ) / 2 , s 5 8 = ( h 0 + h 1 + h 2 h 3 ) / 2 , s 6 8 = ( h 0 h 2 ) / 2 , A 5 × 4 = H 2 T 3 × 2 ( 3 ) , A 4 × 5 = H 2 T 2 × 3 ( 1 ) , P 4 = 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 .
Next, we factorize the submatrix B 6 = d 8 g 8 d 8 g 8 g 8 d 8 g 8 d 8 g 8 d 8 d 8 g 8 b 8 h 8 e 8 c 8 d 8 g 8 c 8 b 8 h 8 e 8 g 8 d 8 e 8 c 8 b 8 h 8 d 8 g 8 h 8 e 8 c 8 b 8 g 8 d 8 of matrix C 8 ( a ) . It can be seen that the submatrix A 2 = d 8 g 8 g 8 d 8 is similar to the template a b b a . The submatrix B 2 = d 8 g 8 g 8 d 8 is similar to the template a b b a . Then, these submatrices are decomposed as [31]:
A 2 = I - 2 H 2   [ ( d 8 g 8 ) / 2 ( d 8 + g 8 ) / 2 ] H 2 ,   B 2 = H 2   [ ( d 8 g 8 ) / 2 ( d 8 + g 8 ) / 2 ] H 2 ,
where I - 2 = 1 0 0 1 . Based on Expressions (24) and (25), the factorization of matrix B 6 is given as:
B 6 = T 6 × 8 T 8 ( 1 )   ( A 4 × 5 I 4 ) × diag ( s 2 ( 8 ) ,   s 3 ( 8 ) ,   ,   s 10 ( 8 ) ) × ( A 5 × 4 I 4 )   T 8 ( 0 ) T 8 × 6 ,
where T 6 × 8 = 0 0 1 0 1 0 0 1 0 1 0 1 I 2 , T 8 × 6 = 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 , T 8 ( 1 ) = A 4 I - 2 H 2 H 2 , and T 8 ( 0 ) = P 4 A 4 H 2 H 2 , s 2 8 = ( b 8 c 8 e 8 + h 8 ) / 4 , s 3 8 = ( b 8 + c 8 e 8 h 8 ) / 4 , s 4 8 = ( b 8 + c 8 e 8 + h 8 ) / 2 , s 5 8 = ( b 8 c 8 e 8 h 8 ) / 2 , s 6 8 = ( b 8 + e 8 ) / 2 , s 7 8 = ( d 8 g 8 ) / 2 , s 8 8 = ( d 8 + g 8 ) / 2 , s 9 8 = ( d 8 g 8 ) / 2 , s 10 8 = ( d 8 + g 8 ) / 2 .
In sum, the matrix of the eight-point DCT-VII can be factorized as:
Y 8 × 1 = P 8 ( 1 ) T 8 × 14 T 14 T 14 × 16 D 16 T 16 × 11 T 11 × 10 T 10 × 8 P 8 ( 0 ) X 8 × 1 ,
where:
D 16 = diag ( s 0 ( 8 ) ,   s 1 ( 8 ) ,   ,   s 15 ( 8 ) ) ,   s 0 ( 8 ) = a 8 ,   s 1 ( 8 ) = f 8 , s 11 ( 8 ) = p 8 ,   s 12 ( 8 ) = f 8 ,   s 13 ( 8 ) = a 8 ,   s 14 ( 8 ) = p 8 , s 15 ( 8 ) = f 8 ,   T 10 × 8 = ( P 4 A 4 ) ( T 3 × 2 ( 3 ) I 2 ) ,   T 14 × 16 = I 2 A 4 × 5 I 5 T 3 × 4 ,
T 14 = I 2 ( H 2 I 2 ) ( I - 2 H 2 ) 1 1 0 1 1 1 0 1 0 0 1 0 0 0 0 1 I 2 ,   T 3 × 4 = 1 1 0 0 0 1 1 0 0 0 0 1 ,
T 8 × 14 = 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 1 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 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 ,   T 11 × 10 = 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 ,   T 16 × 11 = 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 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 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 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 0 0 0 0 0 0 1 1 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 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 .
Applying the Factorization (34), the data flow graph of the algorithm for the eight-point DCT-VII is designed and presented in Figure 6. As a result, we can reduce and the number of additions from 56 to 41, and the number of multiplications from 64 to 16.

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.

Author Contributions

Conceptualization, A.C.; methodology, A.C. and M.P.; software, M.P. and M.Ł.; validation, M.P. and M.Ł.; formal analysis, A.C., M.P. and M.Ł.; investigation, M.P., A.C. and M.Ł.; writing—original draft preparation, M.P. and A.C.; writing—review and editing, A.C. and M.P.; supervision, A.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Appendix A

In the appendix, we present the pseudocode of the proposed fast DCT-VII algorithms. These pseudocodes were applied in Section 4 to compute the number of memory cells needed for the algorithms obtained in Section 3. To save the memory cells required for the implementation of the developed algorithms we reuse variables and note which variables must be outputted and in which order. Thus, in Table A1, we show the pseudocode of the proposed three-point DCT-VII algorithm. The inputs of the pseudocode are x 0 ,   x 1 , and x 2 . For scaling factors, we have that s 1 ( 3 ) = s 3 ( 3 ) . Then, only s 0 ( 3 ) , s 1 ( 3 ) , and s 2 ( 3 ) were used to construct the pseudocode. We reuse variables and, as a result, the outputs of the pseudocode are y 0 ,   x 0 , and y 2 .
Table A1. The pseudocode for the constructed fast DCT-VII algorithm for N = 3 with variable reuse.
Table A1. The pseudocode for the constructed fast DCT-VII algorithm for N = 3 with variable reuse.
Step 1Step 2
y 2 = x 0 + x 1 ,   y 0 = x 2 s 0 ( 3 ) y 2 s 1 ( 3 ) , x 2 = y 2 s 2 ( 3 ) x 2 s 1 ( 3 ) ;   y 2 = ( x 0 x 1 ) / 2 ; x 0 = y 2 + x 2 , y 2 = y 2 x 2 .
We present the pseudocode for the four-point DCT-VII algorithm in Table A2. The inputs of the pseudocode are x 0 ,   x 1 ,   x 2 , and x 3 . Also, the scaling factors s 0 ( 4 ) , s 1 ( 4 ) , s 2 ( 4 ) , s 3 ( 4 ) , s 4 ( 4 ) , and s 5 ( 4 ) to create the pseudocode. This is due to the following relations between the scaling factors:   s 6 ( 4 ) = s 0 ( 4 ) . The variables were reused; additional variables are p 1 ,   p 2 , and p 3 . The outputs of the pseudocode are x 2 ,   x 1 ,   x 0 , and x 3 .
Table A2. The pseudocode for the developed fast four-point DCT-VII algorithm with variable reuse.
Table A2. The pseudocode for the developed fast four-point DCT-VII algorithm with variable reuse.
Step 1Step 2Step 3
p 1 = ( x 1 x 2 ) s 2 ( 4 ) , p 2 = ( x 0 x 1 ) s 3 ( 4 ) , p 3 = ( x 0 x 2 ) s 4 ( 4 ) ; x 0 = x 0 + x 1 + x 2 ,   x 2 = x 0 s 0 ( 4 ) + x 3 s 5 ( 4 ) , x 3 = x 0 s 1 ( 4 ) x 3 s 0 ( 4 ) ; x 1 = p 2 + p 3 + x 3 , x 0 = p 1 + p 3 x 3 , x 3 = p 1 p 2 + x 3 .
We present the pseudocode for the designed 5-point DCT-VII algorithm in Table A3. The inputs of the pseudocode are x 0 ,   x 1 ,   x 2 ,   x 3 , and x 4 . We use the scaling factors s 0 ( 5 ) , s 1 ( 5 )   , s 3 ( 5 ) , s 5 ( 5 ) , s 6 ( 5 ) , and s 7 ( 5 ) because s 2 ( 5 ) =   s 0 ( 5 ) , s 3 ( 5 ) = s 0 ( 5 ) , and s 4 ( 5 ) = s 1 ( 5 ) . The outputs of the pseudocode are y 0 ,   y 1 ,   y 2 ,   y 3 , and y 4 . Variable p is additional.
Table A3. The pseudocode for the designed 5-point DCT-VII algorithm with variable reuse.
Table A3. The pseudocode for the designed 5-point DCT-VII algorithm with variable reuse.
Step 1Step 2Step 3
p = ( x 2 x 3 ) s 5 ( 5 ) , y 3 = ( x 0 x 2 ) s 6 ( 5 ) , y 2 = ( x 0 x 3 ) s 7 ( 5 ) ; x 0 = x 0 + x 2 + x 3 ,   y 0 = ( x 0 + x 1 ) s 1 ( 5 ) , x 0 = x 0 s 0 ( 5 ) ,   x 2 = x 1 s 0 ( 5 ) ,   x 3 = x 4 s 0 ( 5 ) ,   x 4 = x 4 s 1 ( 5 ) ; y 0 = y 0 + x 3 ,   x 2 = x 2 + x 4 , y 1 = y 2 y 3 x 2 ,   y 2 = x 2 + p y 2 , y 4 = x 2 p y 3 ,   y 3 = x 0 x 1 x 2 .
In Table A4, the pseudocode of the proposed 6-point DCT-VII algorithm is presented. The inputs of the pseudocode are x 0 ,   x 1 ,   x 2 ,   x 3 ,   x 4 , and x 5 . The scaling factors are s 0 ( 6 ) , s 1 ( 6 ) , …,   s 11 ( 6 ) , because   s 12 ( 6 ) = s 10 ( 6 ) . We reuse variables. So, the outputs of the pseudocode are y 0 ,   y 1 ,   y 2 ,   y 3 ,   y 4 , and x 5 . Variables p 0 and p 1 are additional.
Table A4. The pseudocode for the developed 6-point DCT-VII algorithm with variable reuse.
Table A4. The pseudocode for the developed 6-point DCT-VII algorithm with variable reuse.
Step 1Step 2Step 3Step 3Step 4Step 5
y 0 = x 0 + x 1 + x 2 + x 3 + x 4 ,   y 1 = x 0 x 2 ,   y 2 = x 0 x 1 , y 3 = x 0 x 3 ,   y 4 = x 0 x 4 ; x 0 = y 0 s 0 ( 6 ) , x 1 = y 1 s 1 ( 6 ) , x 2 = y 2 s 2 ( 6 ) , x 3 = ( y 1 + y 2 ) s 3 ( 6 ) , x 4 = y 3 s 4 ( 6 ) ; p 0 = y 4 s 5 ( 6 ) , p 1 = ( y 3 + y 4 ) s 6 ( 6 ) , y 1 = y 1 + y 3 , y 2 = y 2 + y 4 , y 3 = ( y 1 + y 2 ) s 9 ( 6 ) , y 1 = y 1 s 7 ( 6 ) ,   y 2 = y 2 s 8 ( 6 ) ; y 0 = y 0 s 10 ( 6 ) + x 5 s 11 ( 6 ) , x 5 = x 5 s 10 ( 6 ) , x 1 = x 3 + x 1 , x 2 = x 3 + x 2 , x 3 = x 4 + p 1 , x 4 = p 0 + p 1 ; p 0 = y 1 + y 3 , p 1 = y 2 + y 3 , x 1 = p 0 + x 1 , x 2 = p 1 + x 2 , x 3 = p 0 + x 3 , x 4 = p 1 + x 4 ; x 0 = x 0 + x 5 , y 2 = x 1 x 0 , y 1 = x 0 x 2 , x 5 = x 0 x 3 , y 3 = x 0 x 4 , y 4 = ( x 0 + x 1 + x 2 + x 3 + x 4 ) .
In Table A5, the pseudocode of the constructed seven-point DCT-VII algorithm is shown. The inputs of the pseudocode are x 0 ,   x 1 ,   x 2 , x 3 , x 4 , x 5 , and x 6 . We use only scaling factors s 0 ( 7 ) , s 1 ( 7 ) , …, s 8 ( 7 ) , and s 9 ( 7 ) because s 10 ( 7 ) = s 0 ( 7 ) . We reuse variables. Therefore, the outputs of the pseudocode are y 0 ,   y 1 ,   y 2 ,   y 3 ,   y 4 ,   y 5 , and x 6 . Variable p 0 is additional.
Table A5. The pseudocode for the designed seven-point DCT-VII algorithm with variable reuse.
Table A5. The pseudocode for the designed seven-point DCT-VII algorithm with variable reuse.
Step 1Step 2Step 3Step 4Step 5Step 6
p 0 = x 0 + x 2 ,   y 1 = x 3 + x 4 , y 2 = x 1 + x 5 , y 0 = p 0 + y 1 + y 2 , y 3 = x 0 x 2 , y 4 = x 3 x 4 , y 5 = x 1 x 5 ; x 0 = s 2 ( 7 ) y 0 , x 1 = p 0 y 2 , x 2 = p 0 y 1 , p 0 = ( x 1 + x 2 ) s 5 ( 7 ) , x 1 = x 1 s 3 ( 7 ) , x 2 = x 2 s 4 ( 7 ) ; x 3 = ( y 3 y 4 + y 5 ) s 6 ( 7 ) , x 4 = y 3 y 5 , x 5 = y 3 + y 4 , y 3 = ( x 4 + x 5 ) s 9 ( 7 ) ,   x 4 = x 4 s 7 ( 7 ) , x 5 = x 5 s 8 ( 7 ) ; y 1 = p 0 + x 1 , y 2 = p 0 + x 2 , y 4 = y 3 + x 4 , y 5 = y 3 + x 5 , p 0 = x 0 + y 1 + y 2 , y 1 = x 0 y 1 , y 2 = x 0 y 2 , y 3 = x 3 + y 4 + y 5 , y 4 = x 3 + y 4 , y 5 = x 3 y 5 ; x 0 = p 0 + y 3 , x 1 = y 4 + y 1 , x 2 = y 2 + y 5 , x 3 = p 0 y 3 , x 4 = y 1 y 4 , x 5 = y 2 y 5 ; y 0 = s 0 ( 7 ) y 0 + s 1 ( 7 ) x 6 , x 6 = x 6 s 0 ( 7 ) , y 1 = x 0 + x 6 , y 2 = x 1 x 6 , y 4 = x 2 x 6 , y 5 = x 3 + x 6 , y 3 = x 4 + x 6 , x 6 = x 5 x 6 .
In Table A6, the pseudocode of the proposed eight-point DCT-VII algorithm is shown. The inputs of the pseudocode are x 0 ,   x 1 ,   x 2 ,   x 3 ,   x 4 ,   x 5 ,   x 6 , and x 7 . We use scaling factors s 0 ( 8 ) , s 1 ( 8 ) , …, s 11 ( 8 ) , because s 12 ( 8 ) = s 15   ( 8 ) =   s 1 ( 8 ) , s 14 ( 8 ) = s 11 ( 8 ) , s 13 ( 8 ) = s 0 ( 8 ) . Due to variable reusing, the outputs of the pseudocode are x 0 ,   p 6 ,   p 7 ,   p 8 ,   x 6 ,   x 4 ,   x 1 , and x 7 . Variables p 0 ,   p 1 ,   p 2 ,   p 3 ,   p 4 ,   p 5 ,   p 9 , and y 0 are additional.
Table A6. The pseudocode for the constructed eight-point DCT-VII algorithm with variable reuse.
Table A6. The pseudocode for the constructed eight-point DCT-VII algorithm with variable reuse.
Step 1Step 2Step 3Step 4Step 5
p 2 = x 0 + x 5 , p 3 = x 3 + x 6 , p 5 = x 0 x 5 , p 4 = x 3 x 6 , p 0 = p 2 + p 3 , p 6 = p 2 + x 4 , p 7 = p 3 + x 1 , p 8 = x 1 + x 4 , p 9 = x 1 x 4 ; p 1 = s 1 ( 8 ) p 0 , p 0 = s 0 ( 8 ) ( p 0 + p 8 + x 2 ) , x 0 = s 2 ( 8 ) ( p 2 + p 3 ) , p 3 = s 3 ( 8 ) ( p 2 p 3 ) , x 6 = s 6 ( 8 ) ( p 4 + p 5 ) , x 5 = s 7 ( 8 ) ( p 6 + p 7 ) , x 3 = s 8 ( 8 ) ( p 6 p 7 ) ; y 0 = s 11 ( 8 ) p 8 , p 9 = s 10 ( 8 ) p 9 , p 8 = s 9 ( 8 ) p 8 , x 1 = x 7 s 0 ( 8 ) , p 7 = x 2 s 11 ( 8 ) , x 2 = x 2 s 1 ( 8 ) ; p 2 = x 0 + p 3 , p 3 = x 0 p 3 , p 4 = x 6 + p 4 s 4 ( 8 ) , p 5 = x 6 + p 5 s 5 ( 8 ) ; x 2 = x 1 + x 2 , x 1 = p 7 x 1 , x 0 = p 2 + p 4 , x 6 = p 3 + p 5 , p 2 = p 2 p 4 , p 3 = p 3 p 5 , p 4 = x 3 + x 5 , p 5 = x 3 x 5 , x 3 = p 8 + p 9 , x 5 = p 8 p 9 ; x 4 = p 1 + y 0 + x 2 , y 0 = x 2 + x 3 , p 6 = x 0 + y 0 , x 0 = s 1 ( 8 ) x 7 + p 0 , p 8 = p 4 x 1 , x 1 = p 5 + x 1 , x 7 = x 5 + x 2 , p 7 = x 7 x 6 , x 6 = y 0 p 2 , x 7 = x 7 + p 3 .

References

  1. Abramov, S.; Fastowicz, Y.; Lukin, V.; Abramova, V.; Rubel, O.; Okarma, K.; Lech, P.; Ieremeiev, O. Methods of intellectual image and video processing based on visual quality metrics for emerging applications. Eur. Sci. 2023, 2, 51–98. [Google Scholar] [CrossRef] [Scilit]
  2. Li, F.; Krivenko, S.; Lukin, V. A Two-step procedure for image lossy compression by ADCTC with a desired quality. In Proceedings of the 2020 IEEE 11th International Conference on Dependable Systems, Services and Technologies (DESSERT), Kyiv, Ukraine, 14–18 May 2020. [Google Scholar]
  3. Shao, X.; Johnson, S.G. Type-IV DCT, DST, and MDCT algorithms with reduced numbers of arithmetic operations. Signal Process. 2008, 88, 1313–1326. [Google Scholar] [CrossRef] [Scilit]
  4. Bi, G.; Zeng, Y. Transforms and Fast Algorithms for Signal Analysis and Representations, 1st ed.; Birkhäuser: Boston, MA, USA, 2004. [Google Scholar]
  5. Chiper, D.F.; Cotorobai, L.-T. A new approach for a unified architecture for type IV DCT/DST with an efficient incorporation of obfuscation technique. Electronics 2021, 10, 1656. [Google Scholar] [CrossRef] [Scilit]
  6. Polyakova, M.; Witenberg, A.; Cariow, A. The fast type-IV discrete sine transform algorithms for short-length input sequences. Bull. Pol. Acad. Sci. Tech. Sci. 2025, 73, e153827. [Google Scholar] [CrossRef] [Scilit]
  7. Huang, X.H.; Huang, W.Z.; Yuan, K.; He, K. A fast algorithm based on discrete cosine transform (DCT). Appl. Mech. Mater. 2014, 644–650, 1488–1493. [Google Scholar] [CrossRef] [Scilit]
  8. Kober, V. Fast algorithm of short-time DCT for low resolution signal processing. In Proceedings of the International Conference on Signal Processing and Multimedia Applications and Wireless Information Networks and Systems (SIGMAP-2012), Rome, Italy, 24–27 July 2012. [Google Scholar]
  9. Protsko, I.O. Peculiarities of computation the hashing arrays for the synthesis of fast algorithms of DCT I–IV. Radio Electron. Comput. Sci. Control 2020, 149–157. [Google Scholar] [CrossRef] [Scilit]
  10. Hamidouche, W.; Philippe, P.; Camar-Eddine, M.; Kammoun, A.; Menard, D.; Deforges, O. Hardware-friendly DST-VII/DCT-VIII approximations for the versatile video coding standard. In Proceedings of the Picture Coding Symposium (PCS 2019), Ningbo, China, 12–15 November 2019. [Google Scholar]
  11. Im, S.-K.; Pearmain, A.J. Unequal error protection with the H.264 flexible macroblock ordering. In Proceedings of the Visual Communications and Image Processing 2005, Beijing, China, 12–15 July 2005; Volume 5960. [Google Scholar]
  12. Britanak, V.; Yip, P.C.; Rao, K.R. Discrete Cosine and Sine Transforms: General Properties, Fast Algorithms and Integer Approximations; Elsevier/Academic Press: Amsterdam, The Netherlands, 2007. [Google Scholar]
  13. Hnativ, L.O.; Luts, V.K. Algorithms for fast implementation of 4-point integer sine type VII transforms without multiplication and separable directional adaptive transforms for intra prediction in image/video coding. Cybern. Syst. Anal. 2020, 56, 159–170. [Google Scholar] [CrossRef] [Scilit]
  14. Hnativ, L.O. Discrete cosine–sine type VII transform and fast integer transforms for intra prediction of images and video coding. Cybern. Syst. Anal. 2021, 57, 827–835. [Google Scholar] [CrossRef] [Scilit]
  15. Saxena, A.; Fernandes, F.C. DCT/DST-based transform coding for intra prediction in image/video coding. IEEE Trans. Image Process. 2013, 22, 3974–3981. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  16. Chen, H.; Saxena, A.; Fernandes, F. Nearest-neighbor intra prediction for screen content video coding. In Proceedings of the 2014 IEEE International Conference on Image Processing (ICIP), Paris, France, 27–30 October 2014. [Google Scholar]
  17. Zhao, X.; Chen, J.; Karczewicz, M.; Zhang, L.; Li, X.; Chien, W.-J. Enhanced multiple transform for video coding. In Proceedings of the 2016 Data Compression Conference (DCC), Snowbird, UT, USA, 30 March–1 April 2016. [Google Scholar]
  18. Masera, M.; Martina, M.; Masera, G. Odd type DCT/DST for video coding: Relationships and low-complexity implementations. In Proceedings of the 2017 IEEE International Workshop on Signal Processing Systems (SiPS), Lorient, France, 3–5 October 2017. [Google Scholar]
  19. Chowdary, T.A.; Nalluri, P. Multiple transform selection in versatile video coding: A review. In Proceedings of the 2022 8th International Conference on Advanced Computing and Communication Systems (ICACCS), Coimbatore, India, 25–26 March 2022. [Google Scholar]
  20. Garrido, M.J.; Pescador, F.; Chavarrías, M.; Lobo, P.J.; Sanz, C. A 2-D multiple transform processor for the versatile video coding standard. IEEE Trans. Consum. Electron. 2019, 65, 274–283. [Google Scholar] [CrossRef] [Scilit]
  21. Arrufat, A.; Philippe, P.; Déforges, O. Rate-distortion optimised transform competition for intra coding in HEVC. In Proceedings of the 2014 IEEE Visual Communications and Image Processing Conference (VCIP), Valletta, Malta, 7–10 December 2014. [Google Scholar]
  22. Perera, S.M.; Madanayake, A.; Dornback, N.; Udayanga, N. Design and digital implementation of fast and recursive DCT II–IV algorithms. Circuits Syst. Signal Process. 2018, 38, 529–555. [Google Scholar] [CrossRef] [Scilit]
  23. Cotorobai, L.T.; Chiper, D.F. An efficient algorithm and architecture for the VLSI implementation of integer DCT that allows an efficient incorporation of the hardware security with a low overhead. J. Electr. Syst. Eng. 2024, 9, 343–354. [Google Scholar]
  24. Shao, X.; Johnson, S.G. Type-II/III DCT/DST algorithms with reduced number of arithmetic operations. Signal Process. 2008, 88, 1553–1564. [Google Scholar] [CrossRef] [Scilit]
  25. Zhang, Z.; Zhao, X.; Li, X.; Li, L.; Luo, Y.; Liu, S.; Li, Z. Fast DST-VII/DCT-VIII with dual implementation support for versatile video coding. IEEE Trans. Circuits Syst. Video Technol. 2021, 31, 355–371. [Google Scholar] [CrossRef] [Scilit]
  26. Cintra, R.J.; Bayer, F.M.; Madanayake, A.; Potluri, U.S.; Edirisuriya, A. Fast algorithms and architectures for 8-Point DST-II/DST-VII approximations. J. Circuits Syst. Comput. 2017, 26, 1750045. [Google Scholar] [CrossRef] [Scilit]
  27. Reznik, Y.A. Relationship between DCT-II, DCT-VI, and DST-VII transforms. In Proceedings of the 2013 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Vancouver, BC, Canada, 26–31 May 2013. [Google Scholar]
  28. Chivukula, R.K.; Reznik, Y.A. Fast computing of discrete cosine and sine transforms of types VI and VII. In Proceedings of the SPIE 8135, Applications of Digital Image Processing XXXIV, San Diego, CA, USA, 20–25 September 2011. [Google Scholar]
  29. Saxena, A.; Fernandes, F.C.; Reznik, Y.A. Fast transforms for intra-prediction-based image and video coding. In Proceedings of the 2013 Data Compression Conference (DCC), Snowbird, UT, USA, 20–22 March 2013. [Google Scholar]
  30. Hao, Z.; He, C.; Liu, J.; Zheng, Q.; Xu, J.; Ma, P.; Ma, X.; Hao, Y. A novel transform accelerator with fast kernel selection and efficient transform circuit. IEEE Trans. Circuits Syst. I Regul. Pap. 2025, 72, 2726–2739. [Google Scholar] [CrossRef] [Scilit]
  31. Andreatto, B.; Cariow, A. Automatic generation of fast algorithms for matrix–vector multiplication. Int. J. Comput. Math. 2017, 95, 626–644. [Google Scholar] [CrossRef] [Scilit]
  32. Cariow, A.; Papliński, J. Algorithmic structures for realizing short-length circular convolutions with reduced complexity. Electronics 2021, 10, 2800. [Google Scholar] [CrossRef] [Scilit]
  33. Cheng, X.; Wang, H.; Luo, X.; Guan, Q.; Wang, J.; Ma, B. Re-cropping framework: A grid recovery method for quantization step estimation in non-aligned recompressed images. IEEE Trans. Circuits Syst. Video Technol. 2025; early access. [CrossRef] [Scilit]
  34. Li, X.; Zhang, W.; Wang, Y.; Chen, Z.; Xu, Q.; Huang, J. From simple to complex scenes: Learning robust feature representations for accurate human parsing. IEEE Trans. Pattern Anal. Mach. Intell. 2024, 46, 5449–5462. [Google Scholar] [CrossRef] [Scilit]
  35. Wang, C.; Zhang, Q.; Wang, X.; Zhou, L.; Li, Q.; Xia, Z.; Ma, B.; Shi, Y.Q. Light-field image multiple reversible robust watermarking against geometric attacks. IEEE Trans. Dependable Secur. Comput. 2025, 22, 5861–5875. [Google Scholar] [CrossRef] [Scilit]
  36. Gao, S.; Zhang, Z.; Li, Q.; Ding, S.Q.; Iu, H.H.-C.; Cao, Y.; Xu, X.; Wang, C.; Mou, J. Encrypt a story: A video segment encryption method based on the discrete sinusoidal memristive Rulkov neuron. IEEE Trans. Dependable Secur. Comput. 2025, 22, 8011–8024. [Google Scholar] [CrossRef] [Scilit]
Figure 1. The data flow graph of the algorithm for the three-point DCT-VII.
Figure 1. The data flow graph of the algorithm for the three-point DCT-VII.
Electronics 15 00098 g001
Figure 2. The data flow graph of the four-point DCT-VII algorithm.
Figure 2. The data flow graph of the four-point DCT-VII algorithm.
Electronics 15 00098 g002
Figure 3. The data flow graph of the algorithm for the five-point DCT-VII.
Figure 3. The data flow graph of the algorithm for the five-point DCT-VII.
Electronics 15 00098 g003
Figure 4. The data flow graph of the algorithm for the six-point DCT-VII.
Figure 4. The data flow graph of the algorithm for the six-point DCT-VII.
Electronics 15 00098 g004
Figure 5. The data flow graph implementing the seven-point DCT-VII.
Figure 5. The data flow graph implementing the seven-point DCT-VII.
Electronics 15 00098 g005
Figure 6. The data flow graph for the computation of the eight-point DCT-VII.
Figure 6. The data flow graph for the computation of the eight-point DCT-VII.
Electronics 15 00098 g006
Table 1. The number of additions and multiplications for the matrix-vector product and the proposed fast algorithms for DCT-VII.
Table 1. The number of additions and multiplications for the matrix-vector product and the proposed fast algorithms for DCT-VII.
NMatrix-Vector ProductProposed DCT-VII Algorithms
AdditionsMultiplicationsAdditionsMultiplications
3696 (0%)4 (↓56%)
4121613 (↑1%)7 (↓56%)
5202516 (↓20%)8 (↓68%)
6303633 (↑10%)13 (↓64%)
7424941 (0%)11 (↓77%)
8566441 (↓27%)16 (↓75%)
Table 2. The number of operations for the existing algorithms.
Table 2. The number of operations for the existing algorithms.
AlgorithmReference, Year of PublicationN = 4N = 5N = 8
Mults.Adds.Mults.Adds.Mults.Adds.
Masera, Martina, Masera[18], 20174 (+4)1316 (+8)36
Saxena, Fernandes, Reznik[29], 20133 (+5)15
Proposed algorithm7 (↑75%)13 (0%)8 (↑167%)16 (↑1%)16 (0%)41 (↑14%)
Table 3. The number of memory cells for the matrix-vector product and the proposed fast algorithms for DCT-VII.
Table 3. The number of memory cells for the matrix-vector product and the proposed fast algorithms for DCT-VII.
NMatrix-Vector ProductProposed DCT-VII Algorithms
367 (↑17%)
41012 (↑20%)
51117 (↑54%)
61825 (↑39%)
71724 (↑41%)
82031 (↑55%)
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Polyakova, M.; Cariow, A.; Łazoryszczak, M. Fast Algorithms for Small-Size Type VII Discrete Cosine Transform. Electronics 2026, 15, 98. https://doi.org/10.3390/electronics15010098

AMA Style

Polyakova M, Cariow A, Łazoryszczak M. Fast Algorithms for Small-Size Type VII Discrete Cosine Transform. Electronics. 2026; 15(1):98. https://doi.org/10.3390/electronics15010098

Chicago/Turabian Style

Polyakova, Marina, Aleksandr Cariow, and Mirosław Łazoryszczak. 2026. "Fast Algorithms for Small-Size Type VII Discrete Cosine Transform" Electronics 15, no. 1: 98. https://doi.org/10.3390/electronics15010098

APA Style

Polyakova, M., Cariow, A., & Łazoryszczak, M. (2026). Fast Algorithms for Small-Size Type VII Discrete Cosine Transform. Electronics, 15(1), 98. https://doi.org/10.3390/electronics15010098

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop