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.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 ASP

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th August 2018, 01:01   #1  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Q-pel, GMC, and full quality first-passes

In an attempt to see if Q-pel, GMC, and VHQ wide-area searches were worth using, I ran a bunch of XviD first-passes with different settings and compared the resulting file sizes. XviD first-passes have a constant quantizer (2), so anything that improved compression should have resulted in smaller file sizes. To my surprise, all of the files had the exact same size down to the byte.

This reminded me of the "full quality first pass" option, and the fact that it resulted in larger file sizes despite using the exact same quantizer. And then I remembered that it also resulted in slower encoding times, and something something might not be fully mpeg-4-compliant.

So my question is: Does an XviD first-pass disable all those doodads, regardless of what your actual settings are? And does "full quality first pass" mean "screw that, use the settings that I tell you to use"?
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 30th August 2018, 07:46   #2  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by Katie Boundary View Post
In an attempt to see if Q-pel, GMC, and VHQ wide-area searches were worth using, I ran a bunch of XviD first-passes with different settings and compared the resulting file sizes. XviD first-passes have a constant quantizer (2), so anything that improved compression should have resulted in smaller file sizes. To my surprise, all of the files had the exact same size down to the byte.

This reminded me of the "full quality first pass" option, and the fact that it resulted in larger file sizes despite using the exact same quantizer. And then I remembered that it also resulted in slower encoding times, and something something might not be fully mpeg-4-compliant.

So my question is: Does an XviD first-pass disable all those doodads, regardless of what your actual settings are? And does "full quality first pass" mean "screw that, use the settings that I tell you to use"?
Huh, it feels like ages since I have been using XviD, but as far as I remember:
In a standard 2-pass encode, the first pass disables by default many of the encoder settings which become effective and useful in the 2nd pass only. In particular this applies for VHQ. Also to mention that only the small stats file is produced in pass1 rather than the fully encoded video.
When you select Full Quality First Pass however, all encoder parameters settings are enabled in pass 1 already, making pass 1 much slower with little benefit for the final 2-pass quality. Also, the fully encoded video is kept from pass 1 rather than the stats file only.
As for GMC I think to remember that it has little to nil effect on compressability but increases the encoding time substantially.

Last edited by Sharc; 30th August 2018 at 08:22. Reason: Typos
Sharc is offline   Reply With Quote
Old 30th August 2018, 12:52   #3  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
GMC is still not commonly supported by hardware players. I'd definitely avoid it.
hello_hello is offline   Reply With Quote
Old 30th August 2018, 21:00   #4  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Quote:
Originally Posted by Sharc View Post
Also to mention that only the small stats file is produced in pass1 rather than the fully encoded video.
When you select Full Quality First Pass however, all encoder parameters settings are enabled in pass 1 already, making pass 1 much slower with little benefit for the final 2-pass quality. Also, the fully encoded video is kept from pass 1 rather than the stats file only.
Actually, "discard first pass" and "full quality first pass" are separate settings.

Quote:
Originally Posted by Sharc View Post
As for GMC I think to remember that it has little to nil effect on compressability but increases the encoding time substantially.
I ran a second batch of tests with "full quality first pass" enabled and found that GMC did improve compressibility by a few megabytes. Q-pel, however, wasted more bits than it saved. I'm now running a third set of tests: one-pass, target bitrate eleventy gazillion mbits/sec, railroaded quantizer of 4. So far, it looks like the benefits of GMC are lost at these lower file sizes.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 30th August 2018, 21:01   #5  |  Link
Gser
Registered User
 
