Log in

View Full Version : Compressibilty issue (with Test Results)


Razorholt
28th March 2008, 05:02
Hello Folks -

I recently took a challenge of encoding at 550kbps - for video only - with a "decent" quality. I'm testing different settings in MeGUI (x264 codec) and I wanted to know whether Avisynth filters could help.

Here is my current Avisynth code:
QTinput("C:\Videos\trailers\wanted-tlr1_1080p.mov",quality=100)
ConvertToYV12()
Tweak(sat=0.6)
denoised = FluxSmoothT(3)
grainoptimizer(denoised,minrep=1,tdist=2)
Spline36Resize(528,352)



The MeGUI cmd line:
--pass 2 --bitrate 550 --stats ".stats" --keyint 14 --min-keyint 2 --ref 8
--mixed-refs --no-fast-pskip --bframes 16 --b-pyramid --b-rdo --bime --weightb
--direct auto --subme 6 --trellis 2 --analyse p8x8,b8x8,i4x4,i8x8 --8x8dct
--vbv-maxrate 2000 --qcomp 1.0 --me esa --merange 24 --threads auto --thread-input
--progress --no-dct-decimate --output "output" "input" --me-prepass



------------------------------------------------------------
TEST RESULTS (March 29, 2008)
------------------------------------------------------------


1.- x264 settings

--crf 24.0 --keyint 14 --min-keyint 2 --ref 3 --mixed-refs --no-fast-pskip --bframes 16
--b-pyramid --b-rdo --bime --weightb --direct auto --filter -1,-1 --subme 6 --trellis 2
--analyse p8x8,b8x8,i4x4,i8x8 --8x8dct --vbv-maxrate 2000 --qcomp 1.0 --me esa
--merange 24 --threads auto --thread-input --progress --no-dct-decimate
--output "output" "input" --aq-strength 0.3 --aq-sensitivity 11 --me-prepass

rev. 772 + VAQ 0.46


2.- Avisynth Filters settings

DCTFilter
DCTFilter(1,1,1,1,1,.5,.5,0)

Tweak
Tweak(sat=0.8)

FFT3DFilter
FFT3DFilter(sigma=5, plane=3, bw=32, bh=32, bt=5, ow=16, oh=16)

HybridFuPP
HybridFuPP(512, 352,preset="Very High",Resizer=0,E_Str_X=36,E_Str_Y=36,S_Str=5,M_Str=120,E_thr=10)

DftTest
dfttest(sigma=1.7, tbsize=3)


3.- Results - Single Filters

Filter Resizer Size (KB) FPS SSIM PSNR kb/s SSIM Imp. Compress.
---------------------------------------------------------------------------------------------------------

No Filter Spline36 331,776 15.23 0.9859190 44.355 313.04 100.00 % 100.00 %
DCTFilter Spline36 315,392 15.06 0.9869261 44.770 295.11 100.10 % 94.27 %
Tweak Spline36 315,392 13.32 0.9859019 44.545 294.3 100.00 % 94.01 %
FFT3DFilter Spline36 307,200 8.95 0.9858811 44.767 288.46 100.00 % 92.15 %
HybridFuPP Bilinear 290,816 10.26 0.9869287 44.736 274.07 100.10 % 87.55 %
DftTest Spline36 282,624 2.31 0.9901516 45.68 263.28 100.43 % 84.10 %


http://70.86.69.186/~matrix2/jpeg2TEST_512-base.bmphttp://70.86.69.186/~matrix2/jpeg2TEST_512-base_2.bmp
No Filter

http://70.86.69.186/~matrix2/jpeg2TEST_512-DCTFilter1.bmphttp://70.86.69.186/~matrix2/jpeg2TEST_512-DCTFilter1_2.bmp
DCTFilter

http://70.86.69.186/~matrix2/jpeg2TEST_512-Tweak2.bmphttp://70.86.69.186/~matrix2/jpeg2TEST_512-Tweak2_2.bmp
Tweak

http://70.86.69.186/~matrix2/jpeg2TEST_512-FFT3DFilter1.bmphttp://70.86.69.186/~matrix2/jpeg2TEST_512-FFT3DFilter1_2.bmp
FFT3DFilter

