Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
22nd June 2004, 03:44 | #1 | Link |
Registered User
Join Date: Mar 2004
Location: Zinzinnati
Posts: 294
|
Xvid BVOP test
Thanks to Teeg's prompting, I did some testing on various "extreme" B frame settings. The results were stunning. I think we may have uncovered a flaw in Xvid's B frame decision. Here are the results:
Code:
Coors Lite NFL[Xvid 1.0.1 Q5 28-1-0-0-BVOP].avi 21,770 KB Coors Lite NFL[Xvid 1.0.1 Q5 2-1-0-0-BVOP].avi 21,770 KB Coors Lite NFL[Xvid 1.0.1 Q5 2-1-0-80-BVOP].avi 22,262 KB Coors Lite NFL[Xvid 1.0.1 Q5 28-1-0-80-BVOP].avi 22,734 KB Coors Lite NFL[Xvid 1.0.1 Q5 noBVOP].avi 21,550 KB Coors Lite NFL[Xvid 1.0.1 Q2 28-1-0-80-BVOP noGMC].avi 56,324 KB Coors Lite NFL[Xvid 1.0.1 Q2 28-1-0-80-BVOP noGMC noAQ].avi 57,530 KB Coors Lite NFL[Xvid 1.0.1 Q2 28-1-0-80-BVOP].avi 56,274 KB Coors Lite NFL[Xvid 1.0.1 Q2 noBVOP].avi 53,100 KB While I was trying to make sense of this I started thinking about the clip itself and then realized something. There is only one type of motion that B frames can take advantage of. B frames won't help u on any kind of pans, zooms, rotations, or other small motions. B frames can only bi-predict motion on translational motion within the frame, something this clip contained very little of. It was a typical beer commercial, lots of fast pans and cuts, babe, beer, field, babe, beer, crowd, beer, etc. So I think what we can take away from this is that the utility of B frames is highly source dependant. I'll be doing some more tests to see how it reacts to other motion types. But the million dollar question for now is how can the mere presence of B frames result in a higher file size? LA edit: B frames can take advantage of pans.
__________________
Anata wa baka da! REPENT! Last edited by lordadmira; 1st July 2004 at 01:15. |
22nd June 2004, 05:04 | #2 | Link |
Registered User
Join Date: Jun 2003
Posts: 331
|
First thing the quant ratio you have used is 1 which means that the bframes will have the same quantizier as all the pframes it refers to.
This has caused the larger filesizes as the bframes are going to take up just as much space as the pframes (and you have more motion vectors with bframes). bframes can be quantisied more becuase they use bidirectional motion prediction, which means that less intra blocks have to be coded to construct an entire frame when compared to a pframe. If your going to do tests on fixed quants then I suggest that you use the default settings for bframes.(Which are 2,1.50,1.0) You can use 1.0 quant ratio but dont expect the video stream to be smaller but the quality of the video stream (psnr) should be improved over not using bframes.
__________________
HQ XviD Music Video Forum When I'm good I'm very, very good but when I'm bad I'm better. |
22nd June 2004, 05:09 | #3 | Link |
Registered User
Join Date: Jun 2003
Posts: 331
|
you can analyse the video streams you encode with this little app which is quite useful for looking at quant distribution.
http://www.geocities.com/analyzerdrf/index.html
__________________
HQ XviD Music Video Forum When I'm good I'm very, very good but when I'm bad I'm better. |
22nd June 2004, 06:00 | #4 | Link | |
easily bamboozled user
Join Date: Sep 2002
Location: Atlanta
Posts: 373
|
Quote:
They come in handy I believe when there's very little motion or noise, so the predicted residual can be quantized more without it hurting the resulting picture too much. |
|
22nd June 2004, 06:29 | #5 | Link | ||
Moderator, Ex(viD)-Mascot
Join Date: Oct 2001
Posts: 2,564
|
Re: Xvid BVOP test
Hi, lordadmira,
thanks for conducting that test, good work! Quote:
Quote:
__________________
It's a man's life in Doom9's 52nd MPEG division. "The cat sat on the mat." ATM I'm thoroughly enjoying the Banshee - a fantastic music player/ripper for Linux. Give it a whirl! Last edited by Teegedeck; 22nd June 2004 at 06:37. |
||
22nd June 2004, 06:41 | #6 | Link |
Registered User
Join Date: Mar 2004
Location: Zinzinnati
Posts: 294
|
I was making my statements based on motion compensation. For my claims to be true the savings from motion compensation have to be greater than other considerations. This clip didn't contain much motion that B frames could exploit but the codec put them in anyway. So let's call it an opportunity for advancement. A VHQ-like mode that tests for BVOP friendly motion types. If this kind of algorithm decided on when to put in a B frame I think quality would increase for all encodes. Now we have to do a "visual inspection" to see if full quality BVOPs will be of any use for a particular encode. We'll know for sure when I do the same tests on another clip with more translational motions.
__________________
Anata wa baka da! REPENT! |
22nd June 2004, 17:41 | #7 | Link |
Registered User
Join Date: Jun 2003
Posts: 331
|
erm why have you changed the name of the thread it was call "Xvid BVOP failure"
As to pretz its not source dependant if your comparing encodes of the same sequence one with bframes and one without. The one without should have more intrablocks. please run you tests with the default bframe settings and then you will see why its the default setting
__________________
HQ XviD Music Video Forum When I'm good I'm very, very good but when I'm bad I'm better. Last edited by chilledoutuk; 22nd June 2004 at 17:46. |
22nd June 2004, 18:00 | #8 | Link |
Moderator, Ex(viD)-Mascot
Join Date: Oct 2001
Posts: 2,564
|
I guess he did it because there is no failure. XviD's b-frames, I dare say, work fine.
If XviD's b-frames don't do something that no developer ever claimed they would do - i. e. being smaller than p-frames at the same quant - then this isn't a shortcoming. If anyone has his/her own ideas about what XviD's b-frames should do, please cite a reference (like MPEG documents) where it says they should do just that. That would be helpful and give an incentive to change something. Otherwise - well; not.
__________________
It's a man's life in Doom9's 52nd MPEG division. "The cat sat on the mat." ATM I'm thoroughly enjoying the Banshee - a fantastic music player/ripper for Linux. Give it a whirl! |
28th June 2004, 13:26 | #10 | Link |
Registered User
Join Date: Mar 2004
Location: Zinzinnati
Posts: 294
|
VHQ 4 Blows Away BVOPs
I did another no BVOP vs. full qual BVOP head to head matchup. And this time using one of my beloved Inuyasha eps as the subject. All settings the same as the first test. It wasn't even close, it was a complete rout. As RadicalEd has pointed out, the benefits and power of VHQ 4 are so dominating that no BVOP setting can make up for their loss. Having a B frame means no VHQ and therefore worse motion compensation. Not even the bi-predicted ME can give as good a result as VHQ on the P frames. The B/P frame ratio was about 2 to 1. The results:
Code:
Inuyasha - Kikyo and the Dark Priestess[Q4 28.1.0.30 BVOP].avi 162,114 KB Inuyasha - Kikyo and the Dark Priestess[Q4 noBVOP].avi 131,742 KB On another note this points out just how darn good Xvid's VHQ mode really is. LA
__________________
Anata wa baka da! REPENT! Last edited by lordadmira; 1st July 2004 at 01:12. |
28th June 2004, 13:39 | #11 | Link |
Registered User
Join Date: Mar 2002
Posts: 863
|
The main reason of the size increment is not the VHQ search. Simply the p-frames are getting bigger because they are farther from each other thus they have to compensate more motion. Usually the more quantized b-frames can offset this behavior, but if they have the same quant, they cannot anymore.
Last edited by Tommy Carrot; 28th June 2004 at 13:41. |
28th June 2004, 13:53 | #12 | Link | |
gone
Join Date: Apr 2004
Posts: 1,706
|
Re: VHQ 4 Blows Away BVOPs
Quote:
or, do a test with b-frames/no b-frames without VHQ. if your test shows a smaller filesize with your b-frame settings then there still is hope what all of this means quality wise, is another discussion of course. Last edited by stephanV; 28th June 2004 at 13:57. |
|
28th June 2004, 14:11 | #13 | Link | |
Registered User
Join Date: Mar 2004
Location: Zinzinnati
Posts: 294
|
Re: Re: VHQ 4 Blows Away BVOPs
Quote:
I'm doing another encode with VHQ off and the same BVOP settings. Ed has indicated that high B frame usage gave size savings with no VHQ.
__________________
Anata wa baka da! REPENT! |
|
28th June 2004, 14:26 | #14 | Link | ||
gone
Join Date: Apr 2004
Posts: 1,706
|
Re: Re: Re: VHQ 4 Blows Away BVOPs
Quote:
of course, but that does not mean that every setting that can be used makes sense. That b-frames can have any quant does not mean that they should be used in this way. Quote:
|
||
28th June 2004, 15:22 | #15 | Link | |
Registered User
Join Date: Mar 2004
Location: Zinzinnati
Posts: 294
|
Quote:
LA
__________________
Anata wa baka da! REPENT! |
|
28th June 2004, 15:41 | #16 | Link | |
Registered User
Join Date: Jun 2002
Location: Adelaide, Australia
Posts: 1,167
|
Quote:
|
|
28th June 2004, 15:58 | #17 | Link | ||
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
OUCH!
Quote:
you have a big talent in mixing up things - are you working as a barman? Your conclusion is mostly right. But your "correction" of Tommy Carrot is just ridiculous! The farther away P-frames are, the more the frames between them change, simply because there are more frames between them in which motion occurs. Shortly: the farther away, the more motion *has* happend that must be compensated. Just as Tommy said, period. But then, your conclusion is not too way off. Since much more motion has to be compensated, the ME will fail to compensate sufficiently for some moving blocks, giving either a suboptimal and therefore more expensive compensation, or even trigger an intra block instead of a compensated one. But that's only a small part of the story. XviD will still compensate more motion still quite good, I assume. The problem simply is: when more motion must be compensated, this means that the actual motion vectors will become *longer*. And the longer a motion vector is, the more bits it will need to get stored in the bitstream. *That* is a big point why P-frames are getting larger with increasing distance. Therefore, a good balanced algorithm has to do its magic, to balance out the gain of putting B-frames with the loss of longer vectors & less optimal matchings on ME. And the sweetspot is - in the range of #B-VOPS = 1|2 & sensitivity around zero. The sweetspot definetly is NOT at #B-VOPS = 28 & overdriven sensibility. Please consider the PM, too. - Didée
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
||
28th June 2004, 16:17 | #18 | Link |
Registered User
Join Date: Mar 2004
Location: Zinzinnati
Posts: 294
|
Maybe we are thinking of two different things by the words "motion compensation" (i.e. ME, motion estimation). When I say motion compensation, and compensated blocks, I'm talking about a macroblock that has been predicted into a following frame. Frame n+1 has taken the macroblock from frame n and therefore doesn't have to code for it. There is just the motion vector. The farther away the P frames are the more blocks have to be intra-coded, the less blocks can be compensated for by motion compensation, prediction; because, the block has to exist in both P frames to be handled by motion compensation. Greater distance -> fewer common blocks -> less motion compensation -> more intra-blocks. The motion distance is trivial since even a full length vector can be encoded in just a few bits.
I think both of u are saying compensation when u really mean full block coding. I'm not a mad scientist u know. I take my ideas from the Mpeg spec and H264 especially. Maybe I'm too enthusiastic? %-) LA
__________________
Anata wa baka da! REPENT! |
28th June 2004, 16:59 | #19 | Link | |
Registered User
Join Date: Jun 2002
Location: Adelaide, Australia
Posts: 1,167
|
Quote:
You kinda forgot about all the possibilities in the middle (motion+texture), which are definitely most common. [edit]In particular, "the block has to exist in both P frames to be handled by motion compensation" is false. A "good" (sane) codec will only compensate of block is good enough, but in theory, it's always possible to compensate from anything. For example, b-frames don't have intra blocks at all, and all blocks are always motion-compensated. Last edited by sysKin; 28th June 2004 at 17:06. |
|
28th June 2004, 17:16 | #20 | Link |
Registered User
Join Date: Mar 2004
Location: Zinzinnati
Posts: 294
|
A B frame can have no intra-blocks? Are u sure about that, I find that surprising. Can u expound some more on ur use of the word "texture"? Are u talking about some kind of diff or deformation that's done on blocks after they're taken from their source frame? But atleast u accepted my basic explanation as correct.
__________________
Anata wa baka da! REPENT! |
|
|