QCSchool: Mean Square Error and Peak Signal to Noise Ratio Filters | BAVC

QCSchool: Mean Square Error and Peak Signal to Noise Ratio Filters

BAVC News
March 9, 2016

Our second installment of QCSchool salutes the launch of QCTools 0.7.1 and the continued support of the National Endowment for the Humanities.

If you have spent any time canoodling with QCTools playback filters, you may have noticed that the phrase “field difference” pops up a lot. The term “field” in videotape technology is something of a misnomer, but it refers simply to the odd or even number of scan lines that form a single frame of video. Imagine, if you will, a picture. Any picture will do – but if you are lacking in imagination, let’s say it is a picture of a bird in flight. Now slice the picture into 525 horizontal strips.* Starting from the top of the frame, number each strip from 1 through 525. The odd lines are Field 1 (Upper); the even lines are Field 2 (Lower). The event is called “interlacing” and it works in conjunction with helical scan recording. If you sit very close to an old tube television, you can see the two fields at work. For more information on fields and how they work, check out this very simple explanation from Maximum Impact Research.

QCSchool

Image from Final Cut Pro’s user manual

 

Why Use MSEF and PSNRF?

As you might expect, the fields should interleave seamlessly. But when an error occurs during playback - such as head clog, tracking issues, or sync loss - the fields become discordant. Using the QCTools field checkbox in the playback window, we can see clog visible in one field and not the other; the chances are great that it is just one of the VTRs heads that is damaged (usually there are two, one scanning each field).

QCSchool
Image from Drop Video File(s) Here (PDF) by Ben Turkus

 

The QCTools filters PSNRF and MSREF are extremely effective in identifying these errors, surveying the digital file for ratio differences between the two fields, spiking when the divergence is unusual. Since the artifacts identified by these filters are often indicators of malfunctioning equipment or an unstable signal path, PSNRF and MSREF spikes are valued by quality controllers as high signs corrective measures should take place.

What’s the Difference Between PSNRF and MSEF?

QCSchool

Fig. 1 Tracking error identified by PSNRF and MSEF

 

The two filters have similar objectives but differ mathematically. Both use the first field (odd scan lines) as the “main” field and the second field (even scan lines) as the reference field. PSNR, or, Peak Signal to Noise Ratio, specifically reports on where there is a difference in noise between the two fields. The lower the PSNR, the higher the noise difference, which is why the results are displayed from the top down on the QCTools chart. The screen capture below shows the spike that identify the error in Fig. 1.

QCSchool

MSEF stands for Mean Square Error, an equation used to find the margin of error in statistical analysis. The filter finds the MSE between the two fields and spikes when the difference is extreme. Unlike PSNRF, the higher the MSEF number is, the higher the spike; MSEF is displayed from the bottom of the chart, rising to the top.

QCSchool

How can I learn more about MSEF and PSNRF?

Your friendly preservationist would love to explain the math behind MSEF and PSNRF but she went to art school and prefers to wrestle with her tumultuous inner life through craftmaking. If you need to participate in angry decoupage, please contact her, but otherwise you can learn more about the science MSEF and PSNRF by searching in the Wikipedia, or by following some of these more technically-inclined links:

The Evolution of Video Quality Measurement: From PSNR to Hybrid Metrics

FFmpeg Filters Documentation

QCTools Graph Descriptions

BUT WAIT…

As with all QCSchool blog posts, this one was sent to crackshot developer/archivist/pratfaller Dave Rice for fact-checking. He informed me that MSEF and PSNRF may soon be replaced by ffmpeg’s SSIM filter (Structural Similarity Metric). SSIM is very similar to MSEF/PSNRF but easier to read when plotted. Stay tuned!

 

How are you using QCTools? Wanna blog about it? Contact kelly [at] bavc.org

-------------

*525 is the number of fields in an NTSC broadcast format; PAL formats have 625 lines.