This paper proposes a unified architecture for computation of discrete cosine transform (DCT) and its inverse transform (IDCT). The matrix decomposition algorithm is used to deduce the proposed algorithm. Based on this algorithm, a unified DCT/IDCT architecture is developed. Then, this architecture is modeled in HDL, verified and implemented with FPGA. Experiment results show that the unified DCT/IDCT architecture has low hardware complexity and high calculation accuracy.