Pion production in high-energy nucleus-nucleus collisions