View Full Version : Isn't it time for a new compression mode in XviD?
squid_80
20th December 2006, 16:25
From memory the rate control plugins do their work when opt=XVID_PLG_BEFORE and xvid_plugin_hvs does its work when opt=XVID_PLG_FRAME. So the order in the plugin array isn't really important.
plugh
20th December 2006, 17:12
Yes, RC does its thing 'before' (and 'after'). I missed the 'frame' bit. Thanks.
Eruendil
14th January 2007, 16:30
Happy new year to this thread ;) !
I just encoded some more movies (after pausing since december) and I have to say that I'm pretty amazed about the quality (and size in relation) of the results... It works fine, not more and not less!
:thanks: again, Kopernikus :D
Finally got around to putting together an xvidvfw.dll with this plugin for experimenting...
Notes:
This is a 'stripped down' version of the plugin, only offering adaptive quant equation (no lambda equation) and no ssim variables. -- I wanted this to work with xvidcore 1.1.2 and lambda access isn't available in that version, and the ssim stuff adds overhead for something I don't use. (Both are trivial to reenable with a couple #define's and a rebuild).
Basically, I hooked it in as a replacement for the lumi-masking plugin. The existing GUI "Adaptive Quantization" checkbox enables it, and by default it will use the "lumi-masking equation" if no other is defined. As this is for experimentation and I was feeling lazy, I didn't muck with the GUI - you must specify your desired AQ eqn via the "XVIDAQ" environment variable.
This also includes my '2nd pass alt' plugin and related changes (see this (http://forum.doom9.org/showthread.php?t=118419) for details). All sources included. See changelog.txt for more info.
EDIT: update below
olnima
2nd May 2007, 10:29
Your link isn't a link :) can You / mods fix that please?
Thanks for your work
Olnima
Your link isn't a link :) can You / mods fix that please?
You are correct - it isn't a link, it's an attachment, which requires mod approval (which has been granted). You just have to give them a little time...
Well, results of my first experiment are disappointing...
I encoded the same clip twice, once with the 'normal' lumi-masking routine, once with the hvs plugin and the lumi-masking equation posted on Kopernikus web-site.
hvs plugin output file was about twice as large.
hmmm. time to start digging...
Well, that was "easy" - the lumi-masking expression on his web-site calculates a scale factor, but doesn't apply it! Small addition to the expression, re-ran the comparison - nearly identical output file sizes. I suspect the slight difference is due to numerical accuracy and rounding variations.
So, new version available. Also did some code clean-up and some enhancements. Attached are two builds:
A 'stripped down' Adaptive Quant only, 1.1.2 compatible build like above, tested against the standard lumi-masking plugin.
A 'full featured' 1.2.x compatible build with AQ and Lambda eqn and ssim variables. Use the "XVIDLMB" environment variable to supply the lambda equation. Note that THIS build is untested as I don't have a 1.2.x baseline to compare against nor any idea what to try for a lambda modulation equation. Also, based upon squid_80's comments earlier in this thread about a missing 'emms', you might need a current cvs build of xvidcore to use the lambda stuff .
Both builds are from the same sources, just differant compile time defines.
Side note:
If your interest is the sources, use this kit rather than the preceding one as I cleaned up the hvs_plugin conditional compilation stuff a bit (now DO_LAMBDA and DO_SSIM are independant of each other). There are also what I believe to be two bug-fixes on the Lambda eqn code path (relevant now since that code is activated in this build). I started with the version of the hvs plugin code used in squid_80's 121306 encraw build, which I think was based upon Kopernikus's 120906 .diff posted earlier in this thread. If either person wants to comment, look for "//del" in the hvs plugin source.
Have fun!
Received a suggestion/request that seemed reasonable, so...
Instead of always using the hvs_plugin, but with a default lumi-masking AQ equation if no other hvs equation is defined, make the default case the standard xvidcore resident lumimasking plugin.
Thus, if you select the vfw GUI "Adaptive Quantization" checkbox with an hvs eqn environment variable defined you get the hvs plugin, otherwise you continue to get the lumimasking plugin you know and love :rolleyes:
I wouldn't normally release an update for something like this (it was just a couple lines of code) but I liked the idea of only activating the hvs plugin if someone took explicit steps to do so (ie defining an environment variable), so here it is. We'll let the download counts determine the 'winner' :) Both flavors (stripped-down 1.1.2 vs full-featured 1.2.x) are in the attachment.
PS - the 'fix' to the lumimasking eqn on Kopernikus web-site was to add "quant *" at the end - ie multiply the computed scale factor times the current quant to get the final quant.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.