Efficient Sample Delay Calculation for 2-D and 3-D Ultrasound Imaging