  With the great success of the T-product based real tensor methods in the
color image and gray video processing, the establishment of T-product based
quaternion tensor methods in the color video processing has encountered a
challenge, which is the block diagonalization of block circulant quaternion
matrices. In this paper, we show that the discrete Fourier matrix
$\mathbf{F_p}$ cannot diagonalize $p\times p$ circulant quaternion matrices,
nor can the unitary quaternion matrices $\mathbf{F_p}\mathbf{j}$ and
$\mathbf{F_p}(1+\mathbf{j})/\sqrt{2}$ with $\mathbf{j}$ being an imaginary unit
of quaternion algebra. Further, we establish sufficient and necessary
conditions for a unitary quaternion matrix being a diagonalization matrix of
circulant quaternion matrices, which shows that achieving the diagonalization
of circulant quaternion matrices in the quaternion domain is too hard. We turn
to the octonion domain for achieving the diagonalization of circulant
quaternion matrices. We prove that the unitary octonion matrix
$\mathbf{F_p}\mathbf{p}$ with $\mathbf{p}=\mathbf{l},\mathbf{il}$ or
$(\mathbf{l}+\mathbf{il})/\sqrt{2}$ can diagonalize a circulant quaternion
matrix of size $p\times p$, at the cost of $O(p\log p)$ via the fast Fourier
transform (FFT); and unitary matrices $\mathbf{F_p}\mathbf{p}\otimes
\mathbf{I_m}$ and $\mathbf{F_p}\mathbf{p}\otimes \mathbf{I_n}$ can block
diagonalize a block circulant quaternion matrix of size $mp\times np$, at the
cost of $O(mnp\log p)$ via the FFT. As a result, we propose a fast algorithm to
calculate the T-product between $m\times n\times p$ and $n\times s\times p$
third-order quaternion tensors via FFTs, at the cost of $O(mnsp)$, which is
almost $1/p$ of the computational magnitude of computing T-product by its
definition. Numerical calculations verify the correctness of the complexity
analysis.
