Quantcast Avisynth: Analysis on Blockbuster - digitalFAQ.com Forums [Archives]
  #1  
02-14-2003, 02:04 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
I have done several tests with SansGrip's filters lately, and I have found something very interesting. To make a long story short, I did some tests with Blockbuster Blockbuster(method="sharpen", detail_min=1, detail_max=99, strength=20) and also Blockbuster(method="sharpen", detail_min=20, detail_max=99, strength=20) and I notice that if I use detail_min=20, I see more bocks on dark areas than if I use detail_min=1.
Here's what I think is happening. Blockbuster filters have defined "Thresholds" to apply to the film area. And what I believe is happening is that the thresholds, being sharp cut-off frequencies, create a sharp edge on these boundary. Let me be a little more specific. Say you have set your detail_min to 10. When a movie frame has an activity of 9, it's not processed. But if it has a detail_min of 10, it's processed. So it's a "sharp" attack" and a sharp "decay" on the filter when the dynamic video is passed through the filter. This boundary creates an "edge" where one side is processed by the filter, and the other is not. What I believe is needed in BlockBuster filters is a "roll-off" sort of de-emphasis and pre-emphasis in radio frequency and audio frequency terms, so that the boundary is process with a slow decay and a slow attack. That is a slow "rise time" and slow "fall time" in software. Not a sharp rise and fall as it currently is. I was able to verify this by encoding a small test clip with a detail_min of 1 and detail_max of 99 and the results is LESS BLOCKS than if I use detail_min=20 and detail max=99. So the boundary around 20 causes sharp edges because one side is being processed with sharpness, and the other side is not. I hope you people are following me
Because SansGrip hasn't showed around, I'm going to look into the source code of BlockBuster, and see if I can add this slow "rise time" and slow "fall time" on the boundary edge. The result should be less blocks when using the filters. This includes the "noise" method too. So I'll look into this probably tomorrow, and see if I can add this feature and compile a new DLL.

-kwag
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
  #2  
02-14-2003, 04:02 AM
Fiz Fiz is offline
Free Member
 
Join Date: Jan 2003
Location: London, UK
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
I got there ... eventually!

I presume you would have some form of exponential formula that peaks the strength at min_detail = 20 (in your example). So between 1 and 20 it will have a slow rise in strength but not a linear rise.

I wish I knew C++ so's I could help out . Darn VB is no use to anyone
__________________
Fizzy Wizzy Lets get Bizzy!
Reply With Quote
  #3  
02-14-2003, 12:26 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 Fiz
I got there ... eventually!

I presume you would have some form of exponential formula that peaks the strength at min_detail = 20 (in your example). So between 1 and 20 it will have a slow rise in strength but not a linear rise.
Actually it's very simple. Say you fix your min to 20 and a max to 80. Anything from 1 to 20 and 80 to 99 will be processed something like this:

Code:
       20 -----------80
      .                .
     .                  .
    .                    .
   .                      .
  .                        .
1.                          .99


Instead of like this:

Code:
          20-------------------------80
         |                             |
         |                             |
         |                             |
         |                             |
1........|                             |...........99
So I would use sort of a 3db per octave formula (AKA Pink noise) for rise and for fall power processing values. That would produce a linear increase or decrease depending if it's on rise or fall. This way the boundaries will not have a sharp cut-off/turn-on effect, which is what I believe is causing the edges to be slightly visible.

-kwag
Reply With Quote
  #4  
02-14-2003, 04:00 PM
Fiz Fiz is offline
Free Member
 
Join Date: Jan 2003
Location: London, UK
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the explanation Kwag, it makes perfect sense.

I thought it may be more exponential like this
Code:
                20 ----------- 80 
                .                 . 
               .                   . 
             .                       . 
          .                            .   
      .                                     . 
1.                                               .99
but then thinking about it, it wouldn't be too different to how it is already.

Good luck and look forward to the new blockbuster!!
__________________
Fizzy Wizzy Lets get Bizzy!
Reply With Quote
  #5  
02-14-2003, 04:04 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 Fiz

Good luck and look forward to the new blockbuster!!
Me too , but I first have to study some of SansGrip's code and have a solid idea of the program flow. Then I'll tackle that, unless he shows up, and he'll probably cook it up in an hour

-kwag
Reply With Quote
  #6  
02-14-2003, 10:27 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
and if we use:

Blockbuster(method="sharpen", detail_min=1, detail_max=19, strength=10)
Blockbuster(method="sharpen", detail_min=20, detail_max=90, strength=20)
Blockbuster(method="sharpen", detail_min=91, detail_max=99, strength=10)


works ..... or
it's s and a bad idea?
Reply With Quote
  #7  
02-14-2003, 11:02 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 jorel
and if we use:

Blockbuster(method="sharpen", detail_min=1, detail_max=19, strength=10)
Blockbuster(method="sharpen", detail_min=20, detail_max=90, strength=20)
Blockbuster(method="sharpen", detail_min=91, detail_max=99, strength=10)


works ..... or
it's s and a bad idea?
Actually the effect I'm looking for is something like this:

