NOVELTY - The low-temperature and high-temperature drying sections (100,200) has respective drying section channels having respective drying section channel screw transporters. A torrefaction section (300) has torrefaction channel with a torrefaction section channel screw transporter. A cooling section (400) has cooling section channel with cooling section channel transporter. A thermal energy transfer system (600) is set in thermal contact with torrefaction section off-gas combustor (500), torrefaction sections and drying sections.    USE - Apparatus for thermal treatment of biomass such as agricultural waste like straw or hay (all claimed) to obtain torrefied product (all claimed) or torrefied biomass used for auxiliary fuel in waste incineration plants or in fossil fuel plants, co-combustion on large coal and cogeneration plants, etc. Can also be used for thermally treating biological material obtained from living or formerly living organisms, such as wood, plant material and municipal organic waste.    ADVANTAGE - The efficiency and ability to control palletizing ability of the torrefied biomass is improved. The treatment cost is reduced, and thermal efficiency of the apparatus is improved. The apparatus operates auto-thermally at relatively high energy efficiency. The water content and density of the torrefied biomass can be controlled efficiently. The porous pellets increase the throughput of the apparatus. Release of dust to the environment can be prevented. Intimate mixing of the product and good thermal transfer are facilitated. Blocking of product during transport through the channels is avoided. The drying effect is homogenized over its thickness. The scaling problem of the dryers is avoided to guarantee sufficient contact air flow and heat transfer to the hot wall of the dryer. The pressure difference between the high-temperature drying section and the torrefaction section is avoided. The heat necessary to perform the reactions is limited and therefore the transfer of heat to the torrefaction section channel is more than sufficient for the indicated fuel input and gives ample room for increasing the throughput as long as the drying section capacity is sufficient. The apparatus may allow the use of the input section of a standard pelletizer as the gas tight lock to prevent in-leak of air. High thermal stability and high yield are achieved. The temperature of output material is readily chosen in such a way that best performance of the pelletizer with lowest electricity demand is possible. The potassium content of the palletized biomass is relatively high. The torrefied product has good durability, little or no uptake of moist during storage and good combustion properties.    DETAILED DESCRIPTION - The torrefaction section screw transporter is a ribbon blade screw transporter optionally equipped with blade extensions. The cooling section channel transporter is a full screw blade transporter. One or more of another portion of the drying section channels are cylindrically shaped. The thermal energy transfer system comprises a gas transport system and a gas transporter. The gas transport system comprises one or more of gas connections between the torrefaction section off-gas combustor and a torrefaction channel heat exchanger of the torrefaction channel. The gas transporter is arranged downstream of the torrefaction channel heat exchanger and upstream of the drying sections. A grinding section is arranged upstream of the low-temperature drying section. The combustor comprises a burner and an auxiliary burner. An INDEPENDENT CLAIM is included for method for thermal treatment of biomass, that involves transporting the biomass through a low-temperature drying section, a high-temperature drying section, a torrefaction section and a cooling section, drying the biomass at a temperature in the range of 90-120 degrees C in the low-temperature drying section, and again drying the biomass at a temperature in the range of 150-220 degrees C in the high-temperature drying section. The biomass is cooled in the cooling section, and is combusted to produce thermal energy. A portion of the thermal energy is transferred to one or more of the low-temperature drying process, to the high-temperature drying process, and to the torrefying process. The biomass is grinded before subjecting to the low-temperature drying process. The biomass before the low-temperature drying process has a water content in the range of 5-25 wt%, preferably 5-20 wt%.    DESCRIPTION OF DRAWING(S) - The drawing shows a block diagram of the thermal treatment apparatus.    Low-temperature and high-temperature drying sections (100,200)    Torrefaction section (300)    Cooling section (400)    Torrefaction section off-gas combustor (500)    Thermal energy transfer system (600)