<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_DPIR_Deblock_%28mlrt%29</id>
	<title>Vapoursynth DPIR Deblock (mlrt) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_DPIR_Deblock_%28mlrt%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_DPIR_Deblock_(mlrt)&amp;action=history"/>
	<updated>2026-11-19T06:30:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.selur.net/index.php?title=Vapoursynth_DPIR_Deblock_(mlrt)&amp;diff=498&amp;oldid=prev</id>
		<title>Selur: Update to current Hybrid behaviour; code as &lt;pre&gt; (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_DPIR_Deblock_(mlrt)&amp;diff=498&amp;oldid=prev"/>
		<updated>2026-11-16T08:48:31Z</updated>

		<summary type="html">&lt;p&gt;Update to current Hybrid behaviour; code as &amp;lt;pre&amp;gt; (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:48, 16 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l41&quot;&gt;Line 41:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 41:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Example ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Example ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Default settings (OpenVINO on the CPU) on a 640×356 10-bit YUV 4:2:0 source (padded to 640×360 for mod 8):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Default settings (OpenVINO on the CPU) on a 640×356 10-bit YUV 4:2:0 source (padded to 640×360 for mod 8):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight lang=&quot;python&quot;&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = core.std.AddBorders(clip=clip, left=0, right=0, top=2, bottom=2) # add borders to achieve mod 8 (vsDPIRmlrtDeblock) - 640x360&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = core.std.AddBorders(clip=clip, left=0, right=0, top=2, bottom=2) # add borders to achieve mod 8 (vsDPIRmlrtDeblock) - 640x360&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# adjusting color space from YUV420P10 to RGBS for vsDPIRmlrtDeblock&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# adjusting color space from YUV420P10 to RGBS for vsDPIRmlrtDeblock&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l51&quot;&gt;Line 51:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 51:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# adjusting output color from RGBS to YUV420P10 for NVEncModel&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# adjusting output color from RGBS to YUV420P10 for NVEncModel&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s=&amp;quot;470bg&amp;quot;, range_in_s=&amp;quot;full&amp;quot;, range_s=&amp;quot;limited&amp;quot;, dither_type=&amp;quot;error_diffusion&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s=&amp;quot;470bg&amp;quot;, range_in_s=&amp;quot;full&amp;quot;, range_s=&amp;quot;limited&amp;quot;, dither_type=&amp;quot;error_diffusion&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== How Hybrid calls it ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== How Hybrid calls it ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Selur</name></author>
	</entry>
	<entry>
		<id>https://wiki.selur.net/index.php?title=Vapoursynth_DPIR_Deblock_(mlrt)&amp;diff=177&amp;oldid=prev</id>
		<title>Selur: New page: DPIR Deblock (mlrt) (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_DPIR_Deblock_(mlrt)&amp;diff=177&amp;oldid=prev"/>
		<updated>2026-11-14T19:14:44Z</updated>

		<summary type="html">&lt;p&gt;New page: DPIR Deblock (mlrt) (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; margin:0 0 1em 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DPIR Deblock (mlrt)&amp;#039;&amp;#039;&amp;#039; removes compression artifacts with the DPIR deblocking networks, run as ONNX models through vs-mlrt. Unlike [[Vapoursynth DPIR Deblock|DPIR Deblock]] (torch) it needs no PyTorch and runs on many kinds of hardware: CPU, Intel, NVIDIA, any Vulkan GPU or DirectML.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Filtering → Vapoursynth → DeBlock&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapoursynth_DPIRmlrtDeblock.png|none|DPIR Deblock (mlrt) controls in Hybrid]]&lt;br /&gt;
&lt;br /&gt;
== What it does ==&lt;br /&gt;
Every frame is restored with DPIR&amp;#039;s deblocking model (color model for RGB, gray model for gray clips). &amp;#039;&amp;#039;Strength&amp;#039;&amp;#039; tells the network how strong the compression artifacts are; higher values remove more blocking but also more detail.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* Windows: Hybrid&amp;#039;s vs-mlrt add-on with the core component, the DPIR models and at least one backend. macOS: ONNX Runtime (CoreML or CPU) from the bundle.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Control !! Parameter !! Range / values !! Hybrid default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| Strength || strength || 0.001 – 1000 || 50 || Deblocking strength; vs-mlrt gives the network strength/255 as noise level.&lt;br /&gt;
|-&lt;br /&gt;
| Tiles || tiles || 1 – 64 || 1 || Splits each frame dimension into this many tiles to save memory.&lt;br /&gt;
|-&lt;br /&gt;
| Tile pad || overlap || 0 – 64 || 16 || Overlap of the tiles; only with more than one tile.&lt;br /&gt;
|-&lt;br /&gt;
| Backend || backend || OpenVINO (CPU), OpenVINO (GPU), ONNX (CPU), ONNX (CUDA), DML (GPU), TensorRT, TensorRT RTX, NCNN; macOS: ONNX (CoreML), ONNX (CPU) || OpenVINO (CPU); macOS ONNX (CoreML) || Inference engine; only the backends whose add-on component and hardware are present are offered.&lt;br /&gt;
|-&lt;br /&gt;
| Device || device_id || 0 – 4 || 0 || GPU to use; not for the CPU and CoreML backends.&lt;br /&gt;
|-&lt;br /&gt;
| Streams || num_streams || 1 – 64 || 1 || Parallel streams (TensorRT, TensorRT RTX, OpenVINO GPU, NCNN, CoreML).&lt;br /&gt;
|-&lt;br /&gt;
| FP16 || fp16 || on/off || off || Half precision (faster, less memory).&lt;br /&gt;
|-&lt;br /&gt;
| BF16 || bf16 || on/off || off || bfloat16 precision; TensorRT and OpenVINO (CPU) only, excludes FP16.&lt;br /&gt;
|-&lt;br /&gt;
| CUDA Graph || use_cuda_graph || on/off || off || Reduces CPU overhead; TensorRT, TensorRT RTX and ONNX (CUDA).&lt;br /&gt;
|-&lt;br /&gt;
| TRT backend optimization || builder_optimization_level || 0 – 5 || 3 || Effort TensorRT spends on building the engine; TensorRT and TensorRT RTX.&lt;br /&gt;
|-&lt;br /&gt;
| Dynamic Shapes (min/opt/max) || min_shapes, opt_shapes, max_shapes || 0 = unset || – || Lets one TensorRT engine serve several frame sizes; TensorRT and TensorRT RTX.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Default settings (OpenVINO on the CPU) on a 640×356 10-bit YUV 4:2:0 source (padded to 640×360 for mod 8):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
clip = core.std.AddBorders(clip=clip, left=0, right=0, top=2, bottom=2) # add borders to achieve mod 8 (vsDPIRmlrtDeblock) - 640x360&lt;br /&gt;
# adjusting color space from YUV420P10 to RGBS for vsDPIRmlrtDeblock&lt;br /&gt;
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s=&amp;quot;470bg&amp;quot;, range_in_s=&amp;quot;limited&amp;quot;, range_s=&amp;quot;full&amp;quot;)&lt;br /&gt;
# deblocking using DPIR (mlrt)&lt;br /&gt;
from vsmlrt import Backend&lt;br /&gt;
clip = vsmlrt.DPIR(clip, strength=50.000, model=3, backend=Backend.OV_CPU(fp16=False,bf16=False))&lt;br /&gt;
clip = core.std.Crop(clip=clip, left=0, right=0, top=2, bottom=2) # removing added borders from mod requirement (vsDPIRmlrtDeblock) -  640x356&lt;br /&gt;
# adjusting output color from RGBS to YUV420P10 for NVEncModel&lt;br /&gt;
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s=&amp;quot;470bg&amp;quot;, range_in_s=&amp;quot;full&amp;quot;, range_s=&amp;quot;limited&amp;quot;, dither_type=&amp;quot;error_diffusion&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How Hybrid calls it ==&lt;br /&gt;
* The clip is padded to a multiple of 8, converted to 32-bit float RGB (16-bit with TensorRT and FP16; gray clips to gray), restored, cropped back and converted back.&lt;br /&gt;
* The model is chosen automatically: deblocking color model for RGB, deblocking gray model for gray clips.&lt;br /&gt;
* TensorRT engines are stored in the &amp;#039;&amp;#039;Engine Path&amp;#039;&amp;#039; folder of Hybrid&amp;#039;s path settings (the temp folder if it is empty); the first run with a new size builds the engine.&lt;br /&gt;
* DPIR Deblock (mlrt) also offers the [[Vapoursynth common filter options|common options]] (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== vs-mlrt (DPIR) ===&lt;br /&gt;
vs-mlrt runs ONNX models through several backends: vsov (OpenVINO, x86 CPU and Intel GPU), vsort (ONNX Runtime: CPU, CUDA, DirectML, CoreML), vstrt and vstrt_rtx (TensorRT, NVIDIA) and vsncnn (any Vulkan GPU). Its DPIR function offers two denoising models (default strength 5) and two deblocking models (default strength 50); the strength is on a 1/255 scale and can also be a clip. Without tiles the frame size must be a multiple of 8. TensorRT with FP16 is by far the fastest; on the CPU DPIR is very slow.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
* [https://github.com/AmusementClub/vs-mlrt vs-mlrt README] and its [https://github.com/AmusementClub/vs-mlrt/wiki/DPIR DPIR wiki page]&lt;br /&gt;
* [https://github.com/cszn/DPIR DPIR] (the original network)&lt;br /&gt;
* Hybrid&amp;#039;s tooltips&lt;br /&gt;
&lt;br /&gt;
[[Category:Vapoursynth Filters]]&lt;/div&gt;</summary>
		<author><name>Selur</name></author>
	</entry>
</feed>