Blockbuster(method="sharpen", detail_min=1, detail_max=1, strength=1)
Blockbuster(method="sharpen", detail_min=2, detail_max=2, strength=2)
Blockbuster(method="sharpen", detail_min=3, detail_max=3, strength=3)
Blockbuster(method="sharpen", detail_min=4, detail_max=4, strength=4)
Blockbuster(method="sharpen", detail_min=5, detail_max=5, strength=5)
Blockbuster(method="sharpen", detail_min=6, detail_max=6, strength=6)
Blockbuster(method="sharpen", detail_min=7, detail_max=7, strength=7)
Blockbuster(method="sharpen", detail_min=8, detail_max=8, strength=8 )
Blockbuster(method="sharpen", detail_min=9, detail_max=9, strength=9)
Blockbuster(method="sharpen", detail_min=10, detail_max=10, strength=10)

Blockbuster(method="sharpen", detail_min=11, detail_max=99, strength=10)

Which would create a curve like this, but on a single line:


Code:
       10 -----------99 
      .                 
     .                  
    .                     
   .                       
  .                         
1.
-kwag
Reply With Quote
  #8  
02-26-2003, 12:03 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
A good idea -- I'll add it to my Blockbuster todo list. Once I've got back into the swing of things I'll remember what I was doing when I had to stop and will see where this will fit in .
Reply With Quote
  #9  
02-26-2003, 12: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
A good idea -- I'll add it to my Blockbuster todo list. Once I've got back into the swing of things I'll remember what I was doing when I had to stop and will see where this will fit in .
Thanks SansGrip,
Put this one on the top of your list, as it will make a HUGE difference with both "noise" and "sharpen"

Thanks,
-kwag
Reply With Quote
  #10  
