2011/11/14

DGDecodeのSSE最適化版がでたらしい

DGDecode.dll 1.58 decoding performance - Doom9's Forum
http://hank315.nl/ 最適化DLLの公開先

以前↓でavisynthでのdgmpegdecの速度を調べたのですが、
DGDecode on Avisynthの速度
avisynth.infoさんによるとGroucho2004 氏により最適化されたバージョンが出たらしいとのこと。

ただし3DNowのコードは削除・・・まぁ、今後のCPUでサポートされない奴は仕方がないでしょう。intelコンパイラのせいだそうですし。

24~27%向上ということですが、自分の環境ではどの程度?ということで以前と同じようなことをやってみました。
前と同じように

vsource="D:\hoge.d2v"
PluginDir="dokoka\avisynth\plugins\"
LoadPlugin(PluginDir+"DGDecode.dll")
DGDecode_MPEG2Source(vsource,idct=1~7).trim(5000,9999)
return last

ってなスクリプトを作ってavs2pipemod -benchを使ってX3350@3.2Gとi7-2600K@4.5Gで速度を調査しました。
ソースは地上波のアニメ(1440x1080)です。

Xeon X3350(≒C2Q9450)@3.2GHz+DDR2 800MHz 6GBでの結果

 idct=1
(32-bit MMX)
idct=2
(32-bit SSEMMX)
idct=3
(32-bit SSE2MMX)
idct=4
(64-bit Floating Point)
idct=5
(64-bit IEEE-1180 Reference)
idct=6
(32-bit SSEMMX (Skal))
idct=7
(32-bit Simple MMX (XviD))
DGDecode1.5.8116fps124fps137fps108fps81fps133fps127fps
DGDecode1.5.8_SSE130fps139fps157fps121fps89fps154fps144fps
速度比率113%113%115%112%110%116%113%

i7-2600K@4.5GHz+DDR3 1600MHz 8GBでの結果

 idct=1
(32-bit MMX)
idct=2
(32-bit SSEMMX)
idct=3
(32-bit SSE2MMX)
idct=4
(64-bit Floating Point)
idct=5
(64-bit IEEE-1180 Reference)
idct=6
(32-bit SSEMMX (Skal))
idct=7
(32-bit Simple MMX (XviD))
DGDecode1.5.8194fps202fps241fps192fps150fps234fps212fps
DGDecode1.5.8_SSE222fps234fps277fps215fps165fps279fps243fps
速度比率115%116%115%112%110%119%115%

10~19%速度が向上しています。
コンパイラの最適化すげぇ。
まぁ、その分危険性もはらんでいますが・・・。

PhenomII X3 720BE(定格=2.8GHz 3Core) + DDR2 800MHz 8GBでの結果

 idct=1
(32-bit MMX)
idct=2
(32-bit SSEMMX)
idct=3
(32-bit SSE2MMX)
idct=4
(64-bit Floating Point)
idct=5
(64-bit IEEE-1180 Reference)
idct=6
(32-bit SSEMMX (Skal))
idct=7
(32-bit Simple MMX (XviD))
DGDecode1.5.886fps89fps101fps72fps69fps104fps96fps
DGDecode1.5.8_SSE94fps98fps112fps78fps75fps117fps105fps
速度比率109%110%111%108%108%112%110%

PhenomIIでは大体10%UPぐらいでしょうか。

次に↓のようなスクリプトでリファレンスを1.5.8オリジナルのidct=5(IEEE-1180 Reference)に取って各idct時のPSNR(dB)を求めてみました。

LoadPlugin(PluginDir+"DGDecode.dll")
LoadPlugin(PluginDir+"DGDecode_old.dll")
ref=DGDecode_old_MPEG2Source(vsource,idct=5).trim(5000,9999)
target=DGDecode_MPEG2Source(vsource,idct=1).trim(5000,9999)

compare(ref,target,"","1.log")
return last

結果は

 idct=1
(32-bit MMX)
idct=2
(32-bit SSEMMX)
idct=3
(32-bit SSE2MMX)
idct=4
(64-bit Floating Point)
idct=5
(64-bit IEEE-1180 Reference)
idct=6
(32-bit SSEMMX (Skal))
idct=7
(32-bit Simple MMX (XviD))
PSNR Minimum60.720160.720160.720194.1753111.809661.618665.8953
PSNR Average65.708165.708165.7081107.8469111.809665.882470.4569
PSNR Maximum81.459381.459381.4593111.8096111.809681.499589.4543

となり、これは以前と同じような傾向ですね。
リファレンスからの差は
ref=5>4>>7>6≒1=2=3
な感じで、速度と精度の兼ね合いで好きなのを選べばって所で。

最後に念のため1.5.8オリジナルとSSE最適化版で同じidctでの違いを調査。

 idct=1
(32-bit MMX)
idct=2
(32-bit SSEMMX)
idct=3
(32-bit SSE2MMX)
idct=4
(64-bit Floating Point)
idct=5
(64-bit IEEE-1180 Reference)
idct=6
(32-bit SSEMMX (Skal))
idct=7
(32-bit Simple MMX (XviD))
PSNR Minimum111.8096111.8096111.809694.9972111.8096111.8096111.8096
PSNR Average111.8096111.8096111.8096108.3973111.8096111.8096111.8096
PSNR Maximum111.8096111.8096111.8096111.8096111.8096111.8096111.8096
・・・ん?idct=4時がちょっと違う・・・けどまぁ、実使用上は問題なさそうですし良いかな?
というわけで、最適化されて速度が向上したDGDecode、実戦投入してみましょう。


[2011-11-21追記]
~ffmpegsource最速伝説~
・・・ffmepgsourceが速いといううわさを聞き、試してみました。

上記で試したのと同じソースに対し、FFVideoSource("ソース.ts")で試したところ、
X3350@3.2GHzで486fps
i7 2600K@4.5GHzで1060fps
という素敵な速度を叩き出しました。
・・・惜しむらくはtsファイルではフレームアキュレートではないらしく、
•VOB, MPG: Seeking seems to be off by one or two frames now and then
•M2TS, TS: Seeking seems to be off a few frames here and there
とのことで、1フレームずれると大変なことになったりするような編集には向かなさそうです(?)
AVI, MKV, MP4, FLVなら良いらしいのですが。

0 件のコメント:

コメントを投稿