第一のパラメータは AlphaC0 (default: 0)。これはH.264のイン-ループ・デブロッキング・フィルタの閾値。
まず、このパラメータの値に従ってデブロックを使うか否かを決める。次に、このパラメータはフィルタを適用するエッジ部分の差の閾値に影響する。プラスの値にする事でブロックノイズが減るが、スミアが増える。
第二のパラメータはBeta (default: 0)。これはディテイルの閾値に影響する。
非常にディテイルの細かいブロックにはフィルタを掛けない。というのはこのフィルタが使うスムージングはブロックノイズよりも目立つからだ。
このフィルタはデフォルト値でほとんど常に最良の結果になるので、そのまま弄らないか微調整にとどめるのがベストだ。しかし素材になんとかしたいほどのブロックノイズやノイズがあるなら、少し強めにしても良いだろう。
*スミア:絵をこすったような滲み。細かいディテイルが潰れる。
インループ・デブロッキングのオフ。-f, --deblockの項参照。
http://aflux.deltaanime.net/Zero1/MP4/x264.html#frame-type-options
--nf
Usage: --nf (default=on)
Disables inloop deblocking. Read --filter below for more information
デブロックフィルタ使ってると、細部が潰れるので気になるときがある。
そういう時は、コレ使ってデブロックフィルタ切ったほうがいいかもしれない。
通常、インループ・デブロッキングは圧縮効率、ひいては画質の向上になる。効果が気に入らない時は単に値を下げると良い。このオプションのねらいは、Xvidのハイモーション箇所で見られたようなブロックノイズのスムーシングだ。AlphaC0 は強度、Betaは閾値。デフォルトの0:0は最適値として考えられたものだが、Sharktoothによればアニメは3:3が良いとの事。短いクリップをいくつか用意して実験すると良いだろう。
*参考:まるも製作所さんの日記『07/07/31(火) H.264/AVC のデブロックフィルタ詳細』
http://aflux.deltaanime.net/Zero1/MP4/x264.html#frame-type-options
--filter
Usage: --filter <alpha:beta> (default=0:0) [-6:-6 - 6:6]
The inloop deblocking usually improves compressability and therefore quality. If you do not like the effect simply turn it down. What it tends to do is smooth an image as opposed to letting it block in high motion areas like you may have seen in XviD. The AlphaC0 parameter controls the strength, and Beta controls the threshold. The default value of 0:0 is thought to be optimal, although Sharktooth has suggested to me that anime would look good at 3:3. Experiment on short varied clips and see what works for you.
このトピックはやや議論のあるところだと思います。
H.264規格の定義するデブロッキング手段は、各I-ブロックのQPに応じてプリセットした強度と閾値を使うシンプルなものです。デフォルトでは、QPの高いブロックは強く、低いブロックは全くデブロックしません。H.264規格が定めたプリセット強度は良くできており、どんな素材でも良いPSNRが出る確率が高いです。deblockオプションは、このプリセットの閾値をイジるものです。
多くの人がデブロック強度を大幅に下げるのが良いと考えているようです(-3とか)。しかしこれは全くと言ってよいほど良い考えではありません。多くの場合、デフォルトでの動作原理を解っていないように見えます。
第一に、そして最も重要な事は、デフォルトの閾値はほとんどの場合で最適なPSNRになると言う事です。最適にならないレアケースでも、望ましい調整範囲は +-1。これを超えてデブロッキング・パラメータを弄ると、先ず確実にPSNRが下がります。高くするとディテイルにスミアノイズ(擦ったような汚れ)が増え、弱めればブロックノイズが目に見えるようになります。
ディテイルやノイズが少ない(空間軸の複雑さが少ない)素材の場合デブロックの閾値を下げるのは確実にマズいです。むしろこうした素材ではデブロック・フィルタは非常に巧くアーティファクトを封じ込めます。 空間軸の複雑さが多い素材でも、アーティファクトはあまり目立ちません。これはリンギングノイズはディテイルやノイズに見える傾向がある為です。人間の視覚はディテイルが無くなる事には敏感ですが、間違ったノイズが描き出されても簡単には気が付きません。これは「画質」という点ではノイズとディテイルにはなにがしかの互換性があると言う事です。デブロック強度を下げるとリンギング・アーティファクトが増える傾向がありますが、人間の目はこれを「ディテイル」と誤認して気が付きません。
しかし、これもデブロック強度を弱める理由にはなりません。一般的にもっと良いノイズがポストプロセスで得られるからです。もし出力結果にブラーやスミアが多かったら、MPlayerの再生で'-vf noise' を使って見て下さい。-vf noise=8a:4aで一般的でマイルドなアーティファクトは封じ込められます。デブロッキングフィルタをあれこれ弄るよりキレイに見える事はほぼ確実だと思います。
This topic is going to be a bit controversial.
H.264 defines a simple deblocking procedure on I-blocks that uses pre-set strengths and thresholds depending on the QP of the block in question. By default, high QP blocks are filtered heavily, and low QP blocks are not deblocked at all. The pre-set strengths defined by the standard are well-chosen and the odds are very good that they are PSNR-optimal for whatever video you are trying to encode. The deblock allow you to specify offsets to the preset deblocking thresholds.
Many people seem to think it is a good idea to lower the deblocking filter strength by large amounts (say, -3). This is however almost never a good idea, and in most cases, people who are doing this do not understand very well how deblocking works by default.
The first and most important thing to know about the in-loop deblocking filter is that the default thresholds are almost always PSNR-optimal. In the rare cases that they are not optimal, the ideal offset is plus or minus 1. Adjusting deblocking parameters by a larger amount is almost guaranteed to hurt PSNR. Strengthening the filter will smear more details; weakening the filter will increase the appearance of blockiness.
It is definitely a bad idea to lower the deblocking thresholds if your source is mainly low in spacial complexity (i.e., not a lot of detail or noise). The in-loop filter does a rather excellent job of concealing the artifacts that occur. If the source is high in spacial complexity, however, artifacts are less noticeable. This is because the ringing tends to look like detail or noise. Human visual perception easily notices when detail is removed, but it does not so easily notice when the noise is wrongly represented. When it comes to subjective quality, noise and detail are somewhat interchangeable. By lowering the deblocking filter strength, you are most likely increasing error by adding ringing artifacts, but the eye does not notice because it confuses the artifacts with detail.
This still does not justify lowering the deblocking filter strength, however. You can generally get better quality noise from postprocessing. If your H.264 encodes look too blurry or smeared, try playing with -vf noise when you play your encoded movie. -vf noise=8a:4a should conceal most mild artifacting. It will almost certainly look better than the results you would have gotten just by fiddling with the deblocking filter.
H.264では、かつてH.261で採用されたループ内フィルタ(In-loop Filter)と似たように、ループ内にデブロッキングフィルタ(Deblocking Filter)が設置されている。このフィルタはH.261のようなブロック全体の平滑化フィルタではなく、整数変換のブロック境界のみを平滑化してブロックノイズの発生を抑制するものである。(H.261のループ内フィルタは、MPEG2以降では半画素精度動き補償が採用されたために、数学上同等の役割を果たすループ内フィルタはその意味を失った。)
デブロッキングフィルタは圧縮率向上のためには効果的であるが処理量が大きいために、そのON/OFFがヘッダによって指定可能とされている。したがって、処理量に懸念がある場合にはデブロッキングフィルタを使用しないといった選択肢も可能である。
Wikipedia