Quantcast Sansgrip Filters: Improve Picture Quality Using "Addnoise" Filter - Page 3 - digitalFAQ.com Forums [Archives]
  #41  
11-10-2002, 10:59 AM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Kwag,

Kwag wrote:
Quote:
kwag Posted: Sun Nov 10, 2002 11:30 am Post subject:

--------------------------------------------------------------------------------

A high contrast scene, made with KVCDx3, using a CQ_VBR value of 15.5 to save space, using the same filter parameters of the previous post:

http://mpeg.0catch.com/test4-sharp-noise.m1v
http://mpeg.0catch.com/test4-nofilter.m1v

-kwag
I never created a KVCDx3 using CQ_VBR below 25. Your test clips
looked great for CQ = 15.5. I was hoping that by targeting certain
problems using noise, the CQ could be lowered enough to have the
file size still remain small. When there is some layman's explainations
during discussions between you and SansGrip, it's very exciting.
The sample with sharp-noise filters are still hard for me to believe
you did this with CQ=15.5. I just hope you have as much success
with mosquito noise as the others.

-black prince
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #42  
11-10-2002, 11:57 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Correction on the filter syntax I was using:

Blockbuster(method="sharpen", detail_threshold=20, Invert=True, strength=20) # Only sharpen material above 20%.
Blockbuster(method="noise", detail_threshold=20, lv=1.5) # Only apply noise below 20% complexity.

I had the "sharpen" line calling a "lv=2" which is an incorrect parameter name for the "sharpen" method.

Anyone trying out the filters, please make the corrections above.

@black prince,
The cleanup of the mosquitoes and flies is the only thing really missing to make MPEG-1 better than what it is now

-kwag
Reply With Quote
  #43  
11-10-2002, 12:10 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
Quote:
Originally Posted by SansGrip
Bear in mind that increasing the frequency of already high-frequency information will probably result in more mosquito noise. It's not evident in that clip because of the overall low luma levels, but you might want to look for it in day-time sections of the movie.
Exactly. On high luma, the noise filter will not be injecting noise, because the scenes will be above the treshold of 20, so the noise filter will be inactive. But the sharpen filter will be active.
And the sharpening filter will still be increasing the frequency, by amplifying existing detail instead of adding noise. Hence you might see more mosquito noise.

Quote:
Originally Posted by kwag
The lv=10 on the sharpen line
The lv parameter has no effect with the sharpen method -- it controls the variance of the random number generator when using the noise method. To adjust the degree of sharpening, use the "strength" parameter.

I'm about to release a new version with a couple of added features, and it will also check the parameters are correct for the current method.

Quote:
Originally Posted by kwag
Your idea of a MIN and MAX treshold specifier is great, because that would allow a "Dynamic Window" to be adjusted to the frequency domain of the "Mosquito Effect"
Ok, I'll implement that in the new version before I release it.

