This paper presents fast algorithms for the type-II and -III discrete cosine transforms of composite sequence length. In particular, a radix-q algorithm, where q is an odd integer, is derived for uniform or mixed radix decomposition of the discrete cosine transform. By combining the radix-q and radix-2 algorithms, a general decomposition method for any composite length is developed. Reduction of computational complexity can be achieved for many sequence lengths compared with that needed by the well-known radix-2 algorithm. Furthermore, both the proposed and Chan and Siu's (1993) mixed radix algorithms achieve the same computational complexity for N=3*2/sup p/ and 9*2/sup P/. However, our algorithm uses a simpler decomposition approach and provides a wider range of choices of sequence lengths.