http://70.86.69.186/~matrix2/jpeg2TEST_512-HybridFuPP1.bmphttp://70.86.69.186/~matrix2/jpeg2TEST_512-HybridFuPP1_2.bmp
HybridFuPP

http://70.86.69.186/~matrix2/jpeg2TEST_512-dfttest1.bmphttp://70.86.69.186/~matrix2/jpeg2TEST_512-dfttest1_2.bmp
DftTest


3.- Results - Combined Filters


Coming soon

fibbingbear
28th March 2008, 16:42
This is going to be very, very dependent on your source material.

In general, though, I imagine aggressive denoising will be your friend for decent quality at low bitrates.

Razorholt
28th March 2008, 22:07
This is going to be very, very dependent on your source material.

In general, though, I imagine aggressive denoising will be your friend for decent quality at low bitrates.

I tried FFT3dGPU/FFT3dfilter but I wasn't very happy with it. Maybe you have a settings suggestion? I also tried DCTFilter(1,1,1,1,1,0.75,0.25,0) which is giving me a great compressibility but... quality wise... As the source will mostly be HD I don't think there will be enough "food" for a denoiser.

Thanks,
- Dan

fibbingbear
28th March 2008, 22:47
I usually use FFT3DFilter, so sorry, can't give much other advice :-/ I've heard good things about DFFTest.

Someone else on the forum may be able to give more advice on this topic.

Edit: in case your wondering, I use bt=5, plane=4, and a high sigma with FFT3DFilter if I really want to compress something... it's slow and has its limits.

Razorholt
28th March 2008, 23:15
I usually use FFT3DFilter, so sorry, can't give much other advice :-/ I've heard good things about DFFTest.

Someone else on the forum may be able to give more advice on this topic.

Edit: in case your wondering, I use bt=5, plane=4, and a high sigma with FFT3DFilter if I really want to compress something... it's slow and has its limits.

Thanks fibbingbear, I'll try your FFT3DFilter settings. I'm also looking at dfttest :)

Comatose
29th March 2008, 00:01
So, this is a trailer. Is it public? Can I get it somewhere?

Also, fft3dfilter and dfttest are more quality centered. They're meant to denoise with a minimal impact on detail. Past a certain point they will just make your video look bad.

What you need are filters that have a subtle effect but significantly increase compressibility.

I've found that using a blurry resizer like BilinearResize helps a lot in bitrate required. Same for Blur. You may also want to try MSmooth, which will let you easily select sharp edges and smooth just them. (or you can use Blur and a denoiser with masktools to achieve this)

I recommend saving PNGs to calculate the % of compressibility gain you achieved. You should compare each filter's effect on video quality to the percentage and try to use the ones with the least effect on video quality and the highest compressibility gains.

Also, be wary of diminishing returns. Some filters, which can be very effective at first, will continue to make your video look worse at the same rate as you make their settings more harsh, but compressibility won't increase as much.
Find the optimal settings for each of the filters you use.

Razorholt
29th March 2008, 02:00
Thanks for the suggestion. I will do just that and communicate the results in this thread. As the content will be given to me in FCP HD format I picked a trailer from http://www.apple.com/trailers/ in order to run the first tests.

thetoof
29th March 2008, 06:43
Avisynth script
mpeg2source("Honor pulldown VTS_01_1.d2v")
tfm(d2v="Honor pulldown VTS_01_1.d2v", mode=0, slow=2)
tdecimate()
dfttest(sigma=8,smode=0,sbsize=5,tbsize=5)
crop(8,4,-8,-12)

MeGUI settings (x264)
--pass 2 --bitrate 180 --stats ".stats" --keyint 999 --min-keyint 12 --ref 16 --mixed-refs --no-fast-pskip --bframes 16 --b-pyramid --b-rdo --bime --weightb --direct auto --subme 7 --trellis 2 --partitions all --8x8dct --qpmin 1 --qpstep 51 --ratetol 5.0 --b-bias 50 --me esa --merange 64 --threads auto --thread-input --zones 0,1322,b=0.1/178792,186628,b=0.1 --cqmfile "C:Matrices\M4G LRM V4.cfg" --progress --no-psnr --no-ssim --output "output" "input"

2:09:43 movie = 169 MB (video stream only)
ABR = 180kbps
Credits Bitrate = 18 kbps (not recommended... I should have used weight=0.4 or something like that instead of 0.1)