Quote:
Originally Posted by kwag
the only way to filter that would be to have a king of "Parametric Equalizer" ( similar to what's used on audio equipment ) kind of filter, in order to notch out each block of noise area. What do you think of that
I think that sounds complicated . We'll see whether the min/max idea will be able to target it first...
Reply With Quote
  #44  
11-10-2002, 01:41 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
I just released 0.4 (and source) with the following changes:

* Added luma_offset and luma_threshold parameters
* Split detail_threshold into detail_min and detail_max
* Removed redundant invert mode

See the documentation for more info.

Have fun .
Reply With Quote
  #45  
11-10-2002, 01:45 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Gee thanks SansGrip

-kwag
Reply With Quote
  #46  
11-10-2002, 02:01 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
So now it would read something like this:

Blockbuster(method="sharpen", detail_min=60, detail_max=99, strength=20) # Only sharpen material above 60%.
Blockbuster(method="noise", detail_min=1, detail_max=20, lv=1.5) # Only apply noise below 20% complexity.


And that would apply noise to material below ~20%, leave the mid frequencies from ~20% to ~60% unsharpened, and apply sharpenning from ~60% to the highest frequencies

And for what I can see, if we can find the frequency of the "Mosquito Effect" maybe a method=blur with a tight min,max focusing on the noise, would blend only the mosquito frequencies

Excelent work SansGrip

-kwag
Reply With Quote
  #47  
11-10-2002, 02:21 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
And that would apply noise to material below ~20%, leave the mid frequencies from ~20% to ~60% unsharpened, and apply sharpenning from ~60% to the highest frequencies
Yep .

Quote:
Originally Posted by kwag
And for what I can see, if we can find the frequency of the "Mosquito Effect" maybe a method=blur with a tight min,max focusing on the noise, would blend only the mosquito frequencies
Bear in mind that, while it's a close (and fast) approximation, counting the number of unique luma levels in a block is not quite the same as determining the block's frequency. That would require more complicated code (I'd have to do a Fast Fourier Transform on the data just like an encoder does) and is something I'm trying to avoid if this method works just as well.

WRT mosquito noise (otherwise known as the Gibbs Effect, which I learned thanks to the link on artifacts from LadyMiles), it tends to occur at the boundaries between low- and high-frequency areas rather than be associated with a particular level of detail, so my hopes aren't high that this filter will be able to combat it in any targeted manner.

I think the main result of blurring high-detail areas would be, well, loss of detail. If it does reduce mosquito noise that would in my opinion be a side-effect. To carry on the mosquito analogy, it's akin to throwing a bucket of pesticide at a swarm of them. Sure, it'll kill a few (or even most) of them, but has very undesirable consequences for whatever the excess lands on .

What I think would be most effective is a seperate filter to blur high-frequency parts only around edges. I'm going to think about it for a while and might add that to my TODO list .

Incidentally, do you have any clips (say, <20mb) that demonstrate bad mosquito noise? If I can see the worst-case scenario I might be able to pin down a solution more easily.
Reply With Quote
  #48  
11-10-2002, 02:37 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip

What I think would be most effective is a seperate filter to blur high-frequency parts only around edges. I'm going to think about it for a while and might add that to my TODO list .
You've got a strong point there
Quote:
Incidentally, do you have any clips (say, <20mb) that demonstrate bad mosquito noise? If I can see the worst-case scenario I might be able to pin down a solution more easily.
I will make one specifically for you and give you a download link

-kwag
Reply With Quote
  #49  
11-10-2002, 03:10 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
@SansGrip,

Please check your private messages

-kwag
Reply With Quote
  #50  
11-10-2002, 04:22 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Kwag and SansGrip,

With regards to Gibbs effect will UnDot have this effect:

Quote:
UnDot is a simple median filter for removing dots, that is stray orphan pixels and
mosquito noise. It basicly just clips each pixel value to stay within min and max
of its eight surrounding neigbors.


USAGE - To use it just:

1) Place the UnDot.dll in a directory somewhere. You can get it from
www.trbarry.com/UnDot.zip

2) In your Avisynth file use commands similar to

LoadPlugin("F:\UnDot\UnDot.dll")
Avisource("D:\wherever\myfile.avi")
UnDot()
-black prince
Reply With Quote
  #51  
11-10-2002, 05:36 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
With regards to Gibbs effect will UnDot have this effect
Well, the author (Tom Barry) says it does and I respect his opinion greatly. He's been writing filters and working with video far longer than I.

However, the question is does he mean existing mosquito noise, or areas of potential mosquito noise? I would imagine he means the former, whereas we want a proactive filter to somehow stop them happening in known trouble spots.
Reply With Quote
  #52  
11-10-2002, 06:39 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
@SansGrip,

SansGrip wrote:
Quote:
Well, the author (Tom Barry) says it does and I respect his opinion greatly. He's been writing filters and working with video far longer than I.

However, the question is does he mean existing mosquito noise, or areas of potential mosquito noise? I would imagine he means the former, whereas we want a proactive filter to somehow stop them happening in known trouble spots.
Yes your right. He mentions in some of his posts about the source
being Divx (avi). I have a feeling this problem is the encoder formulas
that fail to detect this between scene changes. Writting a new encoder is
work. My test so far with the Blockbuster filter settings made by you and
Kwag have produced excellent mpeg-1(LBR) video using only cq = 16. It looks
better than my video without filters at cq = 25. They both suffer from the
same amount of Gibbs noise. Once a solution is found for Gibbs, I can
drop cq even lower. Thanks for your hard work, Kwag and SansGrip.
Your work with this problem is so exciting, I visit this forum 4 and 5
times a day.

