Log in

View Full Version : Importance of direct mvs: spatial and temporal in CRF


Avenger007
5th March 2008, 06:10
Hi all,

I've compared a few clips in CRF and 2-pass mode (with bitrate values as close as possible) and from the MeGUI output log, I've noticed direct mvs temporal percentage values are noticeably lower in CRF mode than the 2nd pass in 2-pass mode, and of course the spatial percentage is then noticeably higher. The CRF value is usually close to the 1st pass value.

For example, in one clip:
CRF: x264 [info]: direct mvs spatial:87.6% temporal:12.4%
1st pass: x264 [info]: direct mvs spatial:87.9% temporal:12.1%
2nd pass: x264 [info]: direct mvs spatial:66.7% temporal:33.3%

In another clip:
CRF: x264 [info]: direct mvs spatial:99.5% temporal:0.5%
1st pass: x264 [info]: direct mvs spatial:99.5% temporal:0.5%
2nd pass: x264 [info]: direct mvs spatial:87.6% temporal:12.4%

The SSIM difference for the clips i've tested is between 0.0002 to 0.0006, with 2-pass mode having the higher SSIM.

So my question is: do these different direct mvs values in CRF vs 2-pass make a difference in quality?
In particular, are there types of videos that are better suited for 2-pass instead of CRF at similar bitrate, perhaps high motion scenes?

Dark Shikari
5th March 2008, 06:18
You can't compare absolute SSIM difference, since 0.98 is twice as good as 0.96, which is twice as good as 0.92, etc.

Compare (1-oldSSIM) / (1-newSSIM) for % improvement.

The reason the direct modes are slightly different is because in twopass, x264 uses a heuristic (number of skip blocks) to choose the best direct mode, writes the best to the 1pass stats file, and on the second pass uses what the first pass found to be best. CRF uses the same heuristic, but instead says "use the mode that's been most useful in the past few B-frames."

Avenger007
5th March 2008, 06:34
Thanks for the explanation.
So when would the idea of "use the mode that's been most useful in the past few B-frames" cause a poor choice of mode when compared with two pass?

Dark Shikari
5th March 2008, 06:38
Thanks for the explanation.
So when would the idea of "use the mode that's been most useful in the past few B-frames" cause a poor choice of mode when compared with two pass?Well by definition CRF's decision mode is inherently worse, since it can't know what the best mode for the current frame is until after its finished it.

But in practice the difference is usually very small, as you saw.

Avenger007
5th March 2008, 06:48
OK, thanks for clearing that up. :)
I was worried that CRF might not have performed as good as 2-pass with high motion scenes where the background is almost static but the foreground has lots of objects moving.
:thanks: