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. |
![]() |
#1 | Link |
XviD fan
Join Date: Jun 2002
Location: France
Posts: 907
|
Psnr.dll :)
Pfuiou !
I never coded a filter so fast (2 hours ![]() Big thx to gruel (see in the readme) I always dreamed to calculate the PSNR (it seemed to be a secret and inreachable value because i've never seen a prog/util/filter to calc it !!) Or maybe you all ignore PSNR and only trust your eyes : Your're right ! PSNR is not Quality but write "i've got a terrible PSNR : 60 Db !!!" it's better than : "it's the best quality" sentences... You use it to tune my avs filters chains and compare codecs ![]() I hope you'll enjoy it ![]() Last edited by Marc FD; 20th July 2002 at 19:06. |
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Oct 2001
Location: Brussels
Posts: 358
|
Arg! bad timing
![]() I just wrote a filter that calculate the PSNR, as well as some other measures, and I'm in the process of making it a bit more flexible to include it in avisynth.
__________________
dividee |
![]() |
![]() |
![]() |
#4 | Link |
Moderator
![]() Join Date: Oct 2001
Location: Germany
Posts: 4,454
|
Marc,
you can't compare codecs by PSNR. It would be like comparing cars by PS numbers. You can check whether you improved something with that, sure, but in NO way it's possible to comapre e.g. divx and xvid based on PSNR. Regards, Koepi
__________________
Koepi's new media development site |
![]() |
![]() |
![]() |
#5 | Link | |
Registered User
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
|
Quote:
Probably true. You can't compare codecs by putting a single number on them. But from everything I've read, if you did have to settle for one simple fidelity measure the PSNR would be one of better ones. So I'm going to try it. ![]() - Tom |
|
![]() |
![]() |
![]() |
#6 | Link |
Retired AviSynth Dev ;)
![]() Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
|
Marc FD: This is actually very useful! I do however seem to get some strange artifacts. I guess it's related to a missing call to MakeWriteable() before BitBlt?
The following script shows it: Code:
LoadPlugin("c:\apps\AviSynth\psnr.dll") colorbars(512,384) converttoyuy2() converttorgb() converttoyuy2() Psnr(colorbars(512,384).converttoyuy2()) Or even better - a noise graph that shows the amount of noise at a given frequency. (frequency on the x-axis and the amount on y-axis). It would help greatly to see the distribution.
__________________
Regards, sh0dan // VoxPod |
![]() |
![]() |
![]() |
#7 | Link |
XviD fan
Join Date: Jun 2002
Location: France
Posts: 907
|
I'm MMixed
![]() ![]() I think psnr.dll could be usefull to compare avisynth chain-filters @shodan artifacts ?? you mean the PSNR-graph in black in the bottom of the screen ?? OR it's something else ?? PS : The output image is a BitBlt from clip2, but i didn't optimize it ![]() @Koepi I agree with you. Since you have read the readme, you' ve seen my warnings on the PSNR. But i like cars with many PS, like many people ![]() @Dividee Is your filter very advanced ? If you can compute tons of others interessing values (like Zhou Wang's structural distortion measure ![]() ![]() |
![]() |
![]() |
![]() |
#8 | Link |
Registered User
Join Date: Oct 2001
Location: Brussels
Posts: 358
|
Sorry for not answering earlier, I had some hardware problem yesterday. One of my DDR stick died
![]() Actually, the slowest part in your filter (as in mine) is probably the text output. Try it: comment out the font rendering functions and see how fast it goes ![]() That's why you don't see any difference when the SSD calcs are in MMX. In my filter, I added an option to log the results to a file and disable the on-screen output. That makes it go 10x faster for the C version, and about 30x faster for the Integer SSE version (I don't have an MMX version). But no, my filter doesn't do a lot more. I don't have a graph, but I also display the mean of differences and the mean of absolute differences. By comparing the two, you can tell if your filter chain has a bias when it shouldn't. Very useful for tracking rounding errors in filters. To end the feature list comparison, it also allows to select only some channels for comparisons (Y,U,V or R,G,B[,A]). By default, it doesn't compare the alpha channel in RGB32, which is probably better. If people like it, I could add your PSNR graph ?
__________________
dividee |
![]() |
![]() |
![]() |
#9 | Link |
XviD fan
Join Date: Jun 2002
Location: France
Posts: 907
|
Hi.
the only algo i have is gruel's C psnr (i'm not even sure i did it himself..) so the MMX version was in fact my firsts steps in MMX coding ![]() PS: I can't see any difference between ISSE and MMX code. i think it's only a few new instructions. Right ?? I'm going to take a look on the "Intel arch instr. set devel ref manual" ![]() And since psnr 1.0 is in GPL v2 you can do whatever you want with the code : just tag my name somewhere and lemme know if you ripp a part of my code ![]() |
![]() |
![]() |
![]() |
#10 | Link | |
Registered User
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
|
Quote:
- Tom |
|
![]() |
![]() |
![]() |
#11 | Link |
Registered User
Join Date: Oct 2001
Location: Brussels
Posts: 358
|
Yep, ISSE is just some additionnal instructions, but they come in handy sometimes. The problem with the "Inst. Set Ref." from Intel is that it doesn't tell explicitely which instructions are for which architecture. The other day I wanted to use PADDQ and didn't realise immediately that it's an SSE2 only instruction. So, while you're at it you might also grab the Volume 1: Basic Architecture; it includes that kind of details.
Well, I found the PSNR formula in Nandub source code, but I guess it can also be found it by googling at bit; it's not a "secret and inreachable value" ![]() Anyway, thanks for your offer. I think i'll rip the graph then ![]()
__________________
dividee |
![]() |
![]() |
![]() |
#13 | Link |
Registered User
Join Date: Oct 2001
Location: Brussels
Posts: 358
|
I commited my filter to the CVS. It's called Compare and has the following syntax (with default values):
Code:
Compare(clip filtered, clip original, string channels="", string logfile="", bool show_graph=true) ex: Compare(clip1,clip2,"UV") will only compare chroma channels of YUY2 clips. BTW, I also optimized the text renderer a bit. Each time you change the text to be written, it has to recalculate the antialiasing mask, and it takes a huge amount of time. But most of the text bitmap is just black anyway so I optimized for this common case.
__________________
dividee |
![]() |
![]() |
![]() |
#14 | Link |
Registered User
Join Date: May 2002
Location: Germany
Posts: 82
|
what is a good or worse PSNR value, when copmaring original and encoded material?
I get around 45 and don't know if my filterchain for 1CD makes a good job (but in my eyes it looks perfectly).
__________________
If you like to tweak, you'll love XviD and AVISynth! --------this combination-is-still-the-best--------- |
![]() |
![]() |
![]() |
#15 | Link |
XviD fan
Join Date: Jun 2002
Location: France
Posts: 907
|
Impossible to say.
45 seems a good value. it can get worser on very blocky scenes ( under 40) and you can get values close from 50 dB when the codec is doing is best... but i don't think higher values can be reached with quant2 |
![]() |
![]() |
![]() |
#16 | Link |
Registered User
Join Date: Oct 2001
Location: Brussels
Posts: 358
|
What could be interesting is this:
* Create a filter chain using your eyes to tell you if it's good. * Encode both the filtered and unfiltered video. * Use PSNR to compare (a) the unfiltered encoding with the unfiltered original (b) the filtered encoding with the filtered original this way you could tell ( if PSNR(b) > PSNR(a) ) if the filtering helped the codec. It's even possible in some case that PSNR(c) between the filtered encoding and the unfiltered original is even higher than PSNR(a). that's the ideal situation, I think.
__________________
dividee |
![]() |
![]() |
![]() |
#17 | Link |
Registered User
Join Date: May 2002
Location: Germany
Posts: 82
|
i would like to see an average PSNR in this nice filter.
So we can compare globaly some movie-encodes with different settings. i like the kind of the result output - very nice ![]()
__________________
If you like to tweak, you'll love XviD and AVISynth! --------this combination-is-still-the-best--------- |
![]() |
![]() |
![]() |
#19 | Link |
Registered User
Join Date: May 2002
Location: Germany
Posts: 82
|
is it possible to write the average PSNR directly on the screen, while comparing the two movies?
Maybe: - Frame - actual PSNR - average PSNR - highest PSNR - lowest PSNR
__________________
If you like to tweak, you'll love XviD and AVISynth! --------this combination-is-still-the-best--------- |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|