Loren Merritt氏の見解を表にしてみた。
SSIM値 | qp設定値(※) | |
---|---|---|
0.98 以上 | 20 | オリジナルと区別がつかない。 |
0.95 | 30 | 見るに耐えない。(*または辛うじて、そこそこ見られる*) |
0.9 | 40 | 非常に醜い。 |
0.8 | 51 | これ以上は圧縮できない |
0.7以下 | - | 素材に大量のノイズを加え、さらにそのノイズを量子化工程で消し去るほどqpを高くしない限り、達成困難。 |
※おそらく、qpを使った1パスABRと思はれる。
x264 と JM (10.2) の画質を比較する際に、自分は PSNR を使っていた。 自分の理解では、JM は実際の動きやテクスチャのディテイルの再現よりは、PSNRの向上を追求したものに思える。 x264も同じ方向性だろうか? また、画質の定義として、他に産業界で一般的な数値指標はないだろうか?というのは、PSNRはミスリードを起こす事があるからだ。なにかヒントか、コメントが欲しい。 |
While comparing x264 with JM (10.2) I had been using PSNR for comparing the qualities of the two encoders. I understand JM is an encoder designed to achieve better PSNR rather than track true motion, or increase texture detail. I was wondering if x264 was based on a similar theory? Also, what other metrics are usually being used in the industry to define video quality, since PSNR can be misleading at times. Any pointers/comments? Thanks Axel |
x264 はエンコードの SSIM を表示できる。これはより正確とされている: http://en.wikipedia.org/wiki/SSIM SSIM(From Wikipedia, the free encyclopedia) Guillaume -- 喧嘩することの無い人々の協調関係というものは、最大の国家連合からタウンミーティングや教区会に至るまで、これまでに存在した事が無い。 -- トマス・ジェファーソン (MPlayer ML におけるフレーミングについてインタビューを受けた際に) http://www.brainyquote.com/quotes/quotes/t/thomasjeff157207.html |
x264 can give the SSIM of the encode, which is supposed to be less missleading: http://en.wikipedia.org/wiki/SSIM Guillaume -- An association of men who will not quarrel with one another is a thing which has never yet existed, from the greatest confederacy of nations down to a town meeting or a vestry. -- Thomas Jefferson (when interviewed about MPlayer ML flamewars) http://www.brainyquote.com/quotes/quotes/t/thomasjeff157207.html |
こ んにちは Axel。 Guilliame が書いた通り、x264は SSIM と PSNRを算出できる。 ほとんどの場合、私はSSIMを使う事を奨める。SSIM は非常に良い指標だ。 そしておそらく、PSNRよりも早く、かつ正確なものとしては唯一だ。 単に非常に良い指標では満足できず、天下無双の指標を求めているならば、そしてまた各種指標の比較を知りたいならば、VQEG FR-TV Phase I および Phase II リポートが役立つかも知れない: http://www.its.bldrdoc.gov/vqeg/projects/frtv_phaseI/COM-80E_final_report.pdf上記のテストでは、最強の画質指標は NTIA (ANSI T1.801.03-2003, ITU BT.1683)だ。SSIM はほぼこれに対等。面白い事に、おおくの有名な指標、例えば JND (Tektronix/Sarnoff)や、DVQ (Watson/NASA) 、そして PDM(EPFL) などは、どれもY-PSNRだけを使った場合とほぼ同等か、より悪い(!)。 PSNRについて: シーンカットの無いシークエンスを、同じアルゴリズム(*この場合ほぼコデックと同義か*)で、設定を変えてエンコードした場合、視覚的にはPSNRの しかしながら、PSNRにはいくつか欠点がある。 1)PSNRの値そのものにはなんの意味も無い。例えば、PSNRが40のエンコード結果とオリジナル素材が二組あった場合、片方が素材同等に見える一方 で、もう片方は汚いアーティファクトが出ている、といった事があり得る。これは素材の長さとアルゴリズムのタイプに依存する。これは、大きな違いのあるア ルゴリズムを比べる際には、PSNRは使えないという事だ。また、PSNRを元にシーンカットを跨がるbit配分を行うのは無意味という事でもある。 2)本質的には目に見える事の無いアーティファクトの中に、PSNRに大きく影響するものがある(例えば、Y軸を均等にスケーリングしたり、各ピクセルに 少量のガウシアンノイズを加えてみて欲しい)。その一方で、PSNRに非常に低い影響しか持たないが、非常に目に留まり易いアーティファクトというものも ある(例えばブロッキング)。 SSIMはこれらの問題を、相当程度に緩和する。SSIMは動画/静止画の画質指標としては*ベストではない*が、 高速に算出できるものとしてはベストだ。SSIMの絶対値比較は妥当と言える。非常におおまかなガイドとしては、0.7以下は見るに耐えない。(*または 辛うじて、そこそこ見られる*)。0.8-0.85は多少の目に見える映像の歪みが出るが、大方の人にとってはOK。0.9以上はオリジナルと区別がつか ない。 注意して欲しいのは、x264のSSIMは"ほんとうの"SSIMアルゴリズムのあるべき姿とは別の方式で算出されている事だ。windowingも、 luma maskingも、motion maskingも無い。算出しているのは、sample of all possible positionsだけだ。しかしながら、多くの場合、"ほんとうのSSIM"の数パーセントは表している。そして概ね100倍くらいは早く算出できる。 ここで"多くの場合"とは、普通の長さ(*natural footage*)という意味だ。 可能性としては(*不詳*) があり得る。 しかしそうしたケースに遭遇する事は極めて稀だろう。もし本当のSSIMが欲しければ、私にそういうコードを書くように五月蝿く騒ぎ立ててくれ。;) |
Hello Axel, As Guilliame wrote, x264 can calculate SSIM as well as PSNR. I recommend using that for most work. SSIM is a very good metric, and probably the only one that is both fast and better than PSNR. If you are looking for the absolute best metric as opposed to a merely very good metric, and also for how to compare metrics, you may wish to read the VQEG FR-TV Phase I and Phase II reports: http://www.its.bldrdoc.gov/vqeg/projects/frtv_phaseI/COM-80E_final_report.pdf In those tests, the best metric is NTIA (ANSI T1.801.03-2003, ITU BT.1683). SSIM also does quite well. Interestingly, many well-known metrics such as JND (Tektronix/Sarnoff), DVQ (Watson/NASA) and PDM (EPFL) are either about the same, or worse than, using just Y-PSNR (!). About PSNR: if you encode the same continuous (no scenecuts) sequence with the same algorithm with several different settings, the version with the lower PSNR is almost always visually better. Thus PSNR does a reasonably good job of allowing you to optimise codec parameters that you can vary during an encode (like RDO or rate control). However, PSNR fails on several counts: 1) The absolute value of PSNR means nothing. In other words, looking at two pairs of original/encoded images both with PSNR of 40 (for example), one pair may look identical and the other may have gross artifacts. It all depends on the source footage and on the type of algorithm. This means that PSNR is useless for comparing significantly different algorithms. It also means that using PSNR to allocate bits accross scenecuts will result in bad decisions. 2) Some artifacts which are essentially invisible have a huge PSNR impact (try scaling Y uniformly or adding a small amount of gaussian noise to each pixel for example). Other things which are extremely visible have an unreasonably low PSNR impact (like blocking). SSIM fixes these problems to a significant degree. It is not *the best* video/image quality metric, but it is the best that can be computed quickly. SSIM absolute values can be reasonably compared: as a very rough guide, below 0.7 is barely watchable, 0.8-0.85 has some visible distortion but ok for most people, and 0.9 and higher are indistinguishable from the original. Please note that SSIM in x264 is not calculated the way that the "real" SSIM algorithm (and papers) say it should be. There is no windowing, no luma masking, no motion masking, and only a sample of all possible positions are calculated. However, it is within few percent of the "real" SSIM in most cases, while being about a hundred times faster to calculate. "Most cases" here pretty much means any natural footage; it may be possible to construct synthetic footage so as to defeat the approximations used, but you are extremely unlikely to ever encounter such. If you want real SSIM, bug me to release my code for that ;) Regards, --Alex |
PSNRについて:^^^^^ 高い程、 PSNRはエンコードの過程で変化するコデックのパラメータ(RDOやレートコントロール)を最適化す る上では まぁまぁ役に立つ。本当に?自分の意見では、 SSIM=0.98+ (qp=20) はオリジナルと区別がつかない。 SSIM=0.95 (qp=30) は見るに耐えない。(*または辛うじて、そこそこ見られる*) SSIM=0.9 (qp=40) は非常に醜い。 そしてこれ以上は圧縮できないレベル (qp=51) ですら SSIM=0.8となる。 手許では、素材に大量のノイズを付け加え、そのノイズを量子化工程で消し去るほどqpを高くしない限り、SSIMが0.7 以下となる映像は生成出来ていない。 PSNRでもSSIMでも、指標の絶対値は、圧縮後のストリームにどれだけのqualityが残っているかを示すというよりは、素材にあるノイズの量を示 すものだ。 しかしながらおそらく、同じノイズを持っていると想定される場合、映画の中の異なった場面を比較する上ではSSIMの方が上だろう。 --Loren Merritt |
On Thu, 30 Nov 2006, Alex Izvorski wrote: About PSNR: if you encode the same continuous (no scenecuts) sequence^^^^^ higher reasonably good job of allowing you to optimise codec parameters that Really? imo, SSIM=0.98+ (qp=20) is indistinguishable from the original, SSIM=0.95 (qp=30) is barely watchable, SSIM=0.9 (qp=40) is really ugly, and there could be nothing left of the content (qp=51) and still produce SSIM=0.8. I failed to generate any videos with SSIM<0.7 except by adding tons of noise to the source and then setting qp high enough that all the noise is quantized away. With both PSNR and SSIM, the absolute value of the metric is more a measure of how much noise was in the source than it is of how much quality is left in the compressed stream. Though perhaps SSIM does better at comparing difference scenes within one movie, when they can be assumed to have the same noise. --Loren Merritt |
x264 のモード決定や動き予測の過程でSSIMを使う方法はある? |
Is there a way of using SSIM in the mode decision and ME process of x264? Thanks, Gene |
x264 の土台部分には無い。しかし、 http://akuvian.org/src/x264/x264_ssim_map.00.diff このパッチの名前からすると、smthがなんかしてるんぢゃないかと思う。 Guillaume -- 喧嘩することの無い人々の協調関係というものは、最大の国家連合からタウンミーティングや教区会に至るまで、これまでに存在した事が無い。 -- トマス・ジェファーソン (MPlayer ML におけるフレーミングについてインタビューを受けた際に) http://www.brainyquote.com/quotes/quotes/t/thomasjeff157207.html |
Not natively with vanilla x264, but the name of this patch http://akuvian.org/src/x264/x264_ssim_map.00.diff makes me think that smth is in the works. Guillaume -- An association of men who will not quarrel with one another is a thing which has never yet existed, from the greatest confederacy of nations down to a town meeting or a vestry. -- Thomas Jefferson (when interviewed about MPlayer ML flamewars) http://www.brainyquote.com/quotes/quotes/t/thomasjeff157207.html |