ADR 0014: A rendition is planned in the core
Status: accepted (2026-10-19)
Context
A rendition turns a span of a recording into stitched, stabilized frames for an encoder. Most of that is decisions, not I/O: which frames to show, which to decode first, how the lens files pair up, where the view points at each frame, and how the lens colours are corrected. Only decoding, copying pictures and rendering touch the browser. Keeping the decisions in the pure core keeps them tested to the core's standard and the browser layer thin.
Decision
rendition/planSpanchooses the frames: the first video's frames inside the window, in presentation order, each paired with the nearest-in-time frame of every other video, and for each video the decode-order range to feed a decoder, from the last sync frame before the first frame it needs.rendition/viewOfgives the stabilized view along the attitude:offfollows the camera,lock,horizon,smoothandfollowcompose ADR 0006's corrections onto it (smoothandfollowwith a one-second time constant unless told otherwise).rendition/frameAtgives one frame'sStitchFrame: the frame's moment on the motion clock is the capture clock plus its media time (ADR 0010), the output turns byoutputToCameraat that moment, the rolling-shutter turn is tabulated down the canvas rows (ADR 0011), and the output is twice as wide as tall with an even height.rendition/cubeFrameAtgives a cube-map frame (ADR 0020) the same way, timed and turned asframeAt, with no rolling-shutter table and no colour correction: the camera stitched and matched its own lenses.stitch/estimateColourreturns aColourCorrection: each lens's gains (ADR 0008) and the seam colour field (ADR 0018), measured after each lens is flattened by its own vignetting (ADR 0017). It reads a small RGBA copy of each video's frame (LensPicture) through each lens's image placement, so the browser layer only has to copy a frame to a few hundred pixels.
Consequences
- The browser layer (decode, copy, render) holds no decision a test of the core could not reach.
- Pairing by nearest time copes with lens files whose frames are offset slightly; files that dropped frames pair with the nearest remaining one rather than drifting.
- Colour is estimated on frames the rendition samples, not every frame; how often, and how the estimate is smoothed between samples, is the browser layer's choice and a quality knob.