Cost of revenue, excluding depreciation and amortization of intangible assets, for the six months ended June 30, 2022 was $54.3 million, as compared to $55.7 million for the six months ended June 30, 2021, a decrease of $1.4 million primarily due to inventory reserves recorded in the six months ended June 30, 2021.
Research and Development
Research and development (“R&D expense”) is comprised primarily of employee-related costs, stock-based compensation expense, engineering consulting expenses associated with new product and technology development, product commercialization, quality assurance and testing costs, as well as costs related to information technology, patent applications and examinations, materials, supplies and allocation of facilities costs. All R&D expense is expensed as incurred.
R&D expense for the three months ended June 30, 2022 was $51.4 million as compared to $46.4 million for the three months ended June 30, 2021, an increase of $5.0 million. The increase was primarily due to increased hiring of employees, primarily due to the MobiTV Acquisition in May 2021, as well as increased bonus expense driven by expected higher bonus percentage attainment.
R&D expense for the six months ended June 30, 2022 was $101.6 million as compared to $94.4 million for the six months ended June 30, 2021, an increase of $7.2 million. The increase was primarily due to increased hiring of employees, primarily due to the MobiTV Acquisition in May 2021, as well as increased bonus expense driven by expected higher bonus percentage attainment.
Selling, General and Administrative
Selling expenses consist primarily of compensation and related costs for sales and marketing personnel engaged in sales and licensee support, reverse engineering personnel and services, marketing programs, public relations, promotional materials, travel, trade show expenses, and stock-based compensation expense. General and administrative expenses consist primarily of compensation and related costs for general management, information technology, finance personnel, legal fees and expenses, facilities costs, stock-based compensation expense, and professional services. Our general and administrative expenses, other than facilities-related expenses, are not allocated to other expense line items.
Selling, general and administrative expenses (“SG&A expenses”) for the three months ended June 30, 2022, were $50.3 million, as compared to $50.2 million for the three months ended June 30, 2021, an increase of $0.1 million. The increase was due to increased bonus expense driven by expected higher bonus percentage attainment, partially offset by lower marketing and advertising costs and lower bad debt expense.
Selling, general and administrative expenses (“SG&A expenses”) for the six months ended June 30, 2022, were $100.2 million, as compared to $102.0 million for the six months ended June 30, 2021, a decrease of $1.8 million. The decrease was primarily due to less marketing and advertising expenses as well as lower bad debt expenses.
Depreciation Expense
Depreciation expense was $5.1 million for the three months ended June 30, 2022, relatively flat as compared to $5.2 million for the three months ended June 30, 2021, a decrease of $0.1 million.
Depreciation expense was $10.7 million for the six months ended June 30, 2022, relatively flat as compared to $10.6 million for the six months ended June 30, 2021.
Amortization Expense
Amortization expense for the three months ended June 30, 2022 was $14.8 million, as compared to $27.7 million for the three months ended June 30, 2021, a decrease of $12.9 million. The decrease was due to certain intangible assets becoming fully amortized in late 2021.
84