B-mode image, which is the most widely used medical ultrasound image modality, is generated by the delay-and-sum algorithm. The conventional delay-and-sum algorithm is based on the assumption that the target object is composed of a homogeneous substance, and organizes the output image by applying proper delays on received RF signals. However, such an assumption sometimes degrades the image resolution because of the heterogeneity of body tissue. In this paper, we propose a beamforming processor consisting of a speed of sound map reconstructor and an adaptive Rx beamformer to enhance B-mode image performance. Two artificial neural networks are connected end-to-end.