Join Date: Apr 2008
Posts: 418
Quote:
Originally Posted by hello_hello View Post
GMC is still not commonly supported by hardware players. I'd definitely avoid it.
For maximum compatibility I would disable Qpel, GMC, limit B-VOP's to 1 consecutive and use a special xvid build that forces no N-VOP's (ESS based players don't like them). And some players also had difficulties with Packed bitstream.

But then again, shooting myself in the face sounds better than returning to the dark ages of MPEG-4 Part 2 Advanced Simple Profile.

I believe it was settled back then that GMC and QPel were fancy techniques that in the end did not do much for compression in the end. I remember playing around with some custom matrixes that helped more than they did but of course custom matrixes WERE NOT supported by all players, goddamn you MPEG-4 Part 2 Advanced Simple Profile.

Last edited by Gser; 30th August 2018 at 21:20.
Gser is offline   Reply With Quote
Old 30th August 2018, 21:13   #6  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Quote:
Originally Posted by Gser View Post
For maximum compatibility I would disable Qpel, GMC, limit B-VOP's to 1 consecutive
I always disable b-frames in my AVI files, partly because getting AVI to support b-frames requires an ugly hack, and partly due to just hating bidirectional encoding as a matter of principle.

EDIT: the results are in. GMC improved compression by 2/3 of 1% when using Wide Area Search, and by a whole 1% when using Mode Decision. Also, with GMC enabled, Wide Area Search provided only 1/3 of 1% better compression than Mode Decision; without it, this jumped to 2/3 of 1%. Overall, Mode Decision without GMC was 98.9% as efficient as Wide Area Search + GMC. Very useful data.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.

Last edited by Katie Boundary; 31st August 2018 at 05:26.
Katie Boundary is offline   Reply With Quote
Old 31st August 2018, 17:16   #7  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by Katie Boundary View Post
I always disable b-frames in my AVI files, partly because getting AVI to support b-frames requires an ugly hack, and partly due to just hating bidirectional encoding as a matter of principle.
It doesn't "require" a hack. I think that's strictly a Video For Windows limitation, where it's always one frame in and one frame out. The hack is "packed bitstream", which you should be able to disable.
Personally I've never had a problem with hardware player compatibility, with or without a packed bitstream.

Bidirectional encoding improves compression efficiency a great deal, although admittedly XVid's B-frames aren't the highest quality. You'd be crazy to disable them for x264 encoding. Almost as crazy as still using Xvid.
hello_hello is offline   Reply With Quote
Old 1st September 2018, 11:34   #8  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by Katie Boundary View Post
...Q-pel, however, wasted more bits than it saved...
The idea behind q-pel is not to save bits but to preserve details better. Hence q-pel tends to increase the bitrate.
Sharc is offline   Reply With Quote
Old 1st September 2018, 22:23   #9  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Quote:
Originally Posted by Sharc View Post
The idea behind q-pel is not to save bits but to preserve details better. Hence q-pel tends to increase the bitrate.
But the quantizer was being railroaded. Q-pel was using more bits to preserve the same level of detail.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 1st September 2018, 23:09   #10  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
Why even bother learning about or using MPEG-4 SP/ASP... It's too old to be useful!
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is online now   Reply With Quote
Old 1st September 2018, 23:59   #11  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by SeeMoreDigital View Post
Why even bother learning about or using MPEG-4 SP/ASP... It's too old to be useful!

You'll find the answer in her signature.
Quote:
Originally Posted by Katie Boundary View Post
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 2nd September 2018, 00:33   #12  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
The simple answer is that if you need to distribute your encodes to lots of different folks with very different playback chains then you need to pick the lowest common denominator. And the formats almost everyone can play on the TV are still DVD (Mpeg2) and DivX/XviD. Many folks own standalone DVD players which play DivX HomeTheater profile (which can be easily mimicked by XviD). And when done right MPEG4-ASP can look very nice at one third of the MPEG2 file size.

And if you feel that MPEG4-ASP is too old to be useful then what do you think about DVD? Even older, but with a huge user base.

Cheers
manolito

Last edited by manolito; 2nd September 2018 at 00:36.
manolito is offline   Reply With Quote
Old 2nd September 2018, 11:06   #13  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by Katie Boundary View Post
But the quantizer was being railroaded. Q-pel was using more bits to preserve the same level of detail.
Quantizer and q-pel are two different biests which may not be played one against the other for quality.
For 1-pass encodes I would leave the quantizer at 2 and allow 1 or 2 B frames if file size reduction matters. You could also play with the matrix and VHQ (1).
As has been mentioned by others to ensure player compatibility you may however align the XviD settings with the DivX standard (I remember the "DivX certified" players).
Sharc is offline   Reply With Quote
Old 2nd September 2018, 20:44   #14  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by Katie Boundary View Post
But the quantizer was being railroaded. Q-pel was using more bits to preserve the same level of detail.
How did you determine "the same level of data"?

https://en.wikipedia.org/wiki/Quarter-pixel_motion
Quarter-pixel motion (also known as Q-pel motion or Qpel motion) refers to using a quarter of the distance between pixels (or luma sample positions) as the motion vector precision for motion estimation and motion compensation in video compression schemes. It is used in many modern video coding formats such as MPEG-4 ASP, H.264/AVC, and HEVC. Though higher precision motion vectors take more bits to encode, they can sometimes result in more efficient compression overall, by increasing the quality of the prediction signal.
hello_hello is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:27.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.