Tech Guides

Interlacing and deinterlacing

We often deal with video interlacing and deinterlacing, whether on the display, the source or the receiver. Handling and using them correctly can improve the picture considerably. Here we reveal the origins and secrets of both processes.

We often attach more importance to scaling than to interlacing in our video equipment, when in reality the final picture depends more on deinterlacing than on scaling. Let's look at what it is and how it works, starting with its definition.

Interlacing is a technique that consists of organizing digital information in a non-contiguous way to improve the performance of a system.

It is used mainly in telecommunications (for example, satellite or ADSL), multimedia technologies, memory access and file formats. The term "multiplexing" is sometimes used to refer to the interlacing of a digital signal or, in other words, one based on a multiplex. It is also used to organize multidimensional data structures. Logically, we are going to focus on video.

At first, televisions broadcast only in black and white, so a single electron beam was enough. Now, to watch a movie, it has to be written across the whole screen, so the beam must scan all of it. The scanning frequency is known as the refresh rate. It was chosen according to the electrical mains cycles: North America and part of Japan use 60 Hz, while Europe, the Middle East and part of Asia use 50 Hz. This gave rise to two TV systems that still coexist:



NTSC (National Television Standard Committee): The NTSC system has 525 horizontal lines, of which only 487 are visible on screen, and an interlaced refresh rate of 60 Hz.



PAL (Phase Alternating Line): The PAL system has 625 horizontal lines, of which only 540 are visible on screen, and an interlaced refresh rate of 50 Hz.



There are basically two ways of displaying video: progressive "scan" and interlaced "scan".

The first is used in computer monitors, projectors and digital television, and displays all the horizontal lines at once, as if they were a single frame.

The second, for its part, is used in the standard NTSC, PAL and SECAM television formats and displays only half of the horizontal lines on each pass (each frame is divided into two fields, the first containing all the odd-numbered lines and the second the even-numbered ones). Owing to the persistence of vision, our brain joins the two passes of the interlaced frame, leaving us with a single image. This has traditionally been used to obtain high refresh rates (50 Hz in PAL, 60 Hz in NTSC) with only half the data stream. In exchange, horizontal resolution is affected, since each frame consists of two halves which, when combined, can give rise to flicker, ghosting and other image artifacts.

By comparison, a film camera shoots 24 complete frames per second, whereas a video camera scans fields of even and odd lines alternately, at intervals of 1/60 second (NTSC) or 1/50 second (PAL).

The video image on DVDs is normally stored in interlaced format.

In NTSC, the conversion from 24 (complete) frames per second to 60 fields (each with half the lines) per second is done using the "2-3 pulldown" process. In professional circles, this mechanism is called pulldown.

Four frames are converted into five (to compensate for the change from 24 to 30 images per second), and each of them contains two fields of lines (even and odd). The drawback is that some are displayed for a longer period of time than others, causing judder or irregular motion.

DVD players with progressive output (for NTSC) convert the interlaced signal to progressive (by means of a line-doubling and interpolation process), so if they are connected to a projector, computer monitor or TV with this type of video input, a much higher-quality picture is obtained (with greater "real" vertical resolution).

Out of every six video frames, two mix fields from two different film frames, producing a visual defect of jerky, unsmooth and blurred motion.

When a scene change in the movie coincides with one of the two video frames that mix fields from two film frames, both images are merged into one, and the result is even worse.

In the case of PAL, since there are no repeated fields and a frame is always obtained by adding together the two fields that make it up, the drawback is much smaller. Although the player's video output is normally interlaced (since conventional display devices are), this process causes less loss of quality (the even or odd lines of each frame are sent every 1/50 of a second). What's more, if our display device is progressive (computer monitor, projector or TV) and the player has a progressive component video output, no signal processing (neither line doubling nor interpolation) is needed to enjoy it at full resolution.

The persistence of images on the retina is approximately one tenth of a second: accordingly, images that "jump" faster than that are perceived as continuous motion (as in the experiment of quickly flipping through sheets of paper with drawings on them). The images move with a certain smoothness, but this rate does not rule out flicker.

In cinema there are 24 frames per second, so in the tenth of a second we mentioned earlier, 2.4 frames go by. This figure, higher than 10 per second, was chosen to obtain smoother motion.

A picture tube or TV (or computer) screen has a more or less flat surface, coated on the inside with materials that light up (phosphors) when an electron beam strikes them (a phenomenon similar to that of fluorescent tubes).

In the case of non-interlaced scanning, the beam starts at the top left of the screen, drawing a horizontal line from left to right. It quickly returns to the left (flyback), but slightly lower down, where the second line begins. And so on, until it has drawn 600 lines. It then takes the time of 25 lines to return to the starting point (top left) and begin again. In total, there are 625 lines in a frame; that is, a frame has been formed over the course of the 625 lines. The time this takes is 1/25 of a second. At every instant of the scan, the intensity of the electron beam varies, so that images are formed by a series of lights and shadows. In a computer, the basic frequency will be 60 Hz, since the designs came from the US, so instead of 25 we would have 30 frames per second.

