Interlaced Video Before Upscaling: The 540-Line Ceiling, Measured
Every upscaling question about interlaced footage is really two questions wearing one coat: does deinterlacing throw away detail, and does the order of deinterlace and upscale matter? Both are answerable with a reference the algorithms cannot cheat against — we hold the pristine 1080p progressive frames, so every dB below is loss against a known truth, not against another filter.
1. The test signal, and why it is not a photo
A natural image is a bad instrument for measuring a deinterlacer, because you cannot tell a recovered edge from an invented one. So the reference here is built from three regions with known vertical frequency content, laid out side by side in a single 1920×1080 frame:
- Left third — diagonal edges with slope 1,7 per pixel. This is the classic deinterlacer failure mode: thin diagonal lines become staircases because alternate rows are missing.
- Middle third — a vertical chirp sweeping from 2 cycles across the frame height to 540. 540 cycles over 1080 rows is exactly 0,25 cycles/pixel, which is the field Nyquist of a 1080i signal. The chirp is the instrument.
- Right third — horizontal bands at 40 px period. Vertical detail is near-zero by construction, so a correct deinterlacer should leave this region alone. It is the control: any method that scores well here is scoring well on nothing.
The interlaced version is generated the way a real capture device generates it — even-numbered lines taken from frame i, odd-numbered lines taken from frame i+1:
import numpy as np
from PIL import Image
for i in range(N - 1):
a = np.array(Image.open(f"gt_{i:03d}.png")).copy()
b = np.array(Image.open(f"gt_{i+1:03d}.png"))
a[1::2] = b[1::2] # bottom field is one frame later
Image.fromarray(a, "L").save(f"il_{i:03d}.png")
That one line — a[1::2] = b[1::2] — is the entire physics of interlacing, and every
number below follows from it. When the scene moves, the two fields describe two different
moments. When it does not move, they describe the same moment, which turns out to be the most
interesting case of all.
2. On a locked-off shot, the best deinterlacer is the one you did not run
Every deinterlacing guide opens with a moving subject. Let us start with a static one instead, because the result is counterintuitive and it reframes everything that follows.
With zero motion, the even and odd fields of the interlaced frame are bit-identical to the true frame's even and odd rows. Weaving — doing nothing, just showing the interlaced frame as if it were progressive — reconstructs the reference exactly. PSNR is infinite, not "high". Measured against that perfect baseline:
| Method | PSNR vs truth | Diag. region HF | Chirp region HF |
|---|---|---|---|
| weave (no filter) | ∞ (bit-exact) | 0,00 dB | 0,00 dB |
| yadif | 20,27 dB | −0,14 dB | −2,00 dB |
| w3fdif | 18,08 dB | −1,06 dB | −2,39 dB |
| kerndeint | 16,56 dB | −2,74 dB | −4,14 dB |
| estdif | 16,43 dB | −0,22 dB | −3,21 dB |
| bwdif | 15,97 dB | −1,69 dB | −2,82 dB |
Read the left edge of that table carefully: on content that is not moving, every deinterlacer is strictly worse than doing nothing. Running yadif on a locked-off shot costs you 20 dB of accuracy that you already had for free. This is not a defect in yadif — it is what any interpolator must do when asked to replace real samples with estimates. The interpolator cannot know the fields agree, so it replaces half the rows anyway.
Practical consequence: a "deinterlace everything on ingest" pipeline is actively destructive on any static passage — title cards, product shots on a tripod, screen recordings of a still UI, interview cutaways. Those shots were already lossless.
(The control region is deliberately absent from this table. The bands area carries no vertical energy in the reference, so the high-frequency ratio there is a division by approximately zero — it returned values like +177 dB, which is a measurement artefact and not a result. Reporting it would be worse than omitting it.)
3. The chirp: where each deinterlacer actually stops
Now the same static sequence, measured not as one PSNR number but as a function of vertical frequency. Taking the mean column of the chirp strip, transforming along the vertical axis, and comparing each band against the pristine reference gives the response curve directly. Values are relative to truth, so 0,00 dB is perfect and negative is lost detail.
| Method | 0– .063 | .063– .125 | .125– .188 | .188– .250 |
.250– .313 | .313– .375 | .375– .438 | .438– .500 |
|---|---|---|---|---|---|---|---|---|
| yadif | +1,80 | +1,04 | +0,21 | +0,05 | −0,42 | −2,84 | −9,33 | −17,27 |
| w3fdif | +1,97 | +1,75 | +0,99 | +0,46 | −1,88 | −7,80 | −19,46 | −32,34 |
| kerndeint | +1,99 | +1,24 | +0,15 | −2,81 | −6,30 | −10,62 | −19,21 | −30,88 |
| estdif | +2,14 | +2,05 | +0,61 | −1,20 | −4,56 | −9,65 | −15,53 | −16,28 |
| bwdif | +2,14 | +2,54 | +1,60 | −0,65 | −7,09 | −22,73 | −28,00 | −30,53 |
Three things fall out of this table that the PSNR ranking in §2 hid completely.
First, everything below 0,125 cycles/pixel — 270 lines of vertical detail — comes back slightly louder than the reference. Every method shows +1,8 to +2,5 dB in the bottom two bands. That is not recovery; there is nothing to recover, the reference is the reference. It is the interpolation filter's passband gain. A mild overshoot in the low frequencies, which is exactly the mechanism behind the "deinterlaced footage looks a bit crunchy" impression. The signal is being boosted where it was already correct.
Second, the rolloff shape differs completely from the PSNR ranking. bwdif scored worst on PSNR (15,97 dB) yet holds the most energy in the 0,125–0,188 band of any method (+1,60 dB, where yadif is at +0,21). Then it falls off a cliff: −22,73 dB at 0,313–0,375, worse than everything else. yadif is the opposite shape — a thin margin at 0,125–0,188 (+0,21 dB) but the flattest descent through the top octave, still only −9,33 dB at 0,375–0,438 where bwdif has already lost 28 dB. A single PSNR number averages a narrow peak with a long tail and cannot tell these two apart; the curve can.
Third — and this is the one worth the whole exercise — the shape is not a gentle rolloff, it is a wall. Between 0,25 and 0,375 cycles per pixel (540 to 810 lines) every method drops 5 to 23 dB. Above 0,375 (810 lines) they are all between −15 and −32 dB, which is noise floor. There is no deinterlacer in this set that meaningfully reconstructs detail past roughly 810 lines, and most quit at 540.
4. The ceiling is 540 lines, and it is a hard zero
The chirp suggests a wall near 0,25 cycles/pixel. A sweep cannot prove a null at one specific frequency, so test it directly with discrete vertical gratings — one frequency at a time, three identical frames, measured against the pristine progressive decode of the same grating. This removes every confound: same content, same encoder, one variable.
| c/px | Lines | yadif | bwdif | estdif | w3fdif | kerndeint |
|---|---|---|---|---|---|---|
| 0,05 | 108 | −0,14 | +0,05 | −0,15 | −0,15 | −0,29 |
| 0,10 | 216 | +0,02 | +0,34 | −0,38 | −0,35 | −0,97 |
| 0,15 | 324 | +0,01 | −0,25 | −1,12 | +0,27 | −2,01 |
| 0,20 | 432 | −0,02 | −2,07 | −2,87 | +0,39 | −3,93 |
| 0,25 | 540 | +0,26 | null | null | −0,65 | +0,26 |
| 0,30 | 648 | +0,06 | −13,97 | −11,19 | −3,28 | −9,48 |
| 0,35 | 756 | −3,45 | −46,84 | −20,29 | −8,81 | −13,66 |
| 0,40 | 864 | −10,60 | −32,35 | −34,26 | −21,03 | −21,67 |
| 0,45 | 972 | −15,17 | −37,48 | −37,79 | −38,57 | −38,00 |
| 0,49 | 1058 | −38,88 | −52,53 | −53,62 | −51,90 | −50,20 |
The row at 540 lines is the point of this article. At exactly 0,25 cycles/pixel, the vertical
grating 0,5 + 0,45·sin(2π·0,25·y) evaluates to zero on every even row and ±0,45 on
every odd row. Measured directly on the input fields:
# fr = 0.25 cycles/px, 1080 rows
input_evenfield_std = 0.000 # the entire even field is flat
input_oddfield_std = 115.000 # the odd field carries the whole grating
One field of the interlaced signal is blank. Not attenuated — blank, standard deviation zero. That is what "540-line ceiling" means concretely, and it is the reason 1080i is described as having 540 lines of vertical resolution rather than 1080: at the top of its frequency range, half the samples are not merely noisy, they are constant.
And the deinterlacers respond exactly as the theory predicts. bwdif and estdif, which fill missing rows by searching for edge directions among the available neighbours, find no edge in a flat field and return a flat result — the table shows null, meaning the measured amplitude at that frequency was zero to numerical precision (−269,8 dB against the reference). yadif and kerndeint, which lean harder on the odd row's own value, happen to carry the grating through at +0,26 dB. w3fdif lands at −0,65 dB.
The honest reading: whether a given deinterlacer "recovers" 540-line detail is not a matter of quality. It depends on whether that particular filter copies from the surviving field or interpolates from neighbours. A filter that interpolates is doing the correct, principled thing and still returns nothing, because there is nothing to interpolate.
If you want to know the actual usable number rather than a wall, measure the −6 dB point. It is the frequency at which detail is down by a factor of two in amplitude, which corresponds to about what survives a re-encode and a viewing distance:
| Method | −3 dB | −6 dB | −10 dB | Lines at −6 dB |
|---|---|---|---|---|
| estdif | 0,368 | 0,420 | 0,500 | 908 / 1080 |
| yadif | 0,361 | 0,390 | 0,426 | 842 / 1080 |
| kerndeint | 0,292 | 0,335 | 0,363 | 724 / 1080 |
| w3fdif | 0,306 | 0,332 | 0,358 | 718 / 1080 |
| bwdif | 0,273 | 0,289 | 0,307 | 624 / 1080 |
| reference | 0,500 | 0,500 | 0,500 | 1080 / 1080 |
Note that estdif leads here (908 lines) while it was mid-pack on raw PSNR. On static content the interpolating, edge-directed filters are the right choice — they preserve the most usable detail above 540 lines, which is precisely the region where they are inventing rather than recovering, but inventing plausibly. Whether plausible invention is a feature or a bug is a decision about your content, not about the filter.
5. The order of operations question, settled with a 4K reference
The recurring argument is whether to deinterlace first and then upscale, or upscale the interlaced frames and deinterlace at 4K. The reason people believe the second is better is intuitive: more pixels to interpolate over should mean a better interpolation. Testing it requires a 4K truth, which we have — the pristine progressive frames upscaled by the same kernel.
| Method | deinterlace → 4× | 4× → deinterlace | Difference |
|---|---|---|---|
| yadif | 16,68 dB | 15,21 dB | +1,47 dB |
| bwdif | 16,24 dB | 15,11 dB | +1,13 dB |
| estdif | 13,56 dB | 13,53 dB | +0,03 dB |
| w3fdif | 13,62 dB | 13,52 dB | +0,10 dB |
| kerndeint | 13,74 dB | 16,10 dB | −2,36 dB |
| No deinterlacing at all, woven then upscaled: 11,05 dB — worst of every option tested | |||
Deinterlacing first wins for three of five, ties for two, and loses for one. The kerndeint result is the interesting negative: upscaling first helps it by 2,36 dB. kerndeint works by convolving a fixed small kernel across the line, and at 4K the same physical edge spans twice as many samples, so the kernel has more room to find it. That is a real effect, and it is specific to fixed-kernel methods — it does not generalise to the edge-tracing filters, whose gain is +0,03 and +0,10 dB, i.e. nothing.
The row that matters most is the footnote. Weaving the interlaced frames and upscaling them without deinterlacing at all scores 11,05 dB — five and a half dB below the worst deinterlacer. The comb pattern survives the upscale and is then baked in at four times the size. This is the actual common mistake, far more damaging than getting the order wrong.
6. Motion reverses the ranking — and one result I did not expect
All of the above is static content, which flatters interpolators. Add a continuous 1 px/frame vertical pan and the picture changes. Same reference, same 1080p truth, 39 frames:
| Method | PSNR, static | PSNR, 1 px/frame pan | Worst frame |
|---|---|---|---|
| weave | ∞ | 15,28 dB | 15,03 dB |
| yadif | 20,27 dB | 17,29 dB | 16,34 dB |
| bwdif | 15,97 dB | 16,49 dB | 16,32 dB |
| kerndeint | 16,56 dB | 14,18 dB | 13,92 dB |
| estdif | 16,43 dB | 9,49 dB | 6,77 dB |
| w3fdif | 18,08 dB | 9,48 dB | 6,84 dB |
yadif and bwdif improve on motion — they blend across frames, and the pan makes the missing half of each frame predictable. estdif and w3fdif collapse from about 17 dB to 9,5 dB, a loss of seven dB, and their worst frames hit 6,8 dB, which is visibly broken.
I want to be careful about this one, because it contradicts the usual ranking and the honest explanation matters more than the number. The likely cause is the content: the chirp's vertical detail is dominated by near-horizontal structure, and an edge-tracer looking for a clear edge direction in a field whose rows have just jumped by one pixel will latch onto the wrong slope. At 0,25 px/frame — four times slower — the same comparison is:
| Method | 0,25 px/frame | 1 px/frame |
|---|---|---|
| weave | 27,44 dB | 15,28 dB |
| bwdif | 25,13 dB | 16,49 dB |
| yadif | 24,86 dB | 17,29 dB |
| kerndeint | 20,82 dB | 14,18 dB |
| w3fdif | 16,62 dB | 9,48 dB |
| estdif | 16,14 dB | 9,49 dB |
Two things to take from this, and the first is uncomfortable. On slow motion, weaving beats every deinterlacer. At 0,25 px/frame the comb artefact is about a quarter-pixel misalignment between fields — sub-pixel, mostly invisible — and the interpolation error each filter introduces is larger than the artefact it removes. The crossover is somewhere between 0,25 and 1 px/frame in this content. I did not bisect it precisely, so I am reporting the two endpoints and the direction, not a claimed crossing point.
Second: this is one synthetic sequence, and estdif/w3fdif's poor showing is content-specific. The defensible claim is narrow — on vertical-detail-dominated content with a steady pan, edge tracing underperformed frame blending. It is not "estdif is bad". If your material is real footage with natural edges, run the comparison on a clip you can see; that is the only honest test.
7. The filter that silently did nothing
During setup, two of the five filters returned frames bit-identical to their input. Not similar — identical:
$ md5sum out/005.png
cdf6a166f63a92e5d86a72df50331f75
# estdif and w3fdif, default settings, both identical to the unfiltered frame
The cause is deint, which defaults to interlaced: those filters pass
through any frame the decoder has not flagged as interlaced. A synthetic PNG sequence has no
interlace flag, so both filters were a no-op that reported success. The graph ran, exit code zero,
and the numbers were the input. deint=all forces the work:
ffmpeg -i in.mkv -vf "estdif=deint=all" -pix_fmt gray out.mkv
ffmpeg -i in.mkv -vf "w3fdif=deint=all" -pix_fmt gray out.mkv
# yadif and bwdif: mode=send_frame gives 1 output frame per input
ffmpeg -i in.mkv -vf "yadif=mode=send_frame" -pix_fmt gray out.mkv
This matters beyond synthetic tests, because it is the same trap in production. A frame-unflagged
source — an MP4 whose h264 stream has no field_order set, or one remuxed through a
tool that dropped the flag — silently skips the filter. Verify with idet before
trusting any deinterlace step:
ffmpeg -i in.mkv -vf idet -f null - 2>&1 | grep detection
# on the synthetic test sequence (ground truth known to be TFF):
# Multi frame detection: TFF: 47 BFF: 0 Progressive: 0 Undetermined: 0
idet called it correctly here, 47 frames out of 47. It is reliable on clean material and much less so on grain-heavy footage, so treat an "Undetermined" majority as a signal to look at frames by hand rather than as permission to skip deinterlacing.
8. Field order: three decibels for getting it backwards
If the field order flag is wrong, the filter pairs the wrong two rows and interpolates between things that were never adjacent. Measured on the same 4K target, correct versus inverted:
| Field order | PSNR vs 4K truth | Cost |
|---|---|---|
| correct (TFF) | 17,08 dB | — |
| inverted (BFF) | 13,77 dB | −3,32 dB |
3,32 dB for one wrong flag, and the visible result is characteristically worse than the number suggests: the detail does not blur evenly, it splits. If a deinterlaced output looks wrong in a way you cannot name, check the field order before you touch the filter settings.
9. What it costs to encode
All deinterlaced variants encoded libx264 CRF 23, preset medium, yuv420p, same 39 frames:
| Variant | Size | vs progressive | Filter time |
|---|---|---|---|
| progressive truth | 257 KiB | 1,00× | — |
| estdif | 431 KiB | 1,68× | 6,62 s |
| yadif | 597 KiB | 2,32× | 2,27 s |
| w3fdif | 751 KiB | 2,92× | 3,23 s |
| bwdif | 1041 KiB | 4,05× | 2,45 s |
| kerndeint | 1336 KiB | 5,20× | 2,55 s |
| raw interlaced (no filter) | 1420 KiB | 5,52× | — |
Encoding cost tracks the same thing the frequency tables showed: estdif at 1,68× is the cleanest output, kerndeint at 5,20× leaves the most residual high-frequency energy for the encoder to spend bits on. The raw interlaced frames cost 5,52× because the comb pattern is nearly incompressible — another argument against skipping the step, if the quality argument were not enough.
The filter times are the counter-argument. estdif is 2,9× slower than yadif (6,62 s vs 2,27 s for 39 frames at 1080p) and it is the one that collapses on motion. In this test it bought the best static detail retention and the worst moving-image result. That is not a recommendation, it is a trade-off you have to resolve against your own footage.
10. What I would actually do
- Probe before filtering.
idetfirst; if the majority is Undetermined, inspect frames. Never deinterlace on the assumption that interlaced means interlaced. - Never upscale an interlaced frame. 11,05 dB versus 16,68 dB for yadif. The comb artefact gets four times bigger and becomes permanent.
- Deinterlace, then upscale. It wins or ties for four of five filters and never loses by more than a rounding error, except for fixed-kernel methods where the reverse gains 2,36 dB.
- Accept the ceiling. 1080i carries at most 540 lines of true vertical detail, and at exactly 540 the measurement returns a null. Any upscaler claiming to restore 1080 lines of vertical resolution from 1080i is inventing the upper half. That is not necessarily bad — plausible invention is what all upscaling is — but it is not recovery, and it should not be sold as such.
- Skip the filter when nothing moves. Weaving is bit-exact on a locked-off shot; every deinterlacer makes it worse. If you have per-shot control, use it.
The wider point is the same one that shows up across this whole measurement series: an upscaler cannot recover what the pipeline before it destroyed. Interlacing destroys half the vertical samples of every frame by construction. Deinterlacing then does its best with the half that survived, and the numbers above are the size of "its best". Running a 4× model afterwards does not change that arithmetic — it operates on the result. If you are choosing where to spend effort on a restoration, the capture and the deinterlace step are upstream of everything the upscaler can do, and the upscaling pipeline order that actually preserves detail is worth understanding before you pick a model.
Reproducing this
Everything above used ffmpeg's own filters and numpy, no model weights, no vendor SDK. The
reference generation, the interlacing step, and the five filters are three short scripts; the
chirp and grating generators are in §1 and §4. The only non-obvious requirements are
deint=all for estdif and w3fdif, mode=send_frame for yadif and bwdif, and
a lossless intermediate (ffv1) so the measurement is not contaminated by a first encode.