Factorization of tree QCD amplitudes in the high-energy limit and in the collinear limit