Table of Contents

Class VideoEffectDeinterlaceBlend

Namespace
VisioForge.Core.Types.VideoEffects
Assembly
VisioForge.Core.dll

Represents a deinterlacing effect that uses adaptive blending to combine fields and convert interlaced video to progressive format with motion-adaptive processing.

public class VideoEffectDeinterlaceBlend : VideoEffect, IVideoEffectDeinterlaceBlend, IVideoEffect

Inheritance

Implements

Inherited Members

Remarks

Interlaced video (common in broadcast television and older video sources) stores each frame as two fields: odd lines in one field and even lines in another, captured at slightly different times. When displayed on progressive displays, this causes visible combing artifacts on moving objects. Deinterlacing converts interlaced video to progressive format by combining or interpolating these fields.

SDK Availability: This effect is available in VideoCaptureCore, MediaPlayerCore, and VideoEditCore SDKs. Windows platform only.

Platform Support: Windows only (requires Windows-specific video processing filters).

The blend deinterlacing algorithm calculates output pixels as alpha blends of results from two different interpolation filters applied to the input fields. It uses motion detection to adaptively apply different blending strategies: in static areas, fields can be combined more aggressively for better vertical resolution; in moving areas, more conservative blending prevents motion artifacts. Two threshold values and two constant values control the adaptive blending behavior, allowing fine-tuning of the trade-off between vertical resolution and motion artifact reduction.

Key Features:

  • Adaptive blending based on motion detection and local content characteristics
  • Dual-threshold system for gradual transition between filtering modes
  • Configurable blending constants for fine control over adaptive behavior
  • Preserves vertical resolution in static areas while preventing combing in motion
  • Suitable for mixed content with both static and moving elements
  • Lower computational cost than motion-compensated deinterlacing methods

Common Use Cases:

  • Converting interlaced broadcast video (1080i, 480i) to progressive format
  • Processing video from DV camcorders or analog capture cards
  • Preparing interlaced content for playback on progressive displays
  • Converting legacy television content for modern viewing
  • Preprocessing interlaced video for editing or effects application
  • Real-time deinterlacing of live video capture with moderate computational requirements

Technical Details: The algorithm applies two interpolation filters to the input fields and computes alpha blend weights based on local image characteristics. VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Threshold1 and VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Threshold2 define the range over which blending weights transition, creating a gradual adaptation to different content types. VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Constants1 and VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Constants2 determine the actual blend ratios applied at the threshold boundaries. Lower thresholds make the algorithm more sensitive to motion, applying conservative filtering more frequently. The constants control how aggressively different filtering modes are applied.

Parameter Tuning Guidelines: The default values (Threshold1=5, Threshold2=9, Constants1=0.3, Constants2=0.9) work well for most content. If moving objects show combing artifacts, decrease Threshold1 or increase Constants1 to apply more conservative filtering. If static areas look soft or lack vertical resolution, increase Threshold2 or decrease Constants2 to preserve more detail. The relationship between thresholds creates a transition zone where blending gradually changes, preventing abrupt switches that could be visible as flicker.

Comparison with Other Deinterlacing Methods: Blend deinterlacing offers better quality than simple bob or weave deinterlacing and lower computational cost than motion-compensated methods. It is more sophisticated than line doubling but less complex than CAVT (VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceCAVT) which uses vertical-temporal filtering. Triangle deinterlacing (VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceTriangle) uses a different approach with triangle filtering kernels. Choose blend deinterlacing for good quality-performance balance on mixed content.

For other deinterlacing approaches, see VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceCAVT for Content Adaptive Vertical Temporal filtering with simpler single-threshold control, or VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceTriangle for triangle-kernel-based deinterlacing. GPU-accelerated deinterlacing is available via VisioForge.Core.Types.VideoEffects.GPUVideoEffectDeinterlaceBlend for better performance on high-resolution video.

Constructors

VideoEffectDeinterlaceBlend(bool, string, TimeSpan, TimeSpan)

Initializes a new instance of the VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend class with specified or default parameters.

public VideoEffectDeinterlaceBlend(bool enabled, string name = "DeinterlaceBlend", TimeSpan startTime = default, TimeSpan stopTime = default)

Parameters

enabled bool

true to enable the effect immediately; false to create the effect in a disabled state. The effect can be enabled or disabled later using the VisioForge.Core.Types.VideoEffects.VideoEffect.Enabled property.

name string

An optional name identifier for this effect instance. Default is "DeinterlaceBlend". Used to retrieve specific effect instances from a collection via the VisioForge.Core.Types.VideoEffects.VideoEffect.Name property. Multiple effects of the same type can coexist with different names.

startTime TimeSpan

The time at which the effect should start being applied. Default is Zero, which applies the effect from the beginning of the video. Use a specific time value to delay the effect start (useful for videos with mixed interlaced and progressive content).

stopTime TimeSpan

The time at which the effect should stop being applied. Default is Zero, which applies the effect until the end of the video. Set to a specific time to limit the effect duration (useful for selective deinterlacing of specific scenes).

Remarks

