A fast intra optimization algorithm for HEVC