shipments grew approximately 13% to 14% during fiscal year 2005 as compared to fiscal year 2004. The net impact of foreign exchange rates on revenue was positive in 2005, primarily due to relative strengthening of most foreign currencies, particularly the euro and Japanese yen, against the U.S. dollar. Partially offsetting revenue growth rates was a $1.08 billion decline in earned revenue from Upgrade Advantage in fiscal year 2005. This revenue was recognized over fiscal year 2003 and fiscal year 2004 and in the first quarter of fiscal year 2005 when the contract period expired. Fiscal year 2004 revenue growth was primarily driven by the growth in licensing of Windows client operating systems through OEMs, Windows Server operating systems, Office and other server applications as a result of growth in PC and server hardware shipments. The worldwide PC shipment growth rate from all sources was estimated at 13% and the Windows server shipment was estimated at 18% in fiscal year 2004 as compared to fiscal year 2003. The net impact of foreign exchange rates on revenue was positive in fiscal year 2004 due to a relative strengthening of most foreign currencies versus the U.S. dollar. This resulted in approximately $1.10 billion growth in total revenue. 

Operating income for fiscal year 2006 increased primarily reflecting the revenue increase and a $991 million decrease in costs for legal settlements and legal contingencies. These changes were partially offset by a $1.62 billion increase in cost of revenue primarily related to Xbox 360 and a $1.26 billion increase in sales and marketing expense primarily as a result of increased investments in partner marketing and product launch-related spending. Headcount-related costs, including stock-based compensation expense, increased $682 million or 7% resulting from both an increase in salaries and benefits for existing headcount and a 16% growth in headcount over the past twelve months. Stock-based compensation expense decreased $733 million or 30% reflecting a continuing decline in stock option amortization expense. 

Operating income increased in fiscal year 2005 due to a decline in stock-based compensation expense; increased revenue in Server and Tools, Client and Information Worker, which have higher gross margins as compared to other segments; and a reduction in legal costs associated with major litigation. In addition, strong sales of Halo 2 reduced the overall operating loss for the Home and Entertainment segment for fiscal year 2005. The $3.29 billion decrease in stock-based compensation expense was partially offset by increased operating expenses of $562 million related to increased salary and benefits for new and existing headcount. General and administrative expenses related to major litigation declined in fiscal year 2005 due to the $2.53 billion of charges related to the settlement of Sun Microsystems litigation and the fine imposed by the European Commission in fiscal year 2004. This effect was partially offset by legal expenses of $2.08 billion related to settlements with IBM, Novell, Gateway, and end-user class action plaintiffs to resolve antitrust issues and other matters. In fiscal year