View Full Version : B-frame modes
kotrtim
3rd March 2006, 09:56
Since Direct takes fewer bits, obviously the best mode is whichever allows Direct to be used more often, i.e. when the predicted mv matches the real mv most often.
When there is coherent motion, temporal tends to be the better predictor, since motion may vary more rapidly across space than it does from one frame to the next, and also due to the use of partitions.
But in anime, there is often no real motion, and instead you have objects that sit in one place for 2-3 frames, then move large distances. There, spatial may work better.
Spatial has higher psnr than temporal, and "Sharktooth profile v21"'s HQ mode all uses spatial, so I decided to test b frames mode with a very short clip
Res : 880 x 360
ABR : 256 kbps
No-pskip, ref 5, mixref, trellis 2, B-RDO, subme 6, filter 0,0, bime, b-pyramid, 3-bframes
Decoder : ffdshow, Disable all deblocking
Temporal is obviously bad for static backgroud & slow motion scene, caused some serious blocking, I need more time to test a real life video with fast motion and see how spatial do compared to temporal
Daodan
3rd March 2006, 11:00
In my 2-pass tests I posted in the other thread, direct spatial also resulted in higher SSIM, and after comparing the samples carefully by eye, I only use this mode now. (so I say that it is better than temporal, as you said, especially in static backgrounds (which is the first place that likes to block)).
kotrtim
3rd March 2006, 13:01
When there is coherent motion, temporal tends to be the better predictor, since motion may vary more rapidly across space than it does from one frame to the next, and also due to the use of partitions.
I do have question regarding this statement, akupenguin says temporal will be better than spatial if the motion varies more rapidly, but x264 has adaptive b-frame which will only use b-frame when it is appropriate, P-frames will be used in high motion scenes, so it can be said that b-frames is only used with scene that has static background with slower motion, which means spatial will be always better than temporal if adaptive b-frame is on, is this right?
Sirber
3rd March 2006, 13:11
Your source seems to be a "DVD Screener", which you are not supposed to have.
Rule 6 alert!!!
Sagittaire
3rd March 2006, 14:33
Use DVD sceener for make test here is an useless provocation ... :readrule:
You have a large choice of legal source if you want make test:
http://www.apple.com/trailers/
and quality is by far better for these source than your illegal DVD screener ... :mad:
kotrtim
3rd March 2006, 16:10
ok removed everything:scared:
kotrtim
4th March 2006, 07:49
tried another sample, crf 22, 24, 26
basically only clouds, blue sky and balloons, resolution 640x480
well i prefer spatial, spatial has less blocks, but when i go down to crf 20, 18... things became so tough... really don't know which to pick, both temporal and spatial looked quite the same
tested ABR also, and come out with very odd results
192 kbps (rf=32)
preference : temporal
everything looks so ugly, blocky
no clear winner
But I prefer temporal
256 kbps (rf=29)
preference: temporal
With spatial, the cloud has slightly different color from
the original, temporal is still the winner ....both very blocky
You won't want to see a video like this, impractical
480 kbps (rf=24)
winner:spatial
temporal has a big block in the clouds, very annoying
clear ringing artefacts at the corners
sptial is smooth , slightly blocky on the clouds, but overall,
a clear winner, not so obvious ringing at the corners
768 kbps (rf=21)
winner : temporal
Sharktooth
4th March 2006, 11:49
i generally prefer spatial
Todesengel
5th March 2006, 07:53
i generally prefer spatial
can you make it default?
fakey
5th March 2006, 09:22
aku is fast!
x264 changelog
03/05/06 08:01:58 457 457 pengvado --direct auto ...
03/05/06 07:59:06 456 456 pengvado change default direct mode to spatial ...
kotrtim
5th March 2006, 14:15
the auto mode, finally, that's what I'm waiting for, spatial is better than temporal but not ALL the time, can't wait to see how auto works.. thanks akupenguin
Sirber
5th March 2006, 15:53
Now just need subme7 and it will be an excellent release :D
Caroliano
5th March 2006, 17:21
[Auto mode] works best in 2pass (enable in both passes)
So if I'm using --crf it is not so good? It will be, at least, better than spatial?
I will make some tests. Thanks akupenguin!
EDIT: Megui isn't updated yet.... :(
foxyshadis
5th March 2006, 18:02
Cool, he finished, now to test and see how much slower it is. xD
Caro, you can add --direct auto to the custom command line (leave it as temporal in the main settings). Unfortunately that means people won't be able to use temporal without doing that, but I'm sure it'll be updated soon.
Caroliano
5th March 2006, 19:28
Caro, you can add --direct auto to the custom command line (leave it as temporal in the main settings). Unfortunately that means people won't be able to use temporal without doing that, but I'm sure it'll be updated soon.
I forgot that possibility. :o
akupenguin
5th March 2006, 19:38
So if I'm using --crf it is not so good? It will be, at least, better than spatial?
Auto should never be worse than non-adaptive, but doesn't gain much in 1pass. It doesn't know which mode is better for a given frame until after encoding that frame. If the best choice is constant throughout a scene, that still allows it to pick correctly. But it can do per-frame adaption only in 2pass.
Caroliano
5th March 2006, 20:40
Done some encodes (still many more to do) and my fist impression is: buggy.
I don't know if it is an encoder or decoder error (probably encoder...), but TCPMP (CoreAVC) decoded showing strange artifacts and FFDshow started decoding showing the same artifacts, but crashed with an error. These artifacts are only in some frames, not in all. Neither spatial or temporal mode alone show this artifact.
Sample: http://www.badongo.com/file.php?file=x264+direct+mode+auto+bug+sample__2006-03-05_directmodetest_bug.mkv
EDIT: This was done using CRF mode. I don't tested 2pass yet.
akupenguin
6th March 2006, 04:46
try 458.
Todesengel
6th March 2006, 06:30
try 458.
where can i get your binaries?
foxyshadis
6th March 2006, 06:51
http://x264.nl/ always has the latest, up-to-the-hour revision. (None of the unofficial patches included.)
Sirber
6th March 2006, 13:06
Done some encodes (still many more to do) and my fist impression is: buggy.
EDIT: This was done using CRF mode. I don't tested 2pass yet.I did a 3pass ABR and I had jumping squares in bframes. Trying 458.
Lil' Jer
6th March 2006, 13:42
I did a 3pass ABR and I had jumping squares in bframes. Trying 458.
You wouldn't happen to be using the noise reduction would you? Sounds very similar to a problem I had and turning the noise reduction to 0 fixed it.
kotrtim
6th March 2006, 14:53
Generally it looks like that (for ABR only)
auto will use much more temporal a little bit of spatial, it has the "temporal" feel
auto + b-pyramid use much more spatial a little bit of temporal, it has the "spatial" feel...
haven't look at the 2 pass sample
Sharktooth
6th March 2006, 14:59
pengvado already said --direct auto is best used with 2 passes...
kotrtim
6th March 2006, 15:01
pengvado already said --direct auto is best used with 2 passes...
Ya... That's why I only make a 2-pass table... I try ABR just for fun, I'll look at the 2-pass samples I've encodec if I have the time
IgorC
6th March 2006, 15:05
Kotrtim Can you run SSIM test also, please. I would do it myself but I have no time at all but very interesting in it.
Sirber
6th March 2006, 15:55
You wouldn't happen to be using the noise reduction would you? Sounds very similar to a problem I had and turning the noise reduction to 0 fixed it.no --nr
bond
6th March 2006, 16:08
strange that b-pyramid influences the useage of temporal/spatial that strongly
OvejaNegra
6th March 2006, 16:30
I think this is a very interesting point.
I always compress with constant quantizer (i´m anime encoder) and spatial makes smallers files.
I´m goin to make more tests.
What should i use? temporal or spatial for anime?
i HATE the blocks so i think spatial is a best choice....
any opinion???
Sharktooth
6th March 2006, 16:44
yes, spatial is preferred for anime.
alea35
6th March 2006, 18:50
whats the command to put in a bat file that changes temporal to spatial?
Sirber
6th March 2006, 18:55
whats the command to put in a bat file that changes temporal to spatial?nothing? it's the new default.
kotrtim
7th March 2006, 04:02
Kotrtim Can you run SSIM test also, please. I would do it myself but I have no time at all but very interesting in it.
X264 only come with psnr, I need guides to do ssim, are there any guides?
I found this
http://forum.doom9.org/showthread.php?s=&threadid=61128
Feed the avs script to which program?
Besides, I would like to do eye test also, that's the most important one:)
Lil' Jer
7th March 2006, 04:08
Feed the avs script to which program?
You can just open the script in virtualdub and hit play. When the file is completely played you close virtualdub and you have the files.
kotrtim
7th March 2006, 05:46
Sample 1 : 640x480, clouds, sky, balloons, "dreamworks animation -CG"
Sample 2 : 720x368, city, many cars, switch from B&W to color, "the beginning of the movie - taxi"
http://img86.imageshack.us/img86/1066/directauto6ef.png
http://img332.imageshack.us/img332/4759/directauto27ja.png
I don't know what's wrong, ssim shows ridiculous value for the last one a +11 ??, i double checked yeah, it is a +11..
MeteorRain
7th March 2006, 05:51
whats the command to put in a bat file that changes temporal to spatial?
add "--direct spatial" to force spatial
akupenguin
7th March 2006, 06:28
When you list "auto (no pyramid)", is that compared to spatial with pyramid? That's not a useful score unless you also list spatial without pyramid.
And you're missing a --b-pyramid on the 2nd pass of sample 2.
I don't know what's wrong, ssim shows ridiculous value for the last one a +11 ?? You should first be worried about the SSIM=8.39 ??
kotrtim
7th March 2006, 11:12
Well, I don't know how to use ssim, i just simply play the avs with mpc and a .txt is written.... it says average ssim....i copied the value form there
i just forgot to put in b-pyramid, in sample 2's pass 2 evrything has b-pyramid except the specified one,
I think most of us use b-pyramid, the reason why i include no b-pyramid is to see the distribution of spatial & temporal. Auto wins both spatial & temporal when other variables are made constant
Sharktooth
7th March 2006, 11:52
there's definatly something wrong with SSIM. 8.39 is an impossible low score, unless it's comparing 2 different frames.
IgorC
7th March 2006, 13:28
Hehe. That's why I asked you to do SSIM test.
Possible errores:
1. Decoder with adaptive CPU usage. Try to use Nero decoder with PP0 and not automatic. But CoreAVC decoder should be ok. Just closed all soft (intenet connection also) to not use CPU.
2. Problem with the last b-frame -> trim.
3. Framerate?
Sagittaire
7th March 2006, 14:09
Encoded pixel Ei is not compared with equivalent Source pixel Si -> very bad ssim result. IMO it's simply frame decalage ...
IgorC
7th March 2006, 14:46
There is also a patched by on2 version of SSIM 0.24a. http://multimediacom.free.fr/Download/SSIM.rar
OvejaNegra
7th March 2006, 15:03
THANKS SHARKTOOTH!!!!!
i´ll use spatial now for my anime!!
Happy to see you!!
Get well soon!!
Sorry for my ***** english :-)
kotrtim
7th March 2006, 16:10
the total frames is the same,
I use directshowsource (....mp4)
it won't work, it says length does not match
so i mux the mp4 into avi with avc2avi and then compare, it works, but it gives me ssim average that is slightly different even with the same file..... this is a really flawed ssim test..Oh, ffdshow is used..disabled skip deblocking
well, my computer plays avc with dropped frame.....disabling internet is not gonna help...just not fast enough, the best player on my cpu 1.4 GHz is TCPMP
IgorC
7th March 2006, 16:13
Lenght can be same with wrong order of frame.
Try different trim:
1. Cut 1st frame of original
2. Cut last frame of original
3. Cut 1st frame of ref.
4. Cut last frame of ref.
foxyshadis
7th March 2006, 16:34
Try also stackhorizontal or stackvertical so you can plainly see whether they're in sync, and if not how. (Best done through vdub or frame-by-frame watching.)
JimiK
7th March 2006, 16:40
Avi can't handle b-frames without decoder lag. So the frames of your encode should be shifted against the original. Your PSNR seems be ok nonetheless. Maybe some internal workaround.
Wilbert
7th March 2006, 22:57
There is also a patched by on2 version of SSIM 0.24a.
1) Who made this patch?
2) Where is the source?
IgorC
8th March 2006, 00:12
1) Who made this patch?
2) Where is the source?
1&2 : It was already discused in this forum. Search button, please. :)
Wilbert
8th March 2006, 00:29
1&2 : It was already discused in this forum. Search button, please.
I can't find it.
If you are refering to this thread: http://forum.doom9.org/showthread.php?t=92532&highlight=ssim. I'm not able to access that ftp link.
Sirber
8th March 2006, 00:42
from my tests, it seems temporal does a better job than spatial at low bitrate (318kbps, 640x480).
Sharktooth
8th March 2006, 00:43
wilbert, 2nd post of this thread :)
http://forum.doom9.org/showthread.php?p=795863#post795863
Sirber
8th March 2006, 00:51
from my tests, it seems temporal does a better job than spatial at low bitrate (318kbps, 640x480).I will reencode with temporal to confirm this. Gonna take 5 hours :)
Sirber
8th March 2006, 01:01
Seems blended scene changes are blury. Maybe spatial and bpyramid don't go along well.
Sirber
8th March 2006, 01:06
http://img228.imageshack.us/img228/6232/snapshot200603071904165ow.jpg
This shot is in a blended scene change:
Image --> dark --> new imaeg
Wilbert
8th March 2006, 11:36
wilbert, 2nd post of this thread
http://forum.doom9.org/showthread.ph...863#post795863
Yes, i know. But, it doesn't contain the source.
Caroliano
10th March 2006, 00:14
try 458.I'm only posting to confirm that this solved my bug, because I'm busy and can't finish the comparision right now.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.