niiyan's blog

niiyanの個人ブログ。

RemoveDirt 0.5

RemoveDirt 0.5がリリースされました。

今回からRemoveDirt.dll(動的リンク)とRemoveDirtS.dll(静的リンク)の二種類が同梱されています。

まずRemoveDirt.dllを使ってみて(msvcr70.dllが必要)、うまく動かなかったらRemoveDirtS.dllを使うということらしいです。

両方を同時にプラグインディレクトリに入れてはいけないとのこと。

その他のver.0.5での変更点は(たぶん)こんな感じ。

  1. cthreshold(色差用ポストプロセス)の追加。デフォルトはpthreshold。YV12のみ。
  2. AVISource使用時の不具合修正
  3. メモリリークの修正
  4. SSE非搭載CPUへの対応
  5. greyオプションでの不具合修正
  6. oscillation(振幅)のチェックをデフォルトで無効に
  7. ドキュメントの修正

この変更に合わせて、前回の投稿を修正しました。
以下、修正記事です。

書式

RemoveDirt(clip clip, clip neighbour, int dist, int mthreshold,
\ int athreshold, int pthreshold, int cthreshold,
\ int soscillation, int doscillation, int tolerance ,
\ int mode, bool grey, bool debug, int show)

※順番不明

パラメータ

  • [ノイズ検出関連]
    • pthreshold: 輝度ポストプロセスのしきい値(デフォルト50)
    • cthreshold: 色差ポストプロセスのしきい値(デフォルトpthreshold,YV12のみ)
    • soscillation: この値を超えるピクセルを選択し、振幅を計算(デフォルト50)
    • doscillation: 振幅がこの値を超えていたら、ノイズ除去をやめる(デフォルト260)
  • [動き検出関連]
    • mthreshold: 動き検出のしきい値(デフォルト150)
    • athreshold: 適用度のしきい値(デフォルト50)
    • dist: 範囲。1/近傍9pixel,2/近傍25pixel...(デフォルト1)
    • tolerance: 許容度。motionブロックの%がこの値を超えるとノイズ除去なし(デフォルト12)
    • neighbour: 反復処理用比較対象クリップ(デフォルトclip)
  • [ノイズ除去のモード用の変数]
    • mode: 0はシンプルな平均化。1は0と2の中間(実験的)。速さは0>2>1(デフォルト2)
  • [白黒クリップ用]
    • grey:デフォルトはfalse
  • [デバッグ関連]
    • debug: trueでdebugviewユーティリティ用のデバッグ出力(デフォルトfalse)
    • show: 1でノイズ除去済みブロックを、2でノイズ除去されていないブロックを赤く表示。YUY2のみ(デフォルト0)

注意点

Avisynthスレの81さんがまとめておられたのをパク…(略)

  1. RemoveDirtのあとにCropしないこと
  2. Cropするなら"align=true"(AviSynth2.5.3以降)で
  3. 24fpsものはRemoveDirtの前に逆テレシネしておかないとダメ
  4. 他のフィルタはRemoveDirtより後に

RemoveDirt簡易版(関数)

使い勝手が微妙っぽいので(失礼)、デバッグ関係とかのパラメータを省略して関数化してみました。名前に反して、あまりシンプルじゃありません(笑)

neighbour/grey/debug/showを省略(デフォルト値適用)し、mode=2に固定しています。

ちなみにこれも試していませんので・・・(^^;

  • ※前回からの変更点
    • cthresholdを追加(デフォルトはpthreshold)。
    • doscillationのデフォルト値の変更。
    • cthresholdは省略しやすいように一番最後に変更。
  • [書式]
SimpleRemoveDirt(dist, mthreshold, athreshold, pthreshold, soscillation, doscillation, tolerance, cthreshold)
  • [例]
SimpleRemoveDirt(1, 150, 50, 50, 50, 260, 12, 50)
  • [関数]
function SimpleRemoveDirt(clip clip, int "dist", int "mthreshold",
\ int "athreshold", int "pthreshold", int "soscillation",
\ int "doscillation", int "tolerance", int "cthreshold")
{
#//--- デフォルト値の設定 ---//
dist = default(dist, 1)
mthreshold = default(mthreshold, 150)
athreshold = default(athreshold, 50)
pthreshold = default(pthreshold, 50)
soscillation = default(soscillation, 50)
doscillation = default(doscillation, 70)
tolerance = default(tolerance, 12)
cthreshold = default(cthreshold, pthreshold)

#//--- メイン ---//
clip = clip.RemoveDirt(dist=dist, mthreshold=mthreshold,
\ athreshold=athreshold, pthreshold=pthreshold, cthreshold=cthreshold,
\ soscillation=soscillation, doscillation=doscillation,
\ tolerance=tolerance, mode=2, grey=false, debug=false, show=0)
return clip
}