Log in

View Full Version : Problems with "Compare" in AVS 2.56b2


LigH
19th March 2005, 13:12
Dear developers,

for comparing different MPEG encoders and different settings (on interlaced material), I use the following script:
LoadPlugin("dgdecode.dll")
LoadPlugin("SSIM.dll")
orig = AviSource("clip.avs",false,"YUY2")
copy = MPEG2Source("clip.d2v",iPP=true).ConvertToYUY2(interlaced=true)
ssim = SSIM(orig.ConvertToYV12(interlaced=true),copy.ConvertToYV12(interlaced=true),"clip.csv","clip.txt",lumimask=true)
comp = Compare(orig,copy,"","clip.log")
diff = Subtract(orig,copy)
comp.Overlay(ssim).Overlay(diff)
This quite complex script allows to output both Compare log and SSIM result with one script (because due to using Overlay, AviSynth cannot short-cut out finally nonvisible clip manipulation branches).

With previous AviSynth versions (up to 2.56b1 2005-01-06), the script starts to create and write the files while being opened in VirtualDubMod, continues to write while "playing" the video, and finishes the files when closing the script as video source (Ctrl+W). And finally, Compare adds some summary like this:
Comparing channel(s) YUV

Mean Max Max
Absolute Mean Pos. Neg.
Frame Dev. Dev. Dev. Dev. PSNR (dB)
-----------------------------------------------------
0 3.0846 -0.0679 37 -29 35.8278
1 2.9880 -0.1292 40 -29 36.1078
...
2198 3.4815 -0.4217 62 -64 33.7323
2199 3.2116 -0.1496 45 -46 34.6600



Total frames processed: 2200

Minimum Average Maximum
Mean Absolute Deviation: 1.0070 2.6552 5.8230
Mean Deviation: -0.5087 -0.1945 +0.0120
PSNR: 29.5126 36.2167 44.7704
Overall PSNR: 35.2352
But since AviSynth 2.56b2 2005-02-21, there are two differences:

1) The Compare log is not finished until I quit VirtualDubMod completely.

2) Compare does not write a summary anymore:
...
2198 3.4815 -0.4217 62 -64 33.7323
2199 3.2116 -0.1496 45 -46 34.6600

BTW: I know that the color space conversions are not optimal, but Compare required RGB or YUY2 / SSIM requires YV12; I'll try to optimize the conversions later...

Manao
19th March 2005, 22:19
First, on the conversion : use CompareYV12. That'll allow you to use instead of overlay one of the masktools' filters with y=u=v=1 ( in order to go faster, because no processing is done then )

Then, the behavior : i guess the script doesn't close properly, since the tail of the log is written in the filter's destructor. What happens if you open another script / video ?

IanB
20th March 2005, 05:56
LigH,

Yes there has been a bug with the filter destructor not being run.

It has been fixed in CVS but not in any released version. If you are desperate for a fast fix grab the CVS avisynth.dll from http://avisynth2.sourceforge.net/15Mar2005backout/avisynth.dll and replace the installed one in your Windows System directory.

IanB

LigH
20th March 2005, 11:20
Fixed in the "Backout"? Fine, I'll try.

And CompareYV12 was new to me; although YV12 is not the native color space of the original material (and not the optimal color space for interlaced video, in my opinion), I'll check that filter, too.

Thank you two so far.

I just do not yet understand how to use MaskTools instead; I never used them before (but read rumours that some functions were not that stable, or require much memory? - Could be misunderstood or outdated indeed.)

Manao
20th March 2005, 11:32
I didn't see you were processing interlaced material. But since one of the clip is YUY2 while the other is YV12, both colorspaces are vlid to make the comparison ( though indeed, YV12 is kinda messy when it comes to interlacing, but it's imho interlacing that is messy ).

> how to use MaskTools instead

Instead of doing comp.overlay(foo), just do comp.yv12logic(foo, y=1, u=1, v=1)

> that some functions were not that stable

One year ago, that was true, now it seems relatively stable. They also had an issue with PIV ht, but that is now solved.

LigH
20th March 2005, 13:03
I cannot find a function named "YV12Logic" in MaskTools.dll; the latest version I found so far - on http://manao4.free.fr/ - is 1.5.6 (2005-01-03). The URLs on WarpEnterprise's collection seem to be either dead (as for kurosu) or outdated (your GeoCities archive ends at version 1.4.16).

Guys - don't make it so hard for your users to collect the needed information over hours. Keep your central information sources available and up to date; please.

yaz
22nd March 2005, 10:20
@manao
compareyv12 would be fine but ...
- it does not output overall psnr (at least that one downloaded from warpy's collection does not)
- it's a way buggy (no one has specified what way, but it's stated)

btw, why does compare in the core not support yv12 ?

@ligh
yep ... all links seem to be dead :(

the bests
y

Manao
22nd March 2005, 10:33
> - it does not output overall psnr

No, in fact it's much more subtile : it does compute overall psnr, but it says afterwards it's average psnr.

> - it's a way buggy

Never had any trouble with it, except when not giving full pathnames to files.

> I cannot find a function named "YV12Logic" in MaskTools.dll

My bad, I was sure its name was YV12Logic, but looking at the documentation, it's in fact "Logic" without the YV12... Latest version is indeed at http://manao4.free.fr, as for all the filters I maintain.

Edit : and for WarpEnterprises' links, I don't know who updates them.

Leak
22nd March 2005, 11:29
Originally posted by Manao
Edit : and for WarpEnterprises' links, I don't know who updates them.

Uh - the user of the same name at this forum? ;)

(PMing him might help...)

np: Styrofoam - The Long Wait (I'm What's There To Show...)

yaz
22nd March 2005, 12:16
Originally posted by Manao
(compareyv12) ... No, in fact it's much more subtile : it does compute overall psnr, but it says afterwards it's average psnr.sure? the layout prompts it's rather the average :) anyway, is there any obstacle of implementing yv12 support into compare()?
Originally posted by Manao
... Latest version is indeed at http://manao4.free.fr, as for all the filters I maintain ....
found by yaz
The Web site you are looking for is unavailable due to its identification configuration settings.:confused: :confused: :confused:

the bests
y

Manao
22nd March 2005, 12:21
> is there any obstacle of implementing yv12 support into compare()?

Not at all

> The Web site you are looking for is unavailable due to its identification configuration settings.

Remove the comma :D

LigH
22nd March 2005, 16:02
The "backout" dll seems to have fixed the issue with Compare.

The summary of CompareYV12 is a lot more verbose that Compare. Nice.

And about "Logic"... yet to be tested.