レート歪み最適化(RDO)の量子化(quantization)
Trellis は RDO(Rate Distortion Optimisation、レート歪最適化)だ。これは常にRate Distortionが最適になるような計算をする。特定領域の画質を劣化させて、画質劣化がより目立ちそうな領域へbitを振り向ける。微調整と考えて良い。
--trellis 1はマクロブロックの最終エンコード時のみtrellisを使う。
--trellis 2は全てのモード決定時に使うので、よりbitを節約する事になり、ターゲットbitrateあたりの画質が僅かに向上する。
前提条件としてCABACが必要なので、CAVLCでは使えない。CAVLCを使うには--no-cabacが必要だ。CABACはデフォルトで適用され、CAVLCに対して概ね10%ほどbitrateを節約できるがややデコード負荷が上がる。
* --deadzone-intra/interに優先する。
http://aflux.deltaanime.net/Zero1/MP4/x264.html#analysis
--trellisTrellis is RDO, Rate Distortion Optimisation. It attempts to always make an optimal decision for Rate Distortion, and it lowers quality in some areas which will free up bits that can be used in more noticable areas if it considers the loss to be worth it. Think of it as fine tuning. --trellis 1 enables trellis on the final encode of a Macroblock, whereas --trellis 2 is enabled on all mode decisions, and therefore stands to save more bits which when using a target bitrate can lead to slightly higher quality. It requires CABAC, so it will not work with CAVLC. To use CAVLC instead of CABAC, --no-cabac must be specified. CABAC is enabled by default and gives you approximately 10% bitrate saving over CAVLC, but requires a little more CPU power to decode.
*このオプションを指定すると「量子化の丸め制御を RD が最適になるように MB単位で自動的に決定する」という処理が有効になる。また --deadzone-intra/inter オプションは無視されるようになる。
*--deadzone-intra/inter オプションは、丸め方法を四捨五入と切り捨ての間で 32 段階 (0 を指定すれば四捨五入になり、32 を指定すれば切り捨てになる) で調整するためのもの。
*デコーダには依存しないので、プロファイル/レベルと無関係に何時でも指定することができる。
*問題は単純な丸めオフセットを設定するだけの --deadzone-intra/inter と比べると(*エンコードの*)処理が非常に重くなってしまう事。
・-t CABACのサーチにオプションをつける感じ。
ループフィルタを排除するよりCABACを排除したほうが、実は軽くなる。
だが、画質がh.264規格っぽくなくなる。
逆に、-tオプション加えると、容量辺りの絵が良くなる。 が、エンコもデコードも重くなる。