Amplitude-variation-with-offset (AVO) inversion is based on single interface reflectivity equations. It involves some restrictions, such as the small-angle approximation, including only primary reflections, and ignoring attenuation. To address these shortcomings, the analytical solution of the 1D viscoelastic wave equation is used as the forward modeling engine for prestack inversion. This method can conveniently handle the attenuation and generate the full wavefield response of a layered medium. To avoid numerical difficulties in the analytical solution, the compound matrix method is applied to rapidly obtain the analytical solution by loop vectorization. Unlike full-waveform inversion, the proposed prestack waveform inversion (PWI) can be performed in a target-oriented way and can be applied in reservoir study. Assuming that a Q value is known, PWI is applied to synthetic data to estimate elastic parameters including compressional wave (P-wave) and shear wave (S-wave) velocities and density. After validating our method on synthetic data, this method is applied to a reservoir characterization case study. The results indicate that the reflectivity calculated by our approach is more realistic than that computed by using single interface reflectivity equations. Attenuation is an integral effect on seismic reflection; therefore, the sensitivity of seismic reflection to P-and S-wave velocities and density is significantly greater than that to Q, and the seismic records are sensitive to the low-frequency trend of Q. Thus, we can invert for the three elastic parameters by applying the fixed low-frequency trend of Q. In terms of resolution and accuracy of synthetic and real inversion results, our approach performs superiorly compared to AVO inversion.