In order to reduce the computational complexity for the high-efficiency video coding standard, an algorithm is proposed. First, we create a histogram based on the distribution of gray values in each coding tree unit. By using a self-correlation function of the gray histogram, we can skip some of the depth levels that are unnecessary. Second, the relationship between the sum of absolute transformed difference (SATD) and coding unit (CU) is used to decide an early termination for the split of the current CU, if the minimum SATD of this CU is smaller than a threshold. Experimental results show that the proposed algorithm can save an average of 38.39% of the encoding time with negligible degradation of coding efficiency compared with the reference model HM10.1.