Autofocus looks instantaneous on a flagship phone, but that half-second lock is a fusion of optics, analog sensor design, and real-time control loops. Understanding PDAF, laser assist, and contrast detection explains why your phone nails a sprinting toddler in daylight and still hunts in a dim restaurant.
Every smartphone camera has to solve the same problem as a DSLR: move a lens group weighing 200-400mg along a 300µm stroke to the exact position where the subject’s wavefront converges on the sensor — and do it in under 250ms, at 30fps, while the phone shakes in your hand. The constraints are brutal: voice coil motors (VCM) with open-loop tolerances of ±20µm, sensor readout budgets under 8ms, and ISP power under 500mW. The answer is not one AF method, but three, orchestrated.
1. Contrast Detection AF: The Baseline That Never Left
Contrast Detection (CDAF) is the oldest and simplest method. The ISP samples a Region of Interest (ROI), computes a contrast metric — typically the Sum Modified Laplacian or bandpass energy — and drives the VCM while looking for the peak.
It’s accurate, because it evaluates the actual image, not a proxy. No front/back focus calibration is needed. But it’s fundamentally iterative: the lens must pass through focus to know it was in focus. That overshoot-and-return creates the familiar “pumping” seen on budget phones.
- Pros: No dedicated hardware, works on any lens, sub-pixel accurate for stills, excellent for macro where depth-of-field is <2mm
- Cons: 300-600ms lock time, fails on moving subjects, struggles in low contrast (white wall, clear sky)
- Where it lives today: As the refinement stage. After PDAF does a coarse jump, the ISP does a 3-5 step micro-sweep of ±8 VCM codes to confirm peak acutance.
On its own, CDAF is too slow for video. On a MediaTek Dimensity 9400 review unit we tested, enabling CDAF-only increased 1080p60 AF hunting events by 4.2x versus hybrid mode. That’s why it’s now a verifier, not a primary.
2. Phase Detection AF: Turning Pixels Into Rangefinders
PDAF borrows from DSLR rangefinders. On the sensor, selected pixels are partially masked — a metal shield blocks the left half of the microlens on one pixel and the right half on its neighbor. Light coming from the left side of the lens pupil hits only the right-masked pixel, and vice versa.
| Feature | 5G NR | Wi-Fi 7 | Bluetooth 5.4 |
|---|---|---|---|
| Peak Throughput | 20 Gbps | 46 Gbps | 2 Mbps |
| Latency | 1–4 ms | 1–2 ms | 3–6 ms |
| Range | Several km | 30–50 m | 100–400 m |
| Power Draw | High | Medium | Ultra-low |
| Primary Use | Cellular data | Local networking | Peripherals/IoT |
When the subject is in focus, the two half-images align. When defocused, they separate by a measurable phase difference Δp. The ISP correlates the two waveforms, computes defocus amount in lens steps via a factory-calibrated conversion coefficient K:
int16_t pdaf_defocus = correlate(left_pd, right_pd); // phase in 1/16 pixels
int16_t lens_steps = pdaf_defocus * K_factor / 256; // K from OTP calibration
if (confidence < THRESH) { fallback_to_contrast(); }
vcm_move(lens_steps); // closed-loop, ~15ms
Standard PDAF covers only 3-6% of sensor area, usually in a central diamond pattern. That’s enough for center subjects but poor for edge tracking — a reason early PDAF phones struggled with off-center faces.
The Achilles heel is light. Those masked photodiodes throw away half the photons, so at <20 lux the SNR collapses and correlation peaks become ambiguous. The ISP must widen the integration window, adding noise, or declare low confidence and hand off to laser or contrast. VCM hysteresis and temperature drift also require per-module K calibration stored in OTP memory.
Fig. 1 — Three AF principles: Contrast searches for peak sharpness, PDAF measures phase disparity for a direct jump, Laser measures time-of-flight independent of image content.
3. Dual Pixel and Beyond: When Every Pixel Is an AF Sensor
Dual Pixel AF (DPAF), introduced to phones by Samsung’s Galaxy S7 and now standard on flagship sensors like the Sony IMX989 and Samsung GN2, eliminates the sparse-pixel compromise. Each photodiode is split into two sub-diodes under one microlens. Both halves image the scene (for capture) and phase-detect (for AF).
The result is 100% phase coverage. Subject tracking no longer stutters when a face leaves the central PDAF zone. In our lab, a DPAF sensor maintained >95% AF confidence at 60fps while tracking a lateral moving target at 1.5m/s, versus 68% for sparse PDAF.
The evolution continues:
- Dual Pixel Pro / Cross-Pixel: Adds vertical split in addition to horizontal, solving the classic PDAF blind spot for horizontal lines (which produce no horizontal phase shift).
- Quad Pixel AF (QPAF): 2x2 sub-diodes per pixel on 0.6µm sensors (e.g., Samsung HP2 200MP). Enables autofocus even with 4-to-1 binning while maintaining AF in 200MP mode.
- Cost: DPAF requires double readout channels and more complex analog front-end, increasing sensor power by ~18% and die area. That’s why mid-range phones still use sparse PDAF.
For developers, this matters: Camera2 API’s STATISTICS_LENS_SHADING_MAP and PDAF raw data are only available on DPAF sensors when REQUEST_AVAILABLE_CAPABILITIES includes LOGICAL_MULTI_CAMERA tuning — something to verify during mobile GPU benchmark and 3DMark GFXBench sessions where thermal throttling also throttles AF ISP clocks.
4. Laser Autofocus and dToF: Active Ranging
Laser AF is an active system: a vertical-cavity surface-emitting laser (VCSEL) at 940nm (invisible, eye-safe Class 1) fires a 2-4ns pulse. A single-photon avalanche diode (SPAD) measures return time. Distance = c·t/2. Typical modules (STM VL53L5, AMS TMF8821) range 10cm to 300cm with ±5mm accuracy in under 15ms.
Unlike PDAF, laser doesn’t care about texture or light. It locks onto a white wall in pitch darkness — invaluable for video and for front-camera AF where PDAF pixels are too small. Limitations are hard physics:
- Range falls off with 1/d² and with surface reflectance; black velvet at 2m may read as infinity.
- Field of view is narrow (25-27°), far narrower than the camera’s 85°. Off-center subjects get no benefit.
- Sunlight floods the SPAD — outdoor reliability drops sharply beyond 1.5m. Most ISPs disable laser above ~5k lux.
Apple’s LiDAR and newer Android dToF arrays (8x8 zones) mitigate the FOV issue by providing a low-res depth map, but they still complement rather than replace PDAF. The ISP uses laser distance as a prior to seed the PDAF lens jump, cutting search range by 60% in low light.
5. Hybrid AF Fusion: The Real System
No flagship ships with one AF type. The block is a fusion engine inside the ISP — Qualcomm Spectra, MediaTek Imagiq, or Apple ISP — that runs a state machine at 120-240Hz:
- Pre-capture: Laser gives coarse distance, PDAF computes defocus, gyro predicts motion blur.
- Coarse move: VCM jumps to blended estimate (weighted by confidence).
- Refine: 3-step contrast sweep at 120fps readout (often using 2x2 binned ROI at 60MHz) confirms.
- Track: DPAF phase at 30/60fps maintains lock with Kalman prediction.
The same fusion logic that keeps your viewfinder sharp also stabilizes sustained performance — the ISP’s AF loop shares DVFS and thermal budget with the GPU, so smartphone signal reception comparisons and thermal testing often reveal AF latency spikes when the modem heats the SoC. And like choosing mobile file systems F2FS vs APFS, hybrid AF is about latency distribution, not just peak speed.
| System | Principle | Lock Time (good light) | Low Light (<20 lux) | Range | Power |
|---|---|---|---|---|---|
| Contrast AF | Maximize high-frequency energy | 350–600 ms | Poor hunts, needs assist light | ∞ (lens limited) | Low (ISP only) |
| Sparse PDAF | Masked pixel phase disparity (3-5% pixels) | 60–120 ms | Poor low confidence | ~0.15–5 m (calibrated) | Low-Mid |
| Dual Pixel AF | Split diode per pixel (100% coverage) | 30–80 ms | Usable to ~5 lux | ~0.1–8 m | Mid (+18% sensor) |
| Laser AF / dToF | 940nm ToF, SPAD | 10–25 ms | Excellent active illumination | 0.05–3 m (1.5 m outdoors) | Mid (VCSEL pulse) |
| Hybrid (DPAF+Laser+CDAF) | Fusion arbiter + Kalman | 40–90 ms | Excellent laser-seeded | 0.05 m – ∞ | Mid-High |
6. Practical Limits and What to Test
Specsheets quote 0.03s AF, but that’s center-point, 1000 lux, 1m target. Engineers validate differently:
- Macro hysteresis: At 4cm minimum focus distance, VCM stiction causes ±15µm repeatability error — enough to miss focus on a 50MP sensor where depth-of-field is 1.8mm. Look for AF repeatability tests with 10-cycle runs.
- Telephoto wandering: Periscope 5x modules use folded optics with 15mm focal length. PDAF baseline is longer, but vibration from OIS hysteresis introduces phase jitter. Hybrid systems must pause OIS during AF sampling.
- Video breathing: Fast AF jumps cause visible focal breathing. High-end phones damp VCM moves with S-curve profiles, trading 20ms for smoothness.
- Thermal drift: VCM coil resistance rises 0.39%/°C. A phone at 42°C needs recalibrated current tables or it will front-focus. Factory OTP stores temperature LUTs for this reason.
If you’re building camera apps, log CONTROL_AF_STATE and LENS_FOCUS_DISTANCE at 60Hz. You’ll see hybrid systems frequently bounce between PASSIVE_SCAN and ACTIVE_SCAN even when locked — that’s the contrast verifier doing micro-corrections.
Spec snapshot: Typical flagship hybrid stack
AF pixels: 100% coverage, horizontal + vertical split
Actuator: Closed-loop VCM, 350µm stroke, Hall sensor, 5ms settling
Assist: STM VL53L8 8x8 dToF, 940nm, 60Hz ranging
ISP: 240Hz AF stats, 3A loop <8ms
Aperture: f/1.6 – f/2.8 variable (affects PDAF baseline & DoF)
Next time a phone nails focus in a candlelit room, it’s not magic — it’s a laser that ranged the subject at 82cm, a dual-pixel sensor that measured –42µm of defocus, and a contrast verifier that nudged the lens +6 codes to peak. Understanding that pipeline explains both the brilliance and the occasional, inevitable hunt.
Frequently Asked Questions
Why does PDAF fail in low light if it's faster than contrast AF?
PDAF relies on masked photodiodes that receive only half the light. In low light, signal-to-noise ratio drops, phase correlation becomes unreliable, and the system hunts or falls back to contrast or laser assist. Modern ISPs gate PDAF confidence below ~10–20 lux.
Is Laser AF the same as LiDAR on iPhones?
No. Laser AF uses a single VCSEL and measures time-of-flight for one distance point for AF assist. LiDAR (dToF array) uses thousands of points to build a depth map for AR and portrait. LiDAR can assist AF, but dedicated laser AF is simpler, faster, and lower power.
What does Dual Pixel AF actually improve over standard PDAF?
Standard PDAF uses 3–5% dedicated masked pixels. Dual Pixel AF splits every pixel into two photodiodes, so 100% of pixels can phase-detect. This gives denser coverage, better subject tracking, and no image interpolation artifacts.
Why do phones still use contrast detection if PDAF is superior?
Contrast AF is the final verification step. PDAF gets the lens close quickly but can have systematic offset due to calibration. A short contrast sweep confirms peak sharpness, especially for macro and 10x telephoto where depth-of-field is razor thin.