View Full Version : B-frames
Turbonutter
24th June 2003, 18:19
Hey there.
I was doing some encoding tests on The Final Flight of the Osiris (The Animatrix chapter 1), using the following settings:
6 - Ultra High
H.263
VHQ 2
300
1
qpel and chroma motion
2
150
100
100
The interesting thing was, I found the quality to be better (more detail, less macroblocks) when I had b-frames disabled than when I didn't - bitrate 864kbps (but using 2-pass int). Is there something I'm not getting here? I thought B-frames were supposed to improve quality.
Anyway, I'm going to try a section of High Fidelity later to see if I get the same results, but can I ask other people's experiences with b-frames?
OUTPinged_
24th June 2003, 18:45
Try with 1 b-frame.
Gaia
24th June 2003, 19:15
Qpel for animation is useless.
Change your b-frame settings to 150,100,0. B-frames improve quality a lot but i don't have any exeperience encoding animation. B-frames and animation migh be totally different thing. I don't have any experience encoding animation.
bond
24th June 2003, 19:15
what xvid build did you use?
try 2b-frames with threshold 0
Koepi
24th June 2003, 19:54
I set offset to 75 in the meantime btw., it seems to give even better results and restores the possibility to compress huge 1st passes higher.
For example, with 2/150/100/0 you can compress from 900mb 1st pass to 600mb 2nd pass, with 2/150/75/0 you can do 1100mb to 600mb with acceptable quality. (Ok, depends on the source, but just an observation i made.)
Regards
Koepi
entropy
24th June 2003, 19:55
Originally posted by Turbonutter
Hey there.
I was doing some encoding tests on The Final Flight of the Osiris (The Animatrix chapter 1), using the following settings:
6 - Ultra High
H.263
VHQ 2
300
1
qpel and chroma motion
2
150
100
100
The interesting thing was, I found the quality to be better (more detail, less macroblocks) when I had b-frames disabled than when I didn't - bitrate 864kbps (but using 2-pass int). Is there something I'm not getting here? I thought B-frames were supposed to improve quality.
Anyway, I'm going to try a section of High Fidelity later to see if I get the same results, but can I ask other people's experiences with b-frames?
I found the same result. I think it looks better without b-frames, but the size does go up.
Prettz
24th June 2003, 20:57
Originally posted by Gaia
Qpel for animation is useless.
I could beg to differ. Some anime looks so similar to live action (with the ultra-detailed backgrounds, CG special effects, and lighting effects and such applied to the cel animations) that the rules for normal movies apply rather than those for animation.
Turbonutter
24th June 2003, 23:34
Heh yes, anime like Ghost in the Shell is more than animation - which is what I encode.
OT; Anyway, Final Flight is actually a Final Fantasy style CGI movie, very detailed and also has lots of motion in places. I find it quite easy to use as a comparison as the original is a perfect reproduction, it doens't contain artefacts and annoyances while keeping many of the qualities of actual film. Incidentally The Spirits Within would be much better for this, but I don't have that DVD.
Anyway, back to B-frames. I understand that on a pure quality basis B-frames probably are very good, but I'm more interested in qualty for a given filesize, DVD-backup style. I think under these circumstances, quality degrades with B-frames, right?
Incidentally, comparing two rips of the 10 minute Final Flight compressed to 58mb, both with B-frames, setting threshold to 100 is undoubtly better quality than 0.
OT: As for qpel with animation, well, I have to encode some Family Guy episodes tomorrow, so I'll do a comparison of qpel vs. no qpel on that. I'll also encode a segment of Ghost in the Shell under the same conditions and post the results in a new thread, in the interests of knowledge.
EDIT: XviD build is Koepi 14052003-1
Gaia
25th June 2003, 00:01
Anyway, back to B-frames. I understand that on a pure quality basis B-frames probably are very good, but I'm more interested in qualty for a given filesize, DVD-backup style. I think under these circumstances, quality degrades with B-frames, right?
I don't understand what you mean but in my own encodes(full movie dvd sources) b-frames don't decrease quality. They improve it a lot...
Turbonutter
25th June 2003, 00:13
Well.. in my experience, quality degrades, but we'll see tomorrow. I'm going to do a straight comparison of -1/ and 2/150/100/100 on High Fidelity (614mb), and see what happens - I'll happily eat my words if the quality is better!
Maybe it depends on the movie?
Nibor
25th June 2003, 08:25
Why do you use such a outdated build like this :p ;)
IMHO Koepi's 24062003-1 build with B-frames settings 2/150/75/0 gives great results for me! In a given filesize (and 2 pass of course) b-Frames increases quality, but maybe it really depends on the movie... Or it's just a matter of taste!
Never did an anime encode, will start with Princess Mononoke :)
Ok, just my 2 cents...
symonjfox
25th June 2003, 12:09
Hey guys, maybe you don't know exactly what Animatrix is.
The final flight of osiris is NOT an anime, it's a 3D graphic cartoon. It's very detailed and there's a lot of motion, effects and detail in it. IMHO Qpel can help in this episode (well in other episodies maybe not ... who knows).
Back to topic:
I had a long discussion in other threads about B frames in High Quality encodes. Well me too I though that a very high bitrate movie without Bframes should look better. Instead, B frames are very useful. Maybe you should try 2/100/100/0 setting. Doing so, the B frame will have the same quantizer of a P frame that would be insered there, but B frame can refer to previous or next frame, so quality can be higher at same filespace.
Bframes in low bitrate encodings is a MUST!
sysKin
25th June 2003, 12:24
Originally posted by Turbonutter
Well.. in my experience, quality degrades, but we'll see tomorrow. I'm going to do a straight comparison of -1/ and 2/150/100/100 on High Fidelity (614mb), and see what happens - I'll happily eat my words if the quality is better! OF COURSE it will be worse with crazy settings like threshold 100. Why won't you try default first? 100 is a huge value (and I'm talking about the old build), and yes, it will look worse.
Turbonutter
25th June 2003, 17:52
Phft thresholds of 100 are recommended, and a threshold of 100 definitely looks better than threshold 0.
Anyway, the recent encode without B-frames also looks better, but I will disregard this in view of the threshold argument.
I use this build because it comes with gknot - iirc from visiting Koepi's website it's the latest development build, no?
Anyway, I'll dig out The Fifth Element and do some 10-minute 720 encodes after Family Guy (probably Friday) and settle this...
I'll be using the above settings, including qpel, if anyone wants to suggest some B-frames settings to use (and if someone can suggest a decent way of comparing qualities (http://forum.doom9.org/showthread.php?s=&threadid=56329), I'll let you know how it goes.
Nibor
25th June 2003, 18:10
Originally posted by Turbonutter
I use this build because it comes with gknot - iirc from visiting Koepi's website it's the latest development build, no?
No, it isn't! Go check Koepi's Site (http://roeder.goe.net/~koepi/xvid.shtml)..
IMHO Recommended B-frame settings in the newest build are 2/150/75/0
Beam me to the thread (http://forum.doom9.org/showthread.php?s=&threadid=56190) :D
JasonFly
25th June 2003, 20:34
A bframe encode will always lokks worse than a without one.
But using the defaut setting will give good results and the difference will not be much noticeable in playing(In most cases).
But that's true that i noticed some blocks in very fast motion scene in Final FLight of Osiris.(The scene was a fast one and a blue/dark one).
Maybe my bframe treshold was a bit too high(20 with the new build if i remember well)
@ Syskin:
Does the bframe decision take into account motion(I presume it does but what does it looks like)?
sysKin
26th June 2003, 10:24
Originally posted by JasonFly
Does the bframe decision take into account motion(I presume it does but what does it looks like)? No, not motion. It looks like motion, but it's a side-effect, which I'll try to counter soon because panning = lots of motion AND good for bframes.
The bframe decision takes into account the total texture data that needs to be coded after motion compensation. The more new texture -> the sooner we need a pframe, the less new texture -> the more bframes.
Radek
Turbonutter
26th June 2003, 10:29
So what do B-frames actually do? I know they can take data from frames before AND after them, but how does this translate to advantages? Better texture quality?
gldblade
26th June 2003, 17:38
B-frames are more heavily quantized, which means they are smaller than normal P-frames. By taking up less space, more bits are made available to P-frames and I-frames, translating to higher overall quality.
Turbonutter
28th June 2003, 21:35
Okay, well in the absence of my Animatrix disc, I did some testing on Chapter 7 of The Fifth Element, which I think has to be one of the most varied 7 minutes in any film - you've got nice close ups (lots of lovely skin textures), some really fast motion sequences, and plenty of those all-important smoke effects that codecs seem to hate.
The AVS is 7675 frames @ 25fps, 720x294, encoded using 2-pass int, 31423kb, MSP 6 VHQ 4 H.263 qpel, chroma motion and optimisation. Encoding was circa 10fps on 2075mhz AMD, 333mhz DDR.
Alright, using the new codec and 2/150/75/0, the quality is much, much better, especially on the motion sequences.
http://www.sine-wave.net/stuff/xvid/tfe-5990-non.png
http://www.sine-wave.net/stuff/xvid/tfe-5990-2.150.75.0.png
I know these aren't exactly the same frame but I assure you the quality is representational.
The quality may be slightly higher on the close up shots without B-frames, but I really can't tell.
-1 first size was 139mb
2/150/75/0 first size was 115mb
2/150/100/100 first size was 90mb. The quality of this was crap.
If anyone wants any more testing/screenshots/data done on this sequence I'll keep all the files until tomorrow (Sunday) evening. I'm on 56k so I won't upload anything bigger than about 5mb, so I guess I can up a sequence if you wish.
Incidentally SBC's quality in this particular frame was much, much better, however it did overshoot the filesize by 8.5mb giving it a big advantage, and the general quality throughout the film is worse, with a constant macroblock artefact across all the scenes. I'm a bit worried at how SBC has suddenly decided to overshoot everything. It was four times faster though.
bugsan
29th June 2003, 17:41
why bframes give a lower PSNR ?
a simple subtract(original, encoded)
xvid default+bframe1
ffdshow 030103
http://perso.wanadoo.fr/bugsan/2240.png
http://perso.wanadoo.fr/bugsan/2241.png
http://perso.wanadoo.fr/bugsan/2242.png
http://perso.wanadoo.fr/bugsan/2243.png
http://perso.wanadoo.fr/bugsan/2244.png
Turbonutter
29th June 2003, 17:50
Interesting you should mention PSNRs. I found the encodes without B-frames gave higher PSNRs overall, but I must say the B-frames one did appear visually better.
gldblade
29th June 2003, 19:50
It's important to note that PSNR is not an accurate measure of visual quality. Just because PSNR goes down does not mean that quality goes down.
B-frames have lower PSNR because they are more highly quantized than other frames.
Assault
30th June 2003, 21:56
@ gldblade, Turbonutter
What's even more important: If you use 1-pass quantizer mode your b-frames encode will have a lower PSNR value than your encode without b-frames but what's more important it will also have a lower filesize. That's the reason why in a 2-pass encode PSNR is higher for encodes WITH b-frames than for encodes WITHOUT. (the filesize gain is bigger than the quality loss because of b-frames) ;)
Assault
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.