A machine for the homogenization and thermal treatment of liquid and semi-liquid food products, for example ice creams, whipped cream, creams, chocolate, yogurt and the like, comprises a containment tank for the mixture and a centrifugal pump put in fluid communication with the bottom of the containment tank for drawing mixture from the tank and putting it back into the tank, heating and cooling means acting at the pump for heating and cooling the mixture in transit in the pump. The heating and cooling means comprise a thermal machine with reversible thermodynamic cycle and using carbon dioxide as refrigerant.