The dielectric function of the perovskite BaTiO3 is studied by infrared spectroscopic ellipsometry in the temperature range of 20-150 degrees C. A ferroelectricity-induced change of the spectral weight of the dielectric function is observed from a cubic to tetragonal structure transition. The ellipsometric data provide detailed information about the evolution of the ionic static effective charge in the cubic and ferroelectricity states. The determination of the temperature-dependent spontaneous macroscopic polarization is deduced in terms of the charge transfer of the static effective charge.