It took me about 23 hours to encode 186628 frames (everything included)

and this is what it looks like (Image loaded in vdubmod with ffmpegsource)
http://img216.imageshack.us/img216/2442/highcompressionhu2.th.jpg (http://img216.imageshack.us/my.php?image=highcompressionhu2.jpg)

If I was to do something like that again, I'd add FFT3DFilter(sigma=5, plane=3, bw=32, bh=32, bt=5, ow=16, oh=16) right after dfttest to help compression (you can use an even higher value of sigma... it will wash out the colours, so ajust according to your source). I use sigma=40 to create a reference clip for TemporalDegrain and it doesn't generate any artifacts.

Feel free to ask any question you want ;)

TSchniede
29th March 2008, 14:21
i usually use degrainmedian(limity=5,limituv=5,mode=3) to get rid of some spots and then mvdegrain from mvtools. It is the better alternative to most temporal filters as it doesn't enhance non-moving grain in moving scenes. It essentially merges each frame with its motion compensated temporal neighbors. Warning: it is daaaamn slow! For convenience I use this function:


#reqires recent mvtools
#LoadPlugin("mvtools.dll")
# the various options expose those of mvtools
# tr - temporal radius (decide which version of mvdegrain should be used)
function MVD(clip source, int "block", int "ol", bool "tm", int "sh", int "ts", int "mdct", int "tr", int "pelf",clip "pelc"){
block = default(block,8)
ol = default(ol, block/2)
tm = default(tm,true)
sh = default(sh, 2)
ts = default(ts,320)
mdct= default(mdct,0)
tr= default(tr,2)
pelf= default(pelf,2)

pelc= pelf > 1 ? default(pelc,source.LanczosResize(width(source)*pelf,height(source)*pelf,src_left=0.25, src_top=0.25)) : pelc

backward_vec3 = source.MVAnalyse(isb = true, blksize=block, truemotion=tm, delta = 3, pel = pelf, overlap=ol, pelclip = pelc, dct=mdct)
backward_vec2 = source.MVAnalyse(isb = true, blksize=block, truemotion=tm, delta = 2, pel = pelf, overlap=ol, pelclip = pelc, dct=mdct)
backward_vec1 = source.MVAnalyse(isb = true, blksize=block, truemotion=tm, delta = 1, pel = pelf, overlap=ol, pelclip = pelc, dct=mdct)
forward_vec1 = source.MVAnalyse(isb = false, blksize=block, truemotion=tm, delta = 1, pel = pelf, overlap=ol, pelclip = pelc, dct=mdct)
forward_vec2 = source.MVAnalyse(isb = false, blksize=block, truemotion=tm, delta = 2, pel = pelf, overlap=ol, pelclip = pelc, dct=mdct)
forward_vec3 = source.MVAnalyse(isb = false, blksize=block, truemotion=tm, delta = 3, pel = pelf, overlap=ol, pelclip = pelc, dct=mdct)

return (tr == 2) ? source.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2, pelclip = pelc,thSAD=ts) :
\ (tr > 2) ? source.MVDegrain3(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3, pelclip = pelc,thSAD=ts) :
\ source.MVDegrain1(backward_vec1,forward_vec1, pelclip = pelc,thSAD=ts)
}


by the way, I usually don't have HD content, so degrainmedian is perhaps not needed here, or something with a greater radius is better like removegrainHD.

TSchniede
29th March 2008, 14:43
If you essentially want to do:

HDclip.reduceby2().mvdegrain(pel=2)

You can do HDclip.mvdegrain(pel=1).reduceby2() which is more accurate.
Using strong denoisers on the source before shrinking might help but is slow.

The best solution depend on the available time and preferred outcome.

Razorholt
29th March 2008, 15:41
Great! Adding you guys suggestions to my tests. Results coming up soon...

Razorholt
30th March 2008, 05:59
First post updated with test results. I didn't include the MVD function because the FPS couldn't go higher than 0.09.


Thanks,
- Dan

