Methodology, Formulas & Parameter Reference
Every digital video frame is defined by three interrelated ratios: the Storage Aspect Ratio (SAR), which is the ratio of horizontal to vertical pixel columns (\(\text{SAR} = \frac{W}{H}\)); the Pixel Aspect Ratio (PAR), which describes the shape of an individual pixel (\(1:1\) for square pixels, or \(2:1\) / \(1.33:1\) for anamorphic lenses); and the Display Aspect Ratio (DAR), which is the physical geometry of the image shown on screen (\(\text{DAR} = \text{SAR} \times \text{PAR}\)).
When scaling a square-pixel timeline to a new width \(W_{\text{new}}\), the mathematically exact height is \(H_{\text{exact}} = W_{\text{new}} \times \frac{H_{\text{source}}}{W_{\text{source}}}\). However, video codecs do not encode individual pixels in isolation; they partition the frame into square macroblocks or coding tree units (CTUs) of \(16 \times 16\), \(8 \times 8\), or \(4 \times 4\) pixels, and chroma subsampling requires dimensions divisible by at least 2 (mod-2).
Classic example: scaling a 16:9 frame to a width of 1366 pixels yields \(1366 \times \frac{9}{16} = 768.375\) pixels, which is neither an integer nor divisible by 16. Similarly, standard 1920x1080 is divisible by 8 (mod-8) vertically, but \(1080 \div 16 = 67.5\), which is why H.264 encoders internally pad 1080p frames to 1920x1088 in bitstream memory and attach a cropping rectangle flag. This calculator computes the greatest common divisor (GCD) of your source frame and outputs the nearest mod-2, mod-4, mod-8, and mod-16 resolutions along with the exact sub-pixel aspect deviation in percent.
| Alignment Modulo | Block Size | Codec / Pipeline Requirement | 16:9 Example Resolution |
|---|---|---|---|
mod-2 |
2x2 pixels | Minimum requirement for YUV 4:2:0 chroma subsampling. | 854x480 (FWVGA) |
mod-4 |
4x4 pixels | Transform block size in H.264/HEVC and WebGL textures. | 1280x720, 1920x1080 |
mod-8 |
8x8 pixels | DCT block boundary for JPEG, ProRes, and DNxHR. | 1920x1080, 3840x2160 |
mod-16 |
16x16 pixels | Full H.264 macroblock alignment without internal bitstream padding. | 1280x720, 1920x1088, 3840x2160 |
Production Workflow Verification & Quality Control
Before committing a full batch transcode or publishing a final master, verify the generated parameters against a five-second test slice of your source timeline. In post-production pipelines, container metadata headers, variable frame rate (VFR) timebases from mobile or screen-capture recordings, and non-square pixel aspect ratios can alter how downstream players interpret stream flags. Running every calculation and file conversion locally in browser memory ensures your production assets remain private while providing deterministic numbers you can paste directly into terminal automation scripts, NLE export presets, or camera prep checklists.