Bifrost

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (Types of Rainbows)
(v2.1.0 update)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{FilterCat|External_filters|Restoration_filters|Rainbow & Dot Crawl Removal}}
+
{{FilterCat6|External_filters|Plugins|Plugins_x64|Restoration_filters|Rainbow & Dot Crawl Removal|Deep_color_tools}}
{{Filter
+
{{Filter3
| {{Author/Myrsloik}}, dubhater [v2.0]
+
|1={{Author/Myrsloik}}, dubhater, {{Author/Asd-g}}
| v2.0
+
|2=v2.1.0
| [http://github.com/dubhater/vapoursynth-bifrost/releases/download/v2.0-avs/avisynth-bifrost-v2.0.7z Bifrost]
+
|3=[https://github.com/Asd-g/AviSynth-bifrost/releases/ bifrost-2.1.0.7z]
| Rainbow & Dot Crawl Removal
+
|4=Rainbow & Dot Crawl Removal
|
+
|5=Open Source
* YV12
+
|6=[https://forum.doom9.org/showthread.php?t=169758 Doom9 Thread]}}
|
+
 
|}}
+
<br>
+
 
== Description ==
 
== Description ==
:Bifrost is a temporal derainbowing filter created by Fredrik Mellbin. The original [[Bifrost v1.1]] worked on the whole frame or not at all.
+
Bifrost is a temporal derainbowing filter created by Fredrik Mellbin. <br>
:This version now works on blocks, making it possible to process static rainbows even if there is lots of motion in other parts of the image.
+
The original [[Bifrost v1.1]] worked on the whole frame or not at all. This version now works on blocks, making it possible to process static rainbows even if there is lots of motion in other parts of the image.<br>
 
+
==== Requirements: ====
+
:- AviSynth 2.5.8 or later
+
:- Supported color formats: [[YV12]]
+
 
<br>
 
<br>
 
+
== Requirements ==
== Syntax and Parameters ==
+
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6.0]
:{{Template:FuncDef|Bifrost (clip, clip "altclip", float "luma_thresh", int "variation", bool "conservative_mask", bool "interlaced", int "blockx", int "blocky")}}
+
* [x64]: [[AviSynth+]]
 +
* Supported color formats: [[YV12]], [[YV16]], [[YV24]], [[YV411]]
 +
** AviSynth+: All [[planar]] YUV formats (8/10/12/14/16-bits) are supported.
 
<br>
 
<br>
::{{Par|altclip|clip|}}
+
* [https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0 Microsoft Visual C++ 2019 Redistributable Package (x86 / x64)]
 +
:<span style="color:red">***</span> <tt>vcredist_x86.exe</tt> is required for <tt>Bifrost-x86</tt>
 +
:<span style="color:red">***</span> <tt>vcredist_x64.exe</tt> is required for <tt>Bifrost-x64</tt>
 +
<br>
 +
== [[Script variables|Syntax and Parameters]] ==
 +
:{{Template:FuncDef|Bifrost (''clip'', ''clip'' "altclip", ''float'' "luma_thresh", ''int'' "variation", ''bool'' "conservative_mask", ''bool'' "interlaced", ''int'' "blockx", ''int'' "blocky")}}
 +
<br>
 +
::{{Par2| |clip| }}
 +
::: A clip to process. It must be in YUV 8..16-bit planar format and must have at least three planes.
 +
<br>
 +
::{{Par2|altclip|clip| }}
 
:::Bifrost will copy from this clip the chroma of the blocks it can't process. This allows moving blocks to be processed with some other filter.  
 
:::Bifrost will copy from this clip the chroma of the blocks it can't process. This allows moving blocks to be processed with some other filter.  
::::altclip must have the same format, dimensions, and length as the input clip.
+
:::{{Template:FuncDef|altclip}} must have the same format, dimensions, and length as the input clip.
 
<br>
 
<br>
::{{Par|luma_thresh|float|10.0}}
+
::{{Par2|luma_thresh|float|10.0}}
 
:::Blocks where the luma changes less than this are considered static and may be processed.
 
:::Blocks where the luma changes less than this are considered static and may be processed.
 
<br>
 
<br>
::{{Par|variation|int|5}}
+
::{{Par2|variation|int|5}}
 
:::Controls how big a chroma change must be in order to be considered a rainbow. Increasing this can reduce false positives.
 
:::Controls how big a chroma change must be in order to be considered a rainbow. Increasing this can reduce false positives.
 
<br>
 
<br>
::{{Par|conservative_mask|bool|false}}
+
::{{Par2|conservative_mask|bool|false}}
 
:::If true, only pixels detected as rainbows will be processed. Otherwise, pixels that have rainbows above and below them will also be processed.
 
:::If true, only pixels detected as rainbows will be processed. Otherwise, pixels that have rainbows above and below them will also be processed.
 
<br>
 
<br>
::{{Par|interlaced|bool|true}}
+
::{{Par2|interlaced|bool|true}}
 
:::If true, [[SeparateFields]] and [[Weave]] will be invoked in order to process the top and bottom fields separately.
 
:::If true, [[SeparateFields]] and [[Weave]] will be invoked in order to process the top and bottom fields separately.
 
<br>
 
<br>
::{{Par|blockx|int|4}}
+
::{{Par2|blockx|int|4}}
::{{Par|blocky|int|4}}
+
::{{Par2|blocky|int|4}}
:::The dimensions of the blocks. Smaller is probably better. The default 4×4 should be good enough.
+
:::The dimensions of the horizontal and vertical blocks. Smaller is probably better. The default 4×4 should be good enough.
::::'''Note:''' If the dimensions of the image aren't divisible by blockx and blocky, the right and/or bottom edges won't be processed. Pad or crop the input clip before using Bifrost.
+
 
<br>
 
<br>
  
Line 54: Line 59:
 
<br>
 
<br>
 
====Rainbows added after telecine====
 
====Rainbows added after telecine====
In this case, Bifrost should be used in interlaced mode, right after the source filter:
+
In this case, Bifrost should be used in [[FAQ_different_types_content#How_do_I_recognize_progressive.2C_interlaced.2C_telecined.2C_hybrid_and_blended_content.3F|interlaced]] mode, right after the source filter:
 
  [[DGDecode|MPEG2Source]]("rainbows2.d2v")
 
  [[DGDecode|MPEG2Source]]("rainbows2.d2v")
 
  Bifrost(interlaced=true)
 
  Bifrost(interlaced=true)
Line 60: Line 65:
 
<br>
 
<br>
 
====Rainbows added before telecine====
 
====Rainbows added before telecine====
First you must fix the telecine, then use Bifrost in progressive mode:
+
First you must fix the telecine, then use Bifrost in [[FAQ_different_types_content#How_do_I_recognize_progressive.2C_interlaced.2C_telecined.2C_hybrid_and_blended_content.3F|progressive]] mode:
 
  [[DGDecode|MPEG2Source]]("rainbows1.d2v")
 
  [[DGDecode|MPEG2Source]]("rainbows1.d2v")
 
  TFM(order=1)
 
  TFM(order=1)
Line 68: Line 73:
  
 
== Changelog ==
 
== Changelog ==
  Version 2.0
+
Version     Date            Changes<br>
      - This version now works by processing blocks rather than whole frames. Static rainbows can now be processed even if there is lots of motion in other parts of the image.
+
2.1.0       2021/04/30      - Developer: Asd-g
      - The "scenelumathresh" parameter was renamed to "luma_thresh" and it's default value is now 10.0
+
                              - Set MT mode: [[MT_NICE_FILTER]].
      - The "conservativemask" parameter was renamed to "conservative_mask".<br>
+
                              - Added support for 8..16-bit clips.
  Version 1.1
+
                              - Added support for other chroma subsampling than 4:2:0.
      - Corrected several bad assumptions about pitch and no longer requests frames out of range which makes it compatible with avisynth 2.5.7.
+
                              - If the dimensions of the image aren't divisible by blockx and blocky,
      - Uses the whole image and not just the upper half to determine if there is too much motion, this reduces artifacts greatly in certain clips but the  
+
                                the right and/or bottom edges will be copied instead not processed.
        scenelumathresh argument now has to be twice as big as in previous versions for the same effect.
+
                              - Added Linux building option.<br>
      - Processes the image borders properly instead of just ignoring them.
+
2.0          2013/11/09      - Developer: dubhater
      - Can look two frames in either direction instead of just one frame in both. This makes it possible to remove rainbows in frames right before and after scenechanges.
+
                              - This version now works by processing blocks rather than whole frames.  
 +
                                Static rainbows can now be processed even if there's lots of motion  
 +
                                in other parts of the image.
 +
                              - The "scenelumathresh" parameter was renamed to "luma_thresh" and its
 +
                                default value is now 10.0
 +
                              - The "conservativemask" parameter was renamed to "conservative_mask".<br>
 +
v1.1         2007/03/04      - Developer: Myrsoik
 +
                              - Corrected several bad assumptions about pitch and no longer requests  
 +
                                frames out of range which makes it compatible with avisynth 2.5.7.
 +
                              - Uses the whole image and not just the upper half to determine if there
 +
                                is too much motion, this reduces artifacts greatly in certain clips but  
 +
                                the scenelumathresh argument now has to be twice as big as in previous  
 +
                                versions for the same effect.
 +
                              - Processes the image borders properly instead of just ignoring them.
 +
                              - Can look two frames in either direction instead of just one frame in both.  
 +
                                This makes it possible to remove rainbows in frames right before and after  
 +
                                scenechanges.
 
<br>
 
<br>
== Links ==
+
== Archived Downloads ==
*[http://forum.doom9.org/showthread.php?t=169758 Doom9 Forum] - Discussion about Bifrost v2.0
+
{| class="wikitable" border="1"; width="500px"
*[http://github.com/dubhater/vapoursynth-bifrost/releases GitHub] - Source code repository
+
|-
 +
!!width="100px"| Version
 +
!!width="150px"| Download
 +
!!width="150px"| Mirror
 +
|-
 +
!v2.0 (x86/x64)
 +
|[https://www.dropbox.com/s/z2fbmi0fhvr8c8y/bifrost-v2.0.7z?dl=1 bifrost-v2.0.7z]
 +
|[https://forum.doom9.org/attachment.php?attachmentid=14792&d=1431713088 bifrost-v2.0.7z]
 +
|-
 +
!v1.1
 +
|[http://ivtc.org/avisynth/bifrost-1.1.zip bifrost-1.1.zip]
 +
|[https://web.archive.org/web/20171111144115/http://ivtc.org/avisynth/bifrost-1.1.zip bifrost-1.1.zip]
 +
|}
 +
* x86/x64 version compiled with  Microsoft Visual Studio C++ 2013 by [https://forum.doom9.org/showthread.php?p=1721946#post1721946 l33tmeatwad].
 +
 
 
<br>
 
<br>
 +
 +
==External Links ==
 +
*[https://forum.doom9.org/showthread.php?t=169758 Doom9 Forum] - Bifrost v2.0 discussion.
 +
*[https://github.com/Asd-g/AviSynth-bifrost GitHub] - Source code repository (AviSynth)
 +
*[https://github.com/dubhater/vapoursynth-bifrost/ GitHub] - Source code repository (VapourSynth)
 +
<br>
 +
 
==Bifrost v1.1==
 
==Bifrost v1.1==
 
[[Bifrost v1.1]] documentation.
 
[[Bifrost v1.1]] documentation.

Latest revision as of 19:40, 30 April 2021

Abstract
Author Myrsloik, dubhater, Asd-g
Version v2.1.0
Download bifrost-2.1.0.7z
Category Rainbow & Dot Crawl Removal
License Open Source
Discussion Doom9 Thread

Contents

[edit] Description

Bifrost is a temporal derainbowing filter created by Fredrik Mellbin.
The original Bifrost v1.1 worked on the whole frame or not at all. This version now works on blocks, making it possible to process static rainbows even if there is lots of motion in other parts of the image.

[edit] Requirements


*** vcredist_x86.exe is required for Bifrost-x86
*** vcredist_x64.exe is required for Bifrost-x64


[edit] Syntax and Parameters

Bifrost (clip, clip "altclip", float "luma_thresh", int "variation", bool "conservative_mask", bool "interlaced", int "blockx", int "blocky")


clip   =
A clip to process. It must be in YUV 8..16-bit planar format and must have at least three planes.


clip  altclip =
Bifrost will copy from this clip the chroma of the blocks it can't process. This allows moving blocks to be processed with some other filter.
altclip must have the same format, dimensions, and length as the input clip.


float  luma_thresh = 10.0
Blocks where the luma changes less than this are considered static and may be processed.


int  variation = 5
Controls how big a chroma change must be in order to be considered a rainbow. Increasing this can reduce false positives.


bool  conservative_mask = false
If true, only pixels detected as rainbows will be processed. Otherwise, pixels that have rainbows above and below them will also be processed.


bool  interlaced = true
If true, SeparateFields and Weave will be invoked in order to process the top and bottom fields separately.


int  blockx = 4
int  blocky = 4
The dimensions of the horizontal and vertical blocks. Smaller is probably better. The default 4×4 should be good enough.


[edit] Types of Rainbows

When dealing with telecined material you must determine if the rainbows were added before or after the telecine process. Find a scene with clearly visible rainbows and use the following:

 MPEG2Source("YourSource.d2v")
 SeparateFields()
 SelectEven()

If the rainbows change every frame, they were added after telecine. If there is a duplicate every five frames, they were added before.

[edit] Rainbows added after telecine

In this case, Bifrost should be used in interlaced mode, right after the source filter:

MPEG2Source("rainbows2.d2v")
Bifrost(interlaced=true)
# IVTC here


[edit] Rainbows added before telecine

First you must fix the telecine, then use Bifrost in progressive mode:

MPEG2Source("rainbows1.d2v")
TFM(order=1)
TDecimate()
Bifrost(interlaced=false)


[edit] Changelog

Version      Date            Changes
2.1.0 2021/04/30 - Developer: Asd-g - Set MT mode: MT_NICE_FILTER. - Added support for 8..16-bit clips. - Added support for other chroma subsampling than 4:2:0. - If the dimensions of the image aren't divisible by blockx and blocky, the right and/or bottom edges will be copied instead not processed. - Added Linux building option.
2.0 2013/11/09 - Developer: dubhater - This version now works by processing blocks rather than whole frames. Static rainbows can now be processed even if there's lots of motion in other parts of the image. - The "scenelumathresh" parameter was renamed to "luma_thresh" and its default value is now 10.0 - The "conservativemask" parameter was renamed to "conservative_mask".
v1.1 2007/03/04 - Developer: Myrsoik - Corrected several bad assumptions about pitch and no longer requests frames out of range which makes it compatible with avisynth 2.5.7. - Uses the whole image and not just the upper half to determine if there is too much motion, this reduces artifacts greatly in certain clips but the scenelumathresh argument now has to be twice as big as in previous versions for the same effect. - Processes the image borders properly instead of just ignoring them. - Can look two frames in either direction instead of just one frame in both. This makes it possible to remove rainbows in frames right before and after scenechanges.


[edit] Archived Downloads

Version Download Mirror
v2.0 (x86/x64) bifrost-v2.0.7z bifrost-v2.0.7z
v1.1 bifrost-1.1.zip bifrost-1.1.zip
  • x86/x64 version compiled with Microsoft Visual Studio C++ 2013 by l33tmeatwad.


[edit] External Links

  • Doom9 Forum - Bifrost v2.0 discussion.
  • GitHub - Source code repository (AviSynth)
  • GitHub - Source code repository (VapourSynth)


[edit] Bifrost v1.1

Bifrost v1.1 documentation.



Back to External Filters


Personal tools