-black prince
Reply With Quote
  #53  
11-10-2002, 07:03 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Thanks for your hard work, Kwag and SansGrip.
Your work with this problem is so exciting, I visit this forum 4 and 5
times a day.

-black prince
Hey black prince,

Don't thank me , it's all the work of SansGrip. I only follow his documents, and put them on practice after analyzing and testing. Send him a virtual beer ( But just one, because too many will get us a blockbuster filter creating Moire patterns and inverted videos on our clean mpegs )

-kwag
Reply With Quote
  #54  
11-10-2002, 07:24 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
@SansGrip,

This one's for you guy!!! Here's a tall imaginary virtual beer coming up.
Ahhhhhh!! that's was smooth. :P And here's another toast for the queen!!
Ooops, I think I am virtually drunk. Let me get out of here
before the virtual cops catch me. and put me in virtual jail.

Thankx SansGrip,

-black prince
Reply With Quote
  #55  
11-10-2002, 07:59 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Once a solution is found for Gibbs, I can drop cq even lower.

I've not done any tests, but my gut tells me this won't be as easy as getting rid of DCT blocks. I'm gonna try, though .
Reply With Quote
  #56  
11-10-2002, 08:02 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by black prince
Here's a tall imaginary virtual beer coming up.
hehehe thanks, but really I wrote this for myself. I didn't realize there were other people out there looking for a solution too .
Reply With Quote
  #57  
11-10-2002, 08:07 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
Once a solution is found for Gibbs, I can drop cq even lower.

I've not done any tests, but my gut tells me this won't be as easy as getting rid of DCT blocks. I'm gonna try, though .
Yes. That would be dealing at the macro block level, because low CQ is actually bit rate starvation.
Maybe what is needed is something like a "pre motion estimation filter", sort of, for the encoder If that makes any sense at all. Just a wild guess Sort of a software Time Base Corrector ahead of the stream ( Maybe I'm virtually drunk now )

-kwag
Reply With Quote
  #58  
11-10-2002, 08:14 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
Maybe what is needed is something like a "pre motion estimation filter", sort of, for the encoder
I think the first thing I'm going to try is edge-constrained blurring, sort of like Donald Graft's MSmooth but in reverse .
Reply With Quote
  #59  
11-10-2002, 08:23 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
Quote:
Originally Posted by kwag
Maybe what is needed is something like a "pre motion estimation filter", sort of, for the encoder
I think the first thing I'm going to try is edge-constrained blurring, sort of like Donald Graft's MSmooth but in reverse .
What about 180 degree phase shifting on macro block boundaries? Thus, cancelling the block edges. Is that a crazy idea
Like duplicate the frame, then phase shift the block edges on one copy, and join the two frames again. The result Don't know. Just another crazy idea
I know in the analog world that would work fine ( phase cancellation, etc. ). Not sure if it would apply to mpeg encoding

-kwag
Reply With Quote
  #60  
11-10-2002, 08:33 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
What about 180 degree phase shifting on macro block boundaries? Thus, cancelling the block edges.
I'm not quite sure how a phase shift would be accomplished. Do you know any good links to information?
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
""""""Por favor me ajude" ficoboy Conversão e Codificação de Vídeo (Português) 49 08-24-2004 05:35 PM
Quais os codec's? """"""" ficoboy Conversão e Codificação de Vídeo (Português) 1 05-11-2004 10:14 AM
SansGrip's Filters: "I stopped working on the filters." SansGrip Avisynth Scripting 8 04-28-2004 07:38 PM
CQ con Tok "automatico" o CQ_VBR "manual" r1racing1 Convertir y Codificar Video (Español) 4 11-27-2003 05:14 PM
SansGrip Filters: How To Use "Overscan" together with Letterbox Jellygoose Avisynth Scripting 7 02-11-2003 05:57 AM

Thread Tools



 
All times are GMT -5. The time now is 10:28 AM  —  vBulletin © Jelsoft Enterprises Ltd