Urgent.News

What's breaking now, across thousands of outlets.

Health & Medicine

Re-Encoding Before Upscaling Is Usually a Waste of a Generation (Measured)

Every upscaling tutorial says the same thing: "transcode to ProRes first, so the upscaler isn't working on compressed data." It sounds like hygiene. In most pipelines it is a net loss, not because the advice is wrong about compression, but because it is applied at the wrong stage, with the wrong bit budget, in an order no codec was designed for. I ran the experiment instead of repeating the…

Every upscaling tutorial instructs to transcode to ProRes before upscaling, as it avoids working on compressed data. However, this advice is ineffective when applied at the wrong stage, with insufficient bit budget and in an incorrect order. The author conducted an experiment to test the theory. The setup involved a 540×810 source frame, representing the original (downscaled using Lanczos), and a 1080×1620 ground truth frame. All paths were scored against PSNR and SSIM from ffmpeg, as well as a blockiness index.

The experiment assessed multiple paths: source directly to 2× Lanczos (oracle), H.264 at bitrate B, decoding then upscaling, the same wrapped in FFV1 lossless (the "transcode to ProRes" advice), two lossy encodes followed by upscaling, and upscaling followed by encoding the larger frame.

The results indicated that the lossless transcode had no effect; PSNR and SSIM remained identical at 32.590 and 0.94663, respectively, at various bitrates. At equal bits-per-pixel, compressing after the upscale yielded better results. Encoding the small frame (1.600 bits per pixel) and then upscaling consumed the same budget as encoding the big frame (0.400 bits per pixel).

When the larger frame was given four times the bitrate, the ordering reversed in favor of upscaling first. The mechanism behind this lies in encoding the high-frequency content generated by the resize, which avoids amplifying errors introduced during interpolation.

The blockiness grid does not disappear when upscaling, but it shifts to a higher period proportional to the scaling factor. Deblocking filters assume an 8-pixel grid, leaving the real artifacts untouched. Additionally, chroma subsampling destroys the 4:2:0 color detail during upscaling, and re-encoding at a higher resolution does not recover lost color detail.

Finally, re-saving a JPEG at the same quality yields minimal additional benefit, while increasing the quality in subsequent generations incurs negligible generational loss.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Health & Medicine

More from Saturday 14 November →