~/lightning

Lightning: How fast can you rotate an image?

Lightningat iOS Conf Singapore 2019 · on Friday, 2019-01-18· [swift, web-performance]
slides:none on file

A concrete benchmark: achieve 16 ms per frame to match 60 FPS for a 720p buffer (~3.1 MB per frame). Two practical paths are measured: CPU using vectorized routines from Accelerate (avoid bytewise loops), and GPU using Metal by creating textures via CVMetalTexture and running vertex/fragment shaders. Notes on tradeoffs: chroma subsampling halves memory, CPU/GPU share memory so explicit synchronization and triple buffering are required; Metal wins performance at the cost of complexity.

AI-written summary · about

  1. 0:00Start
  2. 0:55What is an image?
  3. 1:16RGBA/ARGB/BGRA Colorspace
  4. 2:444:2:0 Chroma subsampling
  5. 4:32Rotating a BGRA CVPixelBuffer by 90 degrees
  6. 5:02Rotating a 420 BiPlanar YCbCr CVPixelBuffer by 90 degrees
  7. 5:33Attempt #1 - Naive Implementation
  8. 6:53Attempt #2 - Use Accelerate
  9. 7:20Attempt #2 - Problems
  10. 9:54Wrap the CVPixelBuffer in a Texture
  11. 10:18Vertex & Fragment Shaders
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.