02-26-2003, 02:03 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
[Put this one on the top of your list, as it will make a HUGE difference with both "noise" and "sharpen"
Actually I think someone suggested this on Doom9 ages ago and I meant to implement it but never got round to it.

I know I stopped using Blockbuster entirely, since the consensus was it's not necessary above 352x2XX. Is that still the case?
Reply With Quote
  #11  
02-26-2003, 02:11 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

I know I stopped using Blockbuster entirely, since the consensus was it's not necessary above 352x2XX. Is that still the case?
I think it's still necessary, depending on some movies. If Blockbuster can be applied on the dark areas, but with these linear adjustment, I think it would really help a lot. Some times I still do some 352x240, specially TV captures. So Blockbuster is really helpfull there

-kwag
Reply With Quote
  #12  
06-07-2003, 07:54 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
To refresh this thread and thoughts, BlockBuster is not effective at 528x480 or 704x480, as SansGrip already said. Specially in CQ mode. Apparently TMPEG sees the noise as "noise", and filters it out. This is clearly seen by using blockbuster(noise) and opening a script in Vdub. In Vdub, the noise is clearly seen, but not after it's encoded with TMPEG. However, at low resolutions (352x240), it does work.

-kwag
Reply With Quote
  #13  
06-09-2003, 05:16 AM
girv girv is offline
Free Member
 
Join Date: Sep 2002
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to girv
FWIW I find Blockbuster essential when encoding divx/xvid sources @ 480x480. I use it to help with temporal filtering of flashing DCT-like blocks visible on flat surfaces in these sources.

The "core" of my current 2.5x divx/xvid script is as follows:
Code:
Blockbuster(method="noise",detail_min=1,detail_max=8,variance=0.3,seed=5823) 
ATC(3,6,7,0.5,false)
BlindPP(cpu=2)
ASharp(2,3)
Reply With Quote
  #14  
06-09-2003, 06:33 AM
GetUp GetUp is offline
Free Member
 
Join Date: Dec 2002
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by girv
FWIW I find Blockbuster essential when encoding divx/xvid sources @ 480x480. I use it to help with temporal filtering of flashing DCT-like blocks visible on flat surfaces in these sources.

The "core" of my current 2.5x divx/xvid script is as follows:
Code:
Blockbuster(method="noise",detail_min=1,detail_max=8,variance=0.3,seed=5823) 
ATC(3,6,7,0.5,false)
BlindPP(cpu=2)
ASharp(2,3)
Can you, please, post your full DivX/XviD current script here?
Reply With Quote
  #15  
06-09-2003, 07:26 AM
girv girv is offline
Free Member
 
Join Date: Sep 2002
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to girv
@GetUp: just add AVISource / Crop commands before and BicubicResize after the core filters listed above.
Reply With Quote
  #16  
06-09-2003, 07:34 AM
GetUp GetUp is offline
Free Member
 
Join Date: Dec 2002
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by girv
@GetUp: just add AVISource / Crop commands before and BicubicResize after the core filters listed above.
And what is ATC and BlindPP? is this Avisynth filters - ATC.dll and BlindPP.dll? And what version of Avisynth you use? 2.52? Is your script have dinamic filtering portion?
Reply With Quote
  #17  
06-09-2003, 09:54 AM
girv girv is offline
Free Member
 
Join Date: Sep 2002
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to girv
@GetUp:
ATC is A Temporal Cleaner; BlindPP is a filter included in MPEG2DEC3; ASharp is an adaptive sharpening filter. All of these are by MarcFD (I think) and you can download them all from his homepage. All require AVISynth 2.5x (I'm using 2.52).

I'm not sure if I want to use adaptive filtering with xvid/divx sources or not. It further softens an already soft source and I only seem to get slight CQ benefits anyway (~1 point). The script below will apply Kwag's adaptive filtering if you want to experiment with it, comment out the two ScriptClip lines to disable it.

Code:
function fmin(float f1, float f2) { return (f1<f2) ? f1 : f2 }
nf = 0

AVISource(-your-avi-source-)
Crop(-your-crop-parameters-)
Limiter()

Blockbuster(method="noise",detail_min=1,detail_max=8,variance=0.3,seed=5823) 
ATC(3,6,7,0.5,false)
BlindPP(cpu=2)
ASharp(2,3)

BicubicResize(-your-resize-parameters-)

### adaptive filtering a la kwag
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf > 2.5 ? asharp( -(fmin((nf/30), 1)), 0 ) : TemporalSoften(2,7,7,3,2)")
ScriptClip("nf > 25 ? asharp(-1,0) : asharp(0,0) ")
###

Limiter()
Reply With Quote
  #18  
06-09-2003, 10:11 AM
GetUp GetUp is offline
Free Member
 
Join Date: Dec 2002
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by girv
@GetUp:
ATC is A Temporal Cleaner; BlindPP is a filter included in MPEG2DEC3; ASharp is an adaptive sharpening filter. All of these are by MarcFD (I think) and you can download them all from his homepage. All require AVISynth 2.5x (I'm using 2.52).

I'm not sure if I want to use adaptive filtering with xvid/divx sources or not. It further softens an already soft source and I only seem to get slight CQ benefits anyway (~1 point). The script below will apply Kwag's adaptive filtering if you want to experiment with it, comment out the two ScriptClip lines to disable it.

Code:
function fmin(float f1, float f2) { return (f1<f2) ? f1 : f2 }
nf = 0

AVISource(-your-avi-source-)
Crop(-your-crop-parameters-)
Limiter()

Blockbuster(method="noise",detail_min=1,detail_max=8,variance=0.3,seed=5823) 
ATC(3,6,7,0.5,false)
BlindPP(cpu=2)
ASharp(2,3)

BicubicResize(-your-resize-parameters-)

### adaptive filtering a la kwag
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf > 2.5 ? asharp( -(fmin((nf/30), 1)), 0 ) : TemporalSoften(2,7,7,3,2)")
ScriptClip("nf > 25 ? asharp(-1,0) : asharp(0,0) ")
###

Limiter()
Big thanks! I'll try your script immediately (w/o dynamic portion)... But why you put BlockBuster _before_ all filtering?
Reply With Quote
  #19  
06-09-2003, 10:28 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
Hi guys,

BlockBuster(noise) should go after the filters. If not, the noise will be removed by filters

@girv,

You might want to add "Adaptive" BlockBuster(noise)

Like this:


Code:
bb_method="noise"
bb_noise=True
ScriptClip("bb_noise && nf > 0.001 ? \ 
BlockBuste(method=bb_method,detail_min=1, detail_max=12, variance=((1/nf)*2), seed=0) : \
BlockBuster(method=bb_method, detail_min=100, detail_max=100, variance=0, seed=0 ) ")
And now you'll have adaptive BlobkBuster noise
If you don't want BlockBuster noise, just change the "True" to "False" in the line bb_noise=True
Play with the variance, detail_max and the "2" in ((1/nf)*2).
Increasing it will reduce noise. Those are just values I used to test the script, and I does work as I explained in another thread.

-kwag
Reply With Quote
  #20  
06-09-2003, 10:53 AM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
it can help you in something?


i copy "this" from an url "xing ling"

FilterRange -指定範囲にフィルターをかける関数

function FilterRange(clip "clip", int "start", int "end", string "filter")
{
c1 = start < 2 ? clip.trim(0, -1) : clip.trim(0, start - 1)
c2 = Eval("clip.trim(start, end)." + filter)
c3 = clip.trim(end + 1, 0)
c = start == 0 ? c2 : c1 + c2
c = end == 0 ? c : c + c3
return c
}



FilterRange(1163, 1164, "AntiComb(48, 34)") # 1163, 1164 フレームのみに AntiComb をかける

履歴

2003/02/17 FilterRange 公開

i don't understand how it works but is the same point of the thread,don't?

Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Blockbuster? Shibblet Avisynth Scripting 1 12-12-2004 09:40 PM
BSD vs. GPL: A Framework for the Social Analysis kwag Off-topic Lounge 4 05-02-2004 09:07 AM
Avisynth: No need for Blockbuster ? LadyMiles Avisynth Scripting 26 05-27-2003 02:50 AM
Avisynth: Kvcdx3 and blockbuster ARAGORN Avisynth Scripting 0 11-25-2002 11:54 AM
A detailed analysis of TMPEG vs. CinemaCraft kwag Video Encoding and Conversion 9 07-14-2002 10:44 AM

Thread Tools



 
All times are GMT -5. The time now is 07:32 AM  —  vBulletin ゥ Jelsoft Enterprises Ltd