thetoof
30th March 2008, 07:40
I recommend that you look closely at my meGUI settings... especially the part where I use the LRM matrix (http://forum.doom9.org/showthread.php?p=887125#post887125).

Razorholt
30th March 2008, 08:00
I recommend that you look closely at my meGUI settings... especially the part where I use the LRM matrix (http://forum.doom9.org/showthread.php?p=887125#post887125).

Tried it but VAQ + LRM is a bad combinaison. It's ugly :(

hkazemi
31st March 2008, 08:43
Others have performed similar comparisons in the past on different source materials. The compressibility rankings of the denoisers you used seems fairly consistent with past results. If you're interested in seeing past results, you can find summaries and links to the threads here:

Consolidated list of denoisers and denoiser comparisons
http://forum.doom9.org/showthread.php?t=135027

Piper
31st March 2008, 16:29
@Razorholt: I'm surprised you've not tried or listed mc_spuds (http://forum.doom9.org/showthread.php?t=131279&highlight=mc_spuds) in your comparison.

Razorholt
31st March 2008, 17:05
Others have performed similar comparisons in the past on different source materials. The compressibility rankings of the denoisers you used seems fairly consistent with past results. If you're interested in seeing past results, you can find summaries and links to the threads here:

Consolidated list of denoisers and denoiser comparisons
http://forum.doom9.org/showthread.php?t=135027

I'm well aware of that denoisers list. What I'm trying to do here is to take into consideration other filters/scripts that can help in reducing files sizes (i.e. Bilinear, Tweak, etc...).

Thanks for your input tho. :)

tetsuo55
7th April 2008, 13:55
This is very interesting.

I am looking for a (combination) of filters that can safely and universally be applied to any source. This filters only purpose is to prepare the source for better compression using x264.

My goal is visually transparent transcoding with the lowest possible bitrate, too bad there is no reliable benchmark for that

thetoof
7th April 2008, 15:27
that can safely and universally be applied to any source.
Eh... every source has its own issues, so nothing can be applied to everything... There may be some filters that can help in most cases, but not all of them.

tetsuo55
7th April 2008, 15:30
With "help" i don't mean PQ but compressability only.

My theory is that for example noise reduction of 1 % will always remove 1% of the noise and make the source *% more compressible no matter how good or bad the source is, being 1% a good quality source should not visually suffer from the deniosing.

Or am i completely wrong here?

thetoof
7th April 2008, 15:52
Well... I guess so, but being able to know the exact strenght of the filter, the exact blocksize and overlap, the noise pattern (if you use the sigma2/3/4 settings of fft3d) and all the other parameters that reduce x% of the noise of the source is... well... hard.

afaik, noise reduction is calculated in strenght (which vary depending on the filter and the other settings of every filter), not in percentage. Example: dfttest(sigma=7,smode=0,sbsize=5,tbsize=5) could remove 100% of the noise of a source, 10% of another and the other would look like crap because it was overdenoised.

So, even for compression efficiency, it depends.

tetsuo55
7th April 2008, 15:58
Hmm what about a script or program that scans the file, determins noise level with a similar system to the current deniosers and then suggests a relatively safe denoising setting (preferably for a denoiser using the same algorythm)

thetoof
7th April 2008, 19:47
Heh, I don't have the skills to do that... If anyone out there wants to try... have fun, but the old "tweak and compare" method is perfectly fine imo ;)

rkalwaitis
14th November 2008, 16:27
Here is a good little denoiser that I picked up somewhere. I think from Didee's words of wisdom.

a= last
b=a.yourfavoritedenoiser()
SeeSaw(a,b, NRlimit=3, NRlimit2=4, Sstr=1.5, Slimit=5, Spower=5, Sdamplo=6, Szp=16)

Here is the one I use a lot.

a = last
b = a.SPresso(limit=8, limitC=8, bias=100, biasC=100, RGmode=1, RGmodeC=17)
SeeSaw(a, b, NRlimit=2, NRlimit2=1, Sstr=1.4, Slimit=7, Spower=2, Sdamplo=8, SdampHi=10, Szp=10, bias=1, sootheT=30)




http://forum.doom9.org/showthread.php?p=867316#post867316 (Spresso)

Requirements for SeeSaw are below. http://forum.doom9.org/showthread.php?t=104701&highlight=seesaw

http://home.arcor.de/kassandro/Remov...emoveGrain.rar

http://manao4.free.fr/MaskTools-v1.5.8.zip

http://home.arcor.de/dhanselmann/_st...2006.01.02.rar