This gives rise to two problems. The first is that cinema runs at 24 frames per second and TV at 25. The second is that an annoying flicker is created, since what lights up 25 times per second is not the whole screen at once, but a luminous dot that travels across it. We cannot give the phosphor more persistence, because it would interfere negatively with moving images (trails would be created). Nor, in the early days of TV, was it possible to design systems with frame rates higher than 25 Hz (30 Hz in the US).

The way to solve the problem is to interlace two fields to form a frame. There are still 25 frames in a second, but now there are 50 half-frames or fields in a second. Flicker is noticeably reduced.

Millions of televisions have been made this way. The truth is that the flicker on them is bearable, but it is noticeable under certain conditions. For years now there have been other televisions with new technologies that offer a higher frame rate. Since the broadcaster is still sending the same thing, what they do is repeat it twice in half the time (or more times in less time), so that flicker is now undetectable.

Computing began with interlaced images, since it took advantage of the basic developments that had been used in televisions. Since people tend to spend many hours in front of their computer screens, it was found that the flicker caused fatigue and reduced work performance. The first improvement consisted of increasing the frame rate (also called the refresh rate). From the original 60 - let's not forget the American origin - it was possible to move to 75 or even 100 or 120 Hz. Not content with this, the non-interlaced method is also used, further improving viewing conditions.

Today, almost all computer screens are made to be able to operate in this way and at high refresh rates.

LCD screens do not have this problem. The dots are permanently lit until they have to be switched off. Basically, the difference lies in a device's capture and playback capability: interlaced (i) capture or generation builds the image from even and odd lines; progressive (p) captures and displays full frames, which are of better quality but also require more processing power in the device.

Ordinary TVs play back using interlacing, displaying even and odd lines within milliseconds to form the image. There are two options here: odd or even lines first. Sometimes playback errors arise due to the way the lines come in, and the solution is to use progressive video which, having been derived from interlaced capture, does not offer the best quality, but does avoid synchronization problems. However, if the material is captured progressively, quality increases, as there are no horizontal lines in fast diagonal movements.

When we talk about interlaced video, we mean that the image is made up not of a complete frame but of two fields of even and odd lines.

When shooting, cameras specify whether they do so progressively or interlaced, with the designations "p" for progressive or complete frames and "i" for interlaced. Recording is normally done in interlaced form unless it is specified as progressive, and there are cameras that can do it both ways. Some devices that are not specifically video cameras also record using image sequences that are progressive video.

Ideally, all videos would be deinterlaced to obtain complete frames, but this process results in a loss of quality. This should make us realize that we need to know how we are going to present the video, or what type of output we are going to give it, in order to decide whether or not to deinterlace it. Only if we are going to show it on analog TV should we keep it interlaced. If it is intended for display on the web, on a monitor or on digital TV, it should be deinterlaced. Any quality lost through deinterlacing will always be less than the scan lines that will be noticeable when using interlaced video on progressive displays.

If we have progressive video and need to play it on an analog TV, the picture will look fine, without any problems.

To understand how video is stored and displayed, we need to go back in time and look at a very obsolete technology: cathode ray tube (CRT) television. Basically, a television tube is a large piece of metal with no air inside. Inside it, there is a cathode that emits electrons when heated. There is also a strong electromagnetic field that accelerates the electrons toward the front of the tube and positions the beam. The front of the tube is coated with phosphor, and when the electrons strike it, it emits light toward the other side, that is, toward the viewer.

Now, at the time when the first TVs appeared on the market, the technology for writing 525 lines 60 times per second, or 625 lines 50 times per second, came at a price that was not suitable for the consumer market. Reducing the refresh rate would have required more complicated circuits and was not a viable option. But TV engineers had an idea: what if we wrote only every other line on each scan, and did the other half on the next scan? This way, we would only need 25/30 images per second (which means less bandwidth, and more TV channels in the same frequency band), and the human eye would still accept this as continuous motion. This idea of splitting the image into two halves was called interlacing, and the result, fields. Graphically, a field is basically an image with a black line every other line. During the first scan, the top field is written to the screen. Once all the odd lines have been written, the electron beam returns to the top left corner of the screen and starts writing the even ones. Since the phosphor takes a moment to stop emitting light, and since the human brain is too slow, instead of two separate fields what we see is a combination of the two or, in other words, the original image.

When color TV finally arrived, the interlacing technology remained the same, but a more sophisticated cathode ray tube was needed. Instead of emitting a single electron beam, it emits three, for RGB (red, green and blue). When dots of different colors are placed close enough to one another, the human eye will not see individual dots but a single one, and will combine the hues to create a new one. TVs use an additive color system to display the full range of colors.

In the NTSC world, the change required one more modification: the refresh rate had to be lowered slightly, from 60 Hz to 59.97 Hz (giving 29.97 images per second), to accommodate the colors. That is why we have these odd refresh rates in NTSC today.

There are already TV screens on the market that work in progressive scan mode. These models require a different signal, since the traditional way of connecting VCRs, DVD players or camcorders to the TV does not work with progressive images. LCD and plasma screens can only write progressive images. When they receive an interlaced signal, they need other methods to display a reasonable image. These techniques are normally called deinterlacing.

In conclusion, we hope we have cleared up all the doubts these processes raise, which have caused users more than a few headaches.