Deinterlacing properties and enumerated values

The video capture API includes enumerated values that specify deinterlacing behavior.

About deinterlacing

Deinterlacing can use a variety of techniques:
Adaptive
Use a motion-adaptive filter. This type of deinterlacing is usually done by the hardware.
Bob
Take the lines of each field and double them. This technique retains the original temporal resolution.
Bob 2
Discard one field out of each frame to improve the video quality. The temporal resolution is halved, however.
Weave
Combine two consecutive fields together. The temporal resolution is halved: the resulting frame rate is half of the original field rate.
Weave 2
Similar to weave, but the resulting frame rate is the same as the original field rate.
Figure 1. Deinterlacing in BOB mode

Enumerated values

enum capture_deinterlace_mode {
	CAPTURE_DEINTERLACE_NONE_MODE	= 0,
	CAPTURE_DEINTERLACE_WEAVE_MODE,
	CAPTURE_DEINTERLACE_BOB_MODE,
	CAPTURE_DEINTERLACE_BOB2_MODE,
	CAPTURE_DEINTERLACE_WEAVE2_MODE,
	CAPTURE_DEINTERLACE_MOTION_ADAPTIVE_MODE,
};

The following enumerated types are used for setting the deinterlacing mode:

CAPTURE_DEINTERLACE_NONE_MODE
0
Don't deinterlace.
CAPTURE_DEINTERLACE_WEAVE_MODE
Use weave deinterlacing mode.
CAPTURE_DEINTERLACE_BOB_MODE
Use bob deinterlacing mode.
CAPTURE_DEINTERLACE_BOB2_MODE
Use alternate bob deinterlacing mode.
CAPTURE_DEINTERLACE_WEAVE2_MODE
Use alternate weave deinterlacing mode.
CAPTURE_DEINTERLACE_MOTION_ADAPTIVE_MODE
Use motion adaptive deinterlacing mode.

Buffer properties

The CAPTURE_PROPERTY_*_BUFFER_ types store buffer properties:

CAPTURE_PROPERTY_MIN_NBUFFERS
CAPTURE_PROPERTY( 'Q', 'M', 'N', 'B' )
Read uint32_t
Minimum number of buffers required for a specific deinterlacing mode.

For properties used for deinterlacing frames from external sources (e.g., USB stick) see "External source properties".