Class GPUVideoEffectDeinterlaceBlend
- Namespace
- VisioForge.Core.Types.VideoEffects
- Assembly
- VisioForge.Core.dll
GPU-accelerated deinterlacing effect that converts interlaced video to progressive format using blend algorithm with DirectX hardware acceleration.
public class GPUVideoEffectDeinterlaceBlend : GPUVideoEffect, IGPUVideoEffectDeinterlaceBlend, IGPUVideoEffectInheritance
Implements
Inherited Members
Remarks
Available in: VideoCaptureCore, MediaPlayerCore, VideoEditCore (Windows only)
GPU-accelerated version using DirectX. Real-time processing with hardware acceleration for efficient deinterlacing of high-resolution interlaced video. Significantly faster than CPU-based deinterlacing, making it suitable for live broadcast conversion, real-time 1080i/720p processing, and 4K interlaced content where CPU processing would introduce latency or dropped frames.
Interlaced video (common in broadcast television and older video sources) stores each frame as two fields: odd-numbered lines in one field and even-numbered lines in another, captured at slightly different times. When displayed on progressive displays (modern monitors, TVs, projectors), this temporal offset causes visible combing artifacts on moving objects - horizontal lines or "teeth" along edges. Deinterlacing converts interlaced video to progressive format by combining, interpolating, or synthesizing the fields into complete frames.
The blend deinterlacing algorithm merges fields by averaging or interpolating adjacent lines from both fields. This GPU implementation executes the field blending in parallel across all pixels using DirectX shaders, achieving real-time performance even on high-resolution content. The shader reads from both odd and even field lines, applies weighting or averaging, and writes the progressive output in a single pass. This approach provides good quality-performance balance with minimal computational overhead.
Unlike the CPU version (VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend) which offers adjustable threshold and constant parameters for adaptive blending, this GPU version applies a fixed optimized blending algorithm. The simplified parameter set allows for more efficient GPU shader execution and higher throughput, making it ideal for real-time scenarios where performance is prioritized over fine-grained control. The fixed algorithm is tuned to handle typical broadcast content with mixed static and moving elements.
Common applications:
- Real-time conversion of 1080i broadcast feeds to progressive for streaming or display
- Live deinterlacing of capture card input (SDI, HDMI) during production
- Converting interlaced video from DV camcorders or analog sources in real-time
- Preparing interlaced content for modern progressive displays without offline preprocessing
- Real-time deinterlacing for video conferencing or streaming applications
- Fast conversion of legacy television content for modern playback with instant preview
Technical implementation: The GPU shader processes fields using parallel texture sampling and blending operations. Each output pixel is calculated by sampling appropriate positions from both fields and applying fixed blending weights optimized for general interlaced content. The parallel execution ensures consistent frame timing and eliminates the frame-to-frame variation that can occur with CPU processing under system load. Deinterlacing occurs in video memory without CPU involvement, freeing CPU resources for other tasks.
Performance characteristics: GPU blend deinterlacing typically processes full HD 1080i at 60fps+ and even 4K interlaced at 30fps or higher on modern graphics cards, with minimal GPU utilization (often <10%). This makes it ideal for live production environments, multi-stream processing, and scenarios where consistent real-time performance is critical. The effect introduces minimal latency (typically less than one frame) making it suitable for interactive applications.
Quality considerations: Blend deinterlacing provides good overall quality for mixed content with both static and moving elements. It avoids the bob/weave artifacts of simple field-separation techniques while maintaining lower computational cost than motion-compensated or motion-adaptive algorithms. The fixed blending approach works well for typical broadcast content but may show slight blurring on fast motion compared to more sophisticated deinterlacers. For most real-time applications, the quality-performance trade-off is excellent.
See VisioForge.Core.Types.VideoEffects.VideoEffectDeinterlaceBlend for CPU-based alternative with adjustable threshold and constant parameters for fine-tuned adaptive blending. The CPU version offers more control over the deinterlacing behavior through Threshold1, Threshold2, Constants1, and Constants2 properties, but processes frames sequentially with lower throughput. Choose GPU version for real-time processing and high-resolution video; choose CPU version when adjustable deinterlacing parameters are required for specific content optimization.
Constructors
GPUVideoEffectDeinterlaceBlend(bool, string, TimeSpan, TimeSpan)
Initializes a new instance of the VisioForge.Core.Types.VideoEffects.GPUVideoEffectDeinterlaceBlend class with GPU-accelerated blend deinterlacing.
public GPUVideoEffectDeinterlaceBlend(bool enabled, string name = "DeinterlaceBlend", TimeSpan startTime = default, TimeSpan stopTime = default)Parameters
enabledbool-
trueto enable the GPU effect immediately;falseto create the effect in a disabled state. Deinterlacing can be toggled on/off at any time to handle mixed progressive/interlaced content. namestring-
An optional name identifier for this effect instance. Default is "DeinterlaceBlend". Used to retrieve and control specific effect instances from the GPU effects collection. Only one deinterlacing effect should be active at a time to avoid multiple deinterlacing passes.
startTimeTimeSpan-
The time at which the effect should start being applied. Default is zero (from beginning). Useful for handling video files with mixed interlaced and progressive segments, applying deinterlacing only to interlaced portions.
stopTimeTimeSpan-
The time at which the effect should stop being applied. Default is zero (until end). Combined with
startTime, allows time-limited deinterlacing for specific scenes or segments containing interlaced content.
Remarks
The GPU-accelerated implementation processes deinterlacing entirely on the GPU using DirectX compute shaders, ensuring real-time performance with minimal CPU usage. Field blending is executed in parallel across all pixels, with optimized texture sampling patterns for maximum memory bandwidth efficiency.
Requires DirectX-compatible GPU with shader model 3.0 or higher. Automatically falls back to CPU processing if GPU is unavailable, though performance will be significantly reduced. For live broadcast or real-time applications, verify GPU availability before relying on this effect.
Note: Apply deinterlacing only to interlaced content. Progressive video does not benefit from deinterlacing and may appear slightly softened if processed unnecessarily. If unsure whether content is interlaced, examine a frame with motion - interlaced video shows horizontal combing lines on moving edges. Common interlaced formats include 1080i, 480i, and PAL/NTSC broadcast video.
Methods
GetEffectType()
Gets the specific GPU effect type identifier for this deinterlacing effect.
public GPUVideoEffectType GetEffectType()Returns
- GPUVideoEffectType
-
Returns VisioForge.Core.Types.VideoEffects.GPUVideoEffectType.DeinterlaceBlend to identify this as a GPU-accelerated blend deinterlacing effect.
Remarks
This method is used by the GPU video processing pipeline to route the effect to the appropriate DirectX shader processor for hardware-accelerated field blending and interlaced-to-progressive conversion.