The newly proposed video coding standard, High Efficiency Video Coding (HEVC), has been widely accepted and adopted by industry and academia due to its better coding efficiency compared with H.264/AVC. While HEVC achieves an increase of about 40% in coding efficiency, its computational complexity has been increased significantly. Given this, a high performance AVC to HEVC transcoder is needed urgently. This paper introduces a learning based fast transcoding algorithm which can speed up the process of CU decision. The stream is first decoded by JM and then important features are extracted. Those features are used as inputs for a machine learning model and the specific CU depth will be obtained. In x265, we skip depths that are not selected and early pruning is used to terminate splitting in advance. The experimental results show that our proposed transcoding algorithm can save up to 41% coding speed compared with original x265 while the BD-BitRate drop 0.078dB on average. The algorithm achieves a good tradeoff between the performance and transcoding speed.