This paper presents a universal approach for constant-time Gaussian filters (O(1) GF) based on the Discrete Cosine Transform (DCT). It is well known that DCT has the eight types of definitions. Existing methods of O(1) GF use difference DCT type according to their original concepts. However, all types of DCT have not been studied comprehensively and quantitatively. Unlike existing methods, the proposed approach covers all types of DCT and moment preservation for arbitrary orders, which enables us to clarify differences of O(1) GF derived from each DCT through a comprehensive analysis. Based on the universal approach, a closed-form solution to optimize weight coefficients is also proposed based on a simple convex analysis. Experiments found that DCT-7 shows the highest approximate accuracy, which is a new conclusion different from existing methods.