Chipmakers Ambarella (NASDAQ:AMBA) and AMD (NASDAQ:AMD) both underperformed the Philadelphia Semiconductor Index's 44% gain over the past 12 months. Ambarella's stock dipped 4%, and AMD's dropped 8%.

Ambarella and AMD make very different types of chips, but both stocks were once Wall Street darlings. Ambarella more than doubled in value in 2015, and AMD staged a stunning five-bagger comeback in 2016. Let's discuss why both stocks fell out of favor, and if either stock is a good tech play for 2018.

An investor compares charts.

Image source: Getty Images.

What do Ambarella and AMD do?

Ambarella makes image application processors for action cameras, security cameras, dash cams, drones, and other devices. It captured Wall Street's attention in 2014 as GoPro's (NASDAQ:GPRO) supplier, and the action camera maker's IPO and subsequent growth lifted Ambarella's stock to over $120 by July 2015.

Ambarella also sells chips to DJI Innovations, the top drone maker in the world, and Hikvision, the world's biggest security camera company. In 2015, Ambarella acquired computer vision chip developer VisLab, which led to the recent launch of its new CV-series computer vision chips for the autonomous driving market.

AMD generates most of its revenue from sales of x86 CPUs and discrete GPUs, but it's the underdog in both markets. In the x86 CPU market, it competes against Intel (NASDAQ:INTC); in the GPU market, it goes up against NVIDIA (NASDAQ: NVDA).

The bears often argue that it's too hard for AMD to simultaneously battle Intel and NVIDIA. However, CEO Lisa Su, who took the top job in late 2014, beefed up AMD's EESC (Enterprise, Embedded, and Semi-Custom) unit -- which sells custom chips for gaming consoles -- as the chipmaker went back to the drawing board for new CPUs and GPUs. That turnaround plan led to AMD's big comeback in 2016.

How fast is Ambarella growing?

Ambarella's revenue fell 5% to $295.4 million in fiscal 2018, compared to a 2% decline in 2017. That ongoing slowdown was caused by two main factors.

An Ambarella chipset.

Image source: Ambarella.

First, its key customers -- including GoPro, DJI, and Hikvision -- started using image processing chips from other vendors. GoPro ditched Ambarella's chipset for a custom chipset from Japanese chipmaker Socionext in the Hero 6, while DJI and Hikvision started using Intel's Movidius computer vision chips in their newer products.

Second, bigger chipmakers like Intel and Qualcomm bundled together multiple components (including image processors) in reference designs for drones, cars, and other gadgets.

In addition to Movidius, Intel owns Mobileye, the top ADAS (advanced driver assistance systems) provider in the world, and makes depth-sensing RealSense cameras. Qualcomm will become the world's top automotive chipmaker if its planned purchase of NXP Semiconductors closes.

It will be brutally tough for Ambarella to counter that competition without denting its margins. That's why its non-GAAP net income fell 29% to $71.4 million last year. Analysts expect its revenue to stay nearly flat this year as its earnings dive another 32%.

How fast is AMD growing?

AMD's revenue rose 25% to $5.33 billion last year, compared to 7% growth in 2016. That accelerating growth was attributed to the recovery of its CPU business and robust demand for its new GPUs.

A PC gamer.

Image source: Getty Images.

AMD's new Ryzen CPUs impressed consumers by offering performance comparable to that of Intel's Kaby Lake CPUs at much lower prices. Its new Vega-based GPUs helped AMD keep pace with NVIDIA's current-gen Pascal chips. AMD also continued to launch new APUs (which combine a CPU and GPU on a single chipset) to simultaneously widen its moat against Intel and NVIDIA.

The main concern about AMD is that its gains against Intel and NVIDIA could be short lived, since the two larger chipmakers will strike back soon. Intel will launch its first 10nm CPU, Cannon Lake, later this year. NVIDIA will bring its next-gen GPU architecture, Volta, to mainstream consumers as well. Intel is also reportedly developing its own discrete GPU, which could cause headaches for both AMD and NVIDIA.

Yet AMD's profitability has also significantly improved. It reported a non-GAAP net profit of $179 million, compared to a net loss of $117 million in 2016. Analysts expect its revenue and earnings to rise 18% and 124%, respectively, this year.

The valuations and verdict

Ambarella currently trades at 38 times this year's earnings estimate, which is a very high multiple for a company with negative earnings growth. AMD has a lower forward P/E of 31, and has much rosier growth prospects.

I don't personally own either stock, but I'd definitely pick AMD over Ambarella. AMD has better leadership and stronger market positions in its two core markets, and doesn't look terribly expensive relative to its growth potential. However, AMD investors should still keep a close eye on Intel and NVIDIA's moves throughout the year.

Leo Sun has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Ambarella, GoPro, and Nvidia. The Motley Fool owns shares of Qualcomm. The Motley Fool recommends Intel and NXP Semiconductors. The Motley Fool has a disclosure policy.