Wavefront coding is the most widely used method to extend the depth of field, because the wavefront coding system combines the advantages of optical imaging and image post-processing. This paper mainly discusses the principle, advantages, and application scenarios of wavefront coding and analyzes the greater than 20 existing types of phase masks. Specifically, these methods are discussed for the optimization of the phase mask parameters together with the generally used optimization algorithms. In addition, the fuzzy image recovery algorithms of image post-processing are also discussed. Finally, our recent work on the depth extension of existing optical imaging systems is introduced and we look forward to the future development of wavefront coding.