If both startTime and stopTime are zero (default), the effect will be applied for the entire video duration.

This constructor initializes the deinterlacing parameters to default values optimized for general content:

  • VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Threshold1 = 5
  • VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Threshold2 = 9
  • VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Constants1 = 0.3
  • VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Constants2 = 0.9
These defaults provide good quality for most interlaced content with mixed static and moving elements.

The blend deinterlacing algorithm has moderate computational requirements, typically suitable for real-time processing of SD and HD content on modern hardware. Processing time scales with resolution. For GPU-accelerated deinterlacing with better performance on high-resolution video, consider using VisioForge.Core.Types.VideoEffects.GPUVideoEffectDeinterlaceBlend.

After creating the effect, you can adjust the threshold and constant properties to optimize for specific content characteristics. Start with default values and adjust based on visual results, particularly examining moving edges and static detail areas.

Properties

Constants1

Gets or sets the first blending constant that determines the interpolation weight applied when content characteristics fall near or below Threshold1.

public double Constants1 { get; set; }

Property Value

double

Remarks

Constants1 controls the alpha blend weight applied to one of the two interpolation filters when content characteristics are below or near VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Threshold1. A value of 0.0 means using entirely one filter; 1.0 means using entirely the other filter; intermediate values blend both filters.

Lower values (0.1-0.3) apply more conservative filtering, which is typically desired for moving areas to prevent combing but may sacrifice some vertical resolution. Higher values (0.5-0.8) attempt to preserve more vertical resolution but risk more visible combing on motion. The default value of 0.3 provides motion-friendly filtering.

This constant works in conjunction with VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Threshold1 to define the filtering behavior for low-threshold regions (typically moving areas). Adjust this value if moving objects show unacceptable combing (increase constant) or if motion appears too soft (decrease constant).

Constants2

Gets or sets the second blending constant that determines the interpolation weight applied when content characteristics exceed Threshold2.

public double Constants2 { get; set; }

Property Value

double

Remarks

Constants2 controls the alpha blend weight applied to one of the two interpolation filters when content characteristics exceed VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Threshold2. This typically corresponds to static or slowly-changing areas where more aggressive field combination can preserve maximum vertical resolution.

Lower values (0.5-0.7) use more conservative filtering even in static areas, which may unnecessarily sacrifice vertical resolution. Higher values (0.8-1.0) aggressively preserve vertical resolution in static areas, producing sharper images but potentially showing artifacts if the motion detection misclassifies moving areas as static. The default value of 0.9 provides excellent vertical resolution in truly static areas.

This constant works with VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Threshold2 to define filtering behavior for high-threshold regions (typically static areas). Adjust this value if static areas appear soft (increase constant) or if supposedly static areas show combing (decrease constant, or adjust thresholds to improve motion detection).

Threshold1

Gets or sets the first threshold value used in the adaptive blending algorithm.

public int Threshold1 { get; set; }

Property Value

int

Remarks

Threshold1 defines the lower boundary of the adaptive blending transition range. When local content characteristics (such as inter-field differences indicating motion) fall below this threshold, the algorithm applies one filtering mode with blend constant VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Constants1. This threshold primarily affects how quickly the algorithm switches to motion-preserving filtering.

Lower values (1-3) make the algorithm more sensitive to motion, applying conservative filtering more frequently. This preserves motion better but may reduce vertical resolution more often. Higher values (7-15) delay the switch to motion-preserving mode, maintaining more vertical resolution but potentially leaving more combing artifacts on faster motion. The default value of 5 provides good balance for most content types.

This threshold should be lower than VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Threshold2 to create a proper transition range. The difference between Threshold1 and Threshold2 determines how gradual the transition is between filtering modes.

Threshold2

Gets or sets the second threshold value used in the adaptive blending algorithm.

public int Threshold2 { get; set; }

Property Value

int

Remarks

Threshold2 defines the upper boundary of the adaptive blending transition range. When local content characteristics exceed this threshold, the algorithm applies a different filtering mode with blend constant VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Constants2. Between Threshold1 and Threshold2, blending weights are interpolated to create smooth transitions.

Lower values (5-8) create a narrow transition range and make the algorithm switch filtering modes quickly, which may cause visible transitions in some content. Higher values (12-20) create a wider transition range with more gradual adaptation, producing smoother results but potentially leaving artifacts in the transition zone. The default value of 9 works well with the default Threshold1 value to create an appropriate transition range.

This threshold should be higher than VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend.Threshold1. A larger gap between thresholds produces more gradual adaptation but may cause intermediate areas to receive suboptimal filtering. A smaller gap produces more decisive switching but may create visible boundaries between filtered regions.

Methods

GetEffectType()

Gets the specific type of this video effect.

public VideoEffectType GetEffectType()

Returns

VideoEffectType

Returns VisioForge.Core.Types.VideoEffects.VideoEffectType.DeinterlaceBlend to identify this as a blend deinterlacing effect.

Remarks

This method overrides the base class implementation to provide the concrete effect type. The effect type is used by the video processing pipeline to route the effect to the appropriate blend deinterlacing filter processor.