Log in

View Full Version : BlendBob 1.2: smartbobbed-field matching and de-rainbowing filter


Pages : [1] 2

Leak
26th July 2004, 00:15
Okay, some here may actually remember my BlendBob script that I've posted a bit about here (http://forum.doom9.org/showthread.php?threadid=79144) - even though not a single person posted in that thread; was everybody totally stunned by it's greatness? :D

Well, to make a long story short: I've made a new and improved version of it, but this time as an AviSynth plugin (http://leak.no-ip.org/AviSynth/BlendBob/BlendBob_1.2.zip) (currently at version 1.2).

It does approximately the same job that Telecide has, but instead of trying to directly match fields and then deinterlace what slipped through it does it the other way around by using a smart bobber (well, I've only tested it with KernelDeint, but you could probably use anything a bit smarter than Bob()) to produce a frame from each field and then blends every other frame with the neighbouring frame that closer matches it (and which also brings the framerate back to what it started at); if the smart bobber did it's job right then no combs should be able to slip through (except for a special case I'll explain further down...).

It's advantage over Telecide is that you really needn't worry about finding a threshold for comb elimination; the smart bobber takes care of that. The blending of 2 smart bobbed frames means you'll get full resolution in still areas and damn close to full resolution in moving areas.

The derainbowing code I've added takes the chroma from the 2 frames it's chosen for blending, subtracts them and builds a mask of all pixels where the chroma difference exceeds a threshold. This mask is then used to replace the rainbowed chroma in the blended frame with a blurred version that has less to no rainbows.

Of course, you'll still need to use Decimate() on the result (unless I start working on my own plugin for that... ;)).

Here's the readme that comes with it:


BlendBob 1.2 by Kurt Bernhard Pruenner
======================================

This filter takes a bobbed video stream and halves it's framerate by blending
every other frame with the adjacent frame that matches it best.

Additionally, it tries to fix badly telecined frames, and offers derainbowing
options for 24 and 30FPS material.


Parameters
==========

c ............... Clip to blend

show ............ If true show the following framematching metrics:

* The first line shows the current frame number and the
action that is used for this frame

* The next line shows the following metrics:

- Difference between previous & current frame
- Difference between current & next frame
- Difference between previous & next frame
- The difference used for determining the action
- The average used metric for the last 7 frames
- The frame's brightness (used to normalize differences)

* The last line shows two metrics that measure the similarity
of the current resulting frame and the previous and next one.

If a badly telecined frame is found that has a small enough
difference to one of these neighbours it is replaced with
it, otherwise a blend of the previous and next source frame
is passed through, which has somewhat less vertical
resolution depending on the bobber that was used.

(default false)

pnThresh ........ Threshold for bad telecine detection; the smaller one of the
prev/curr and curr/next differences minus the averaged used
values must be pnThresh times larger than the prev/next
difference for the frame to be detected as badly telecined.
Set to 0.0 or very high to turn this off.
(default 2.5)

diffBias ........ Weight bias for difference weights:

0.0 gives a sine curve from -pi to pi
0.0 to -1.0 moves the end value towards 0
0.0 to 1.0 moves the start value towards 0

Set this to below zero if your source is noisy.
(default 0.0)

diffScale ....... The weights calculated using diffBias are values between 0.0 and
1.0, which are then multiplied by this value - adjust this if your
setting for diffBias produces too small results
(default 16.0)

forceMatch ...... Force a match in case you want to derainbow progressive material

0 - automatic matching
1 - force curr/next matches
2 - force prev/curr matches

(default 0)

derainbow ....... 0 - Turn rainbow elimination off
1 - Turn rainbow elimination on
2 - Mark rainbows red
3 - Replace luma with gray and only show rainbows in chroma
4 - Show rainbow mask

NOTE: derainbowing will only work on 24 or 30FPS material where
the rainbows change with every new field.
(default 0)

rainbowThresh ... Color difference threshold for detecting rainbows, higher
values detect less rainbows
(default 32)

rainbowRadius ... Blur radius in pixels (1-8) that is used for nuking rainbows
(a (2*r-1)^2 pixel area with the current pixel in the center is
being averaged, so 1 really doesn't do anything)
(default 4)

badFrames ....... 0 - Replace bad frames
1 - Pass bad frames through
2 - Pass bad frames through with their frame number in the top
right corner, skip up to 100 good frames per requested frame

(default 0)

dupeThresh ...... Threshold for duplicate detection; if a bad frame is detected and
the dupe difference of either the next or previous frame is lower
than this vale then the bad frame is replaced with it.
(default 500)

dupeBias ........ Weight bias for duplicate detection difference weights

0.0 gives a sine curve from -pi to pi
0.0 to -1.0 moves the end value towards 0
0.0 to 1.0 moves the start value towards 0

Set this to below zero if your source is noisy.
(default 0.0)

dupeScale ....... The weights calculated using dupeBias are values between 0.0 and
1.0, which are then multiplied by this value - adjust this if your
setting for dupeBias produces too small results
(default 16.0)

coring .......... Set to true if input luma range is TV range (16-235); used for
frame brightness calculation
(default true)

forceCPU ........ Force the filter to only use specific optimizations

0 ... autodetect
1 ... C++ code only
2 ... Use MMX code where available
3 ... Use MMX & Integer SSE code where available
4 ... Use MMX & SSE code where available
5 ... Use MMX & SSE & SSE2 code where available

(default 0)


Version history
===============

25.07.2004 Version 1.0

* First Release - still missing de-rainbowing

28.07.2004 Version 1.1

* First implementation of de-rainbowing using spatial nuking
(pure C only, though)

28.07.2004 Version 1.1a

* D'oh - SSE frameblending code was disabled

31.07.2004 Version 1.2

* Main part of de-rainbowing now also implemented with MMX

* Fixed memory allocation bug where I used rainbowThresh instead of
rainbowRadius; this could crash if rainbowThresh wasn't at least
2 times as big as rainbowRadius - and it wasted memory as well


The script used for the following examples is:


MPEG2Source("test.d2v",cpu=4,moderate_h=30,moderate_v=60,iPP=true,idct=6)

KernelBob(1,8,false)
BlendBob(show=true,badFrames=0)


and it ran at ~35 FPS on my 2.4GHz P4. (And yes, I've lifted the text output functions from Decomb, but everything else is written from scratch; I hope Don doesn't mind it... :))


Example 1:

Bad frame passed through (badFrames=1):
http://leak.no-ip.org/AviSynth/BlendBob/WHR01_21618_bad.jpg

vs.

Bad frame fixed (badFrames=0):
http://leak.no-ip.org/AviSynth/BlendBob/WHR01_21618_good.jpg

Example 2:

Bad frame passed through (badFrames=1):
http://leak.no-ip.org/AviSynth/BlendBob/WHR01_21691_bad.jpg

vs.

Bad frame fixed (badFrames=0):
http://leak.no-ip.org/AviSynth/BlendBob/WHR01_21691_good.jpg
(notice that this time the frame wasn't replaced with one of it's neighbours as the background is moving slowly in this scene; if it had been replaced there would have been a stutter in the video)

To better illustrate the problem, here's the original frames around the first example:

http://leak.no-ip.org/AviSynth/BlendBob/WHR01_21616.jpg
http://leak.no-ip.org/AviSynth/BlendBob/WHR01_21617.jpg
http://leak.no-ip.org/AviSynth/BlendBob/WHR01_21618.jpg
http://leak.no-ip.org/AviSynth/BlendBob/WHR01_21619.jpg
(as you can see, the second and third frame are identical and can't be matched, but using a neighbouring frame instead works nicely)

Download BlendBob 1.2 (http://leak.no-ip.org/AviSynth/BlendBob/BlendBob_1.2.zip) (including the source)

np: A Grape Dope - Am Nasty (Immediate Action comp.)

DarkNite
26th July 2004, 05:29
Glad to see that script is being made into a plugin. I didn't post into the other thread because I didn't have any problems with it when I used it. ;)

I'll gladly run some tests once I have an empty job queue again. Is there anything in particular you want testers to look for, or are concerned with?

Leak
26th July 2004, 11:11
Originally posted by DarkNite
Glad to see that script is being made into a plugin. I didn't post into the other thread because I didn't have any problems with it when I used it. ;)

I'll gladly run some tests once I have an empty job queue again. Is there anything in particular you want testers to look for, or are concerned with?

Well, first and foremost I'd like to know if it works on all kinds of CPUs, seeing as I only have a P4 here. I was keeping a close eye on a list of which MMX/SSE instructions are supported by which CPU, but without older CPUs I can't really test that.

And I'd of course like to know if there are bugs in it, or if people find it useful, or if they have ideas for enhancements... the usual things... ;)

np: Bigg Jus - NYC Color Designer (Black Mamba Serums v2.0)

kassandro
26th July 2004, 12:12
This filter takes a bobbed video stream and halves it's framerate by blending
every other frame with the adjacent frame that matches it best.

Sorry, but you simply can't call this field matching. On the other hand, BlendBob is a good name, because you blend with the best neighbour. Nevertheless motion is blurred. A field matcher, like trbarry's Uncomb or Donald Graft's Telecide (without postprocessing) never touches the fields, they only may move to an adjacent frame. While your Blendbob certainly produces better output, if the above field matchers cannot find a good match, the output is clearly inferior, if they can, but the same effect can be obtained if you simply deinterlace. Essentially you are converting a sharp deinterlacer (the bob input) into a blur deinterlacer. Your Blendbob is more a deinterlacer with good compression ratio rather than a field matcher.

Leak
26th July 2004, 12:56
Originally posted by kassandro
Sorry, but you simply can't call this field matching.

Okay then, how about "smartbobbed-field matching" then?

On the other hand, BlendBob is a good name, because you blend with the best neighbour. Nevertheless motion is blurred.

Actually, I've not tested it on real video material - it's really ment for telecined material that was 24 FPS (probably mixed with 30 FPS material, as you get it a lot in anime these days) to begin with; and in that case no motion is blurred, as the match with the smaller difference must be the other half of the source frame, or there was so little or no motion going on that a false match doesn't matter.

Of course you'll get motion blending on full framerate material (i.e. sport broadcasts), but on movies or TV series or anime you shouldn't get blurred motion.

A field matcher, like trbarry's Uncomb or Donald Graft's Telecide (without postprocessing) never touches the fields, they only may move to an adjacent frame.

Well, I rather meant you can use BlendBob with a smart bob when you'd use a field matcher otherwise. Using a perfect smart bob, you'd always get 2 identical frames on 24 or 30FPs material, which, when blended, would also result in the same frame as final output. But of course, no such smart bob exists, but the ones we have now do come quite close IMHO.

While your Blendbob certainly produces better output, if the above field matchers cannot find a good match, the output is clearly inferior, if they can, but the same effect can be obtained if you simply deinterlace.

Uh - could you rephrase that sentence please? I'm not sure what you really wanted to say... :confused:

If you meant to say that the output is inferior to when a field matcher can find a match - yes, it's a bit smoother, but not as much as if you'd simply deinterlace everything.

http://leak.no-ip.org/AviSynth/BlendBob/WHR_6764_comparison.jpg


Essentially you are converting a sharp deinterlacer (the bob input) into a blur deinterlacer. Your Blendbob is more a deinterlacer with good compression ratio rather than a field matcher.

I'm not quite sure what the compression ratio has to do with this, other than a slightly smoothed picture compresses a bit better.

To be honest, I'm not looking for the sharpest picture possible (but I do think the output of my filter still looks quite sharp), but for the smoothest motion possible without the jaggies you get when suddenly a deinterlacer kicks in with Decomb and without the possibility of there being stray combs because there's this one scene that needs a lower vThresh in Telecide... (this is not against Decomb, as it does what it does great, but I like to be able to do things in more ways than one... :))


np: Alter Ego - Satanic Circus (Transphormer)

kassandro
26th July 2004, 13:48
Originally posted by Leak

Of course you'll get motion blending on full framerate material (i.e. sport broadcasts), but on movies or TV series or anime you shouldn't get blurred motion.

Ok, I see, I was wrong about blurred motion. If the input was in some way progressive, motion stays sharp, but interlaced motion is blurred. Thus there is no temporal blurring, but certainly some spatial blurring, simply because you average a frame derived from the top field with a frame derived from a bottom field (if the input filter is smart, then this happens only in the presence of motion). Nevertheless your filter is a deinterlacer in nature, which handles scene switches extremely well, and treats messed up progressive clips better than a normal deinterlacer, but worse than a real field matcher.
[/B][/QUOTE]


Well, I more meant you can use BlendBob where you'd use a field matcher otherwise. Using a perfect smart bob, you'd always get 2 identical frames on 24 or 30FPs material, which, when blended, also result in the same frame as output. But of course, no such smart bob exists, but the ones we have now do come quite close IMHO.

I think your BlendBob is a good alternative to a "normal" deinterlacer, whenever true field matcher yield unsatisfactory results and it is ideal for mixed material.


Uh - could you rephrase that sentence please? Something seems to be missing in there... :confused:

I have just done that - hopefully.



I'm not quite sure what the compression ratio has to do with this.

If you use kerneldeint, which is one of the worst deinterlacers as far as compression is concerned, you will certainly get a significantly better compression ratio.

You Know
26th July 2004, 14:14
hi i have just finish similat plugin based on dup thresold :P and now i seen this thread.... DOH

i have got confusion where is Kernelbob function?? in blendbob script? or in dll??

to work i have past into my script kernelbob function from blendbob.avsi and loaded dll is corrent?

Leak
26th July 2004, 16:01
Originally posted by You Know
hi i have just finish similat plugin based on dup thresold :P and now i seen this thread.... DOH

Whoops... sorry 'bout that. :)

i have got confusion where is Kernelbob function?? in blendbob script? or in dll??

to work i have past into my script kernelbob function from blendbob.avsi and loaded dll is corrent?

Yeah, you can either cut the function out of my BlendBob script and put it in a KernelBob.avsi file in your plugin dir or you can just paste it into your script.

np: Bigg Jus - Dedication 2 Pray (Black Mamba Serums v1.0)

You Know
26th July 2004, 17:59
Originally posted by Leak
Whoops... sorry 'bout that. :)

more plugins there are better is!

niamh
27th July 2004, 11:42
Ok, I've tried your filter on a telecined PAL series I have last night. I know, hardly challenging, PAL field shifts are pretty straighforward, but that's all I have, and if it can't do the basics, what else can it do hey? :D
Result: You've sold it to me :) Excellent results. No shimmering, or anything untowards(I have former episodes to check against).Considering the crappy state of the source(obviously remastered VHS to a DVD),I'm pretty happy to have it look as good as it can, even slightly nicer to me(in this case) than telecide(guide=2) !
THX leak.... now if I get my hands on a hybrid, I will be sure to give it a go, and please keep working on it :)

I have a question about this:
KernelBob(1,8,false)
It returned an invalid argument error and nothing in your script mentions a third parameter...is it a typo?
I got it running as kernelbob(1,8)

Leak
27th July 2004, 12:14
Originally posted by niamh
I have a question about this:

KernelBob(1,8,false)

It returned an invalid argument error and nothing in your script mentions a third parameter...is it a typo?
I got it running as kernelbob(1,8)

Well, that's the KernelBob function that's in my BlendBob.avsi script; the third parameter is the "sharp" parameter of KernelDeint; here it is for reference:

#
# Kernel Bob - uses KernelDeint to bob-deinterlace video
# (maybe not the newest version, but it gets the job done)
#
# c ...................... clip to bob
# topFieldFirst .......... 0 for bottom field first, 1 for top field first
# kernelDeintThreshold ... threshold used for KernelDeint, 8 works for me
# sharp .................. use sharpening, higher resolution kernel
#
# Needs KernelDeint(), tested with version 1.4.0
#
Function KernelBob(clip c, int "topFieldFirst", int "kernelDeintThreshold", bool "sharp")
{
Assert(Defined(topFieldFirst),"topFieldFirst must be specified!")
kernelDeintThreshold=Default(kernelDeintThreshold,3)
sharp=Default(sharp,false)

a=((topFieldFirst == 1) ? c.AssumeTFF() : c.AssumeBFF())
b=separatefields(a).trim(1,0).weave()

a=a.kerneldeint(order=topFieldFirst, \
sharp=false, \
threshold=kernelDeintThreshold)

b=b.kerneldeint(order=(1-topFieldFirst), \
sharp=false, \
threshold=kernelDeintThreshold)

return interleave(a,b)
}

THX leak.... now if I get my hands on a hybrid, I will be sure to give it a go, and please keep working on it

Thanks. :)

And yes, I'll keep working on it considering I'm using it myself... ;)

Next stop will be implementing the de-rainbowing I have in my BlendBob script (so I'll finally be able to get a good encode out of my Armitage III RC2 DVD).

Then I'll probably have a look if it makes sense to add a second mode that'll match the unbobbed fields using data gained from the bobbed ones, which would get this plugin quite a bit closer to being an actual fieldmatcher... In this case, integrating KernelBob into the filter might be a good idea so you can directly feed it your source, without the need of bobbing it first (although leaving an option to use any bobber might be a good idea).

Also, looking at KernelDeint's source I see it's all C++, so I guess converting the main loop to assembler using MMX or rather floating point SSE/SSE2 might speed it up a great deal (not that it's slow to begin with... :)).

np: Alter Ego - Rocker (Transphormer)

niamh
27th July 2004, 12:27
Thx for the clarification, though I was on my way to edit my post to say I'd figured it out :D
In this case, integrating KernelBob into the filter might be a good idea so you can directly feed it your source, without the need of bobbing it first (although leaving an option to use any bobber might be a good idea).
2 good ideas indeed :)

btw i have a P4 too, so I can prove nothing ;).
If you meant to say that the output is inferior to when a field matcher can find a match - yes, it's a bit smoother
I forgot to say that it's what I wanted on this particular source, slightly smoother...it's still definitely more precise than a deinterlacer.
Actually, I've not tested it on real video material
Does it make any sense at all to give it a try?

and will there be an option to use the de-rainbower on its own as well?

Leak
27th July 2004, 13:14
Originally posted by niamh
Thx for the clarification, though I was on my way to edit my post to say I'd figured it out :D


*g*

60i video: Does it make any sense at all to give it a try?

Well, my filter works on the assumption that every frame has a neighbouring frame that's very, very similar (which is the case for bobbed 24 or 30 FPS material, and probably also for slow-moving 60 FPS stuff), which you won't have with faster movements. Just using a deinterlacer followed by SelectEven() will probably yield better results in that case.

and will there be an option to use the de-rainbower on its own as well?

I'm planning to add a parameter to set the field matching to a fixed direction (which is what you really want on non-telecined stuff), but if it's telecined you'll need to match frames, as the derainbowing assumes that the only difference between 2 neighbouring frames are the rainbows.

I just have the nagging feeling that a bad edit in the video can screw that up, so probably changing the matching direction if enough frames seem to be wrong might be a good idea. (If you're suddenly matching the wrong frames, all movement in the chroma will be detected as rainbows, which won't be pretty...)

Of course, you'll still need to bob your material then, but if the fieldmatching part I've talked about above works out the derainbowing should also work on the raw input.

np: Bigg Jus - Athena (Black Mamba Serums v1.0)

dbzgundam
27th July 2004, 21:49
I have to say Leak, I've tested it on Hybrid material.... And while it does blur a tad bit, it definitely conquers stray frames/poorly telecined frames in a manner that any other deinterlacer I used could not. Great filter!

acrespo
28th July 2004, 07:12
This filter is a very good surprise for me. I try in two different anime series (Yu-Gi-Oh and Captain Tsubasa) both I have better IVTC/deinterlace results than Telecide, TomsMoComp and KernelDeint.

Tanks for this great filter.

kingmob
28th July 2004, 12:50
Wouldn't it be better if you check for similarity between bobbed frames and then weave the fields, thus retaining the fps? So in moving scenes you simply bob, but in still scenes you get some sort of enhanced bob, just like you have now, but you also retain fluidity of motion.
That was at least what I was thinking about a few days ago. Gotta do something when you can't sleep ;).

Mug Funky
28th July 2004, 16:02
yes - a parameter like "blend=false" or something of the kind would be good. even a "mode=1" style param would be useful for choosing whether to weave, blend or use a combination with some kind of thresholding.

hmmm... have you considered having a look at scharfi's intellibob? there's something that could use it's own plugin, even if it is a simplified version that could be built on in scripts, like a generic per-pixel field matcher plugin that could be called from script functions. :)

Leak
28th July 2004, 17:11
Originally posted by Mug Funky
yes - a parameter like "blend=false" or something of the kind would be good. even a "mode=1" style param would be useful for choosing whether to weave, blend or use a combination with some kind of thresholding.

Yes, that's already on my to-do list... :)

hmmm... have you considered having a look at scharfi's intellibob? there's something that could use it's own plugin, even if it is a simplified version that could be built on in scripts, like a generic per-pixel field matcher plugin that could be called from script functions. :)

Sorry, I only do one filter at a time, and I'll be back at work next week... :D

Also, before I do anything like that I'll probably take a shot at optimizing KernelDeint; currently it's pure C++ code which could use some floating point SSE code - dunno if an Integer MMX version is practicable.

np: El-P - Truancy (Fantastic Damage)

Leak
28th July 2004, 17:11
Originally posted by kingmob
Wouldn't it be better if you check for similarity between bobbed frames and then weave the fields, thus retaining the fps? So in moving scenes you simply bob, but in still scenes you get some sort of enhanced bob, just like you have now, but you also retain fluidity of motion.
That was at least what I was thinking about a few days ago. Gotta do something when you can't sleep ;).

Ummm... I already retain the original frame rate - the bobbing doubles it and the blending cuts it in half again. The fluidity of motion should stay the same in the process; if I didn't blend the bobbed frames there'd be quite a few jaggies that KernelDeint still introduces...

If you mean to apply my filter on 60 FPS interlaced material it'll probably work quite poorly, it's mainly meant for telecined material.

But yes, I've thought about using the bobbed frames for calculating the metrics and then weaving the original fields instead of blending the bobbed frame; it's just that I'm currently working on the derainbowing part I myself could use very much... :D

np: Radiohead - The National Anthem (Kid A)

Leak
28th July 2004, 17:26
Okay, so you've probably already noticed that I've updated the first post...

Version 1.1 adds de-rainbowing (look in the readme or the first post for info on how to use it), but currently it's implemented in C++ only so you'll get a noticeable speed drop for using it (my test script went from 28 FPS to 17 FPS using a blur radius of 6, so I think that it's not too bad - after all, it took most of the rainbowing down with it... :)). Adding MMX and SSE versions of the performance critical functions is up next.

Also, I've fixed a bug in the MMX frame blender that was not really blending well - since nobody noticed it I guess everybody is using SSE capable CPUs nowadays... :D

np: Gold Chains - Young Miss America (Young Miss America)

kingmob
28th July 2004, 18:19
Originally posted by Leak
Ummm... I already retain the original frame rate - the bobbing doubles it and the blending cuts it in half again. The fluidity of motion should stay the same in the process; if I didn't blend the bobbed frames there'd be quite a few jaggies that KernelDeint still introduces...

I should have used more carefull language i guess :). With retaining the fps i meant retaining the fps of the fields. If you just bob this is noticably better then going back to 25fps, so i assume this would improve the video. Ofcourse this would create a clip that needs a lot more bitrate and uses lots more cpu to play, but hey, why not ;).

Leak
28th July 2004, 18:38
Originally posted by kingmob
I should have used more carefull language i guess :). With retaining the fps i meant retaining the fps of the fields. If you just bob this is noticably better then going back to 25fps, so i assume this would improve the video. Ofcourse this would create a clip that needs a lot more bitrate and uses lots more cpu to play, but hey, why not ;).

Ah, but that's the problem... the stuff my plugin is made for doesn't have more that 24 or 25 or 30 FPS to start with - so producing video with more FPS from it would require a motion adaptive approach which is way over my head.

Take, for example, a Hollywood movie or an episode of an anime series: those have 24 full frames per second, but NTSC historically needs 60 fields per second.

Thus, the 24 frames are split into 2 fields each (one containing the even lines and one containing the odd lines, but no extra motion information) and then every 4th field is shown twice so you'll get 48+(48/4)=60 fields per second (with an IMHO very annoying jerk every time a duplicated field is displayed but still no extra motion information) - so no matter what you do you won't get more than 24 FPS material (which probably is also the smoothest way of playing it) out of it.

Of course, if you want to fully remove the telecine from a video you'll have to apply Decimate after using my plugin to remove the duplicate frame it produces out of one of the duplicated fields.

np: Dntel - Safety Scissors Spilled My Drink Mix ((This Is) The Dream Of Evan And Chan)

krieger2005
28th July 2004, 19:36
since i put your plugin in my plugin-directory there happen strange things:
- VDubMod close by themself when i try to reopen a script
- get avisynth access violation
- when i get avisynth access violation and try then to open the script again VDub close themself
- avisynth-error: Unable to open a script. After Restarting of VDub the script can be opened

My Scripts i used are:

mpeg2source...
BlendBob(forceMatch=0, derainbow=1, rainbowThresh=5)

or

mpeg2source...
BlendBob(forceMatch=0)

I have a Athlon 1400 not XP!!!

PS: deraibow works good...

krieger

Leak
28th July 2004, 20:23
Originally posted by krieger2005
since i put your plugin in my plugin-directory there happen strange things:
- VDubMod close by themself when i try to reopen a script
- get avisynth access violation
- when i get avisynth access violation and try then to open the script again VDub close themself
- avisynth-error: Unable to open a script. After Restarting of VDub the script can be opened

I have a Athlon 1400 not XP!!!


That's strange - I don't have any problems here (of course... otherwise they wouldn't be there anymore... :)). And I'm doing quite the same things you do - loading an MPEG-2 file, using KernelBob & BlendBob and that's it...

Does this also happen if you just load the plugin (or keep it in your plugin directory) but don't use it?

And the filter works unless you reload a script?

Strange... well, we have a few older Athlons at work, so in the worst case I'll test it there next week.

Then again, something within AviSynth is a bit whack currently; it also disappears on me when it would print an error message a second time - not that I think this is what causes your problems.

EDIT: One last idea - you wouldn't happen to have my "old" BlendBob.avsi script in your plugin directory? It also contains a function named BlendBob, so who knows what happens if both collide - if so, either delete the BlendBob function from that file or rename it something like avsBlendBob.

PS: deraibow works good...

Thanks. :)

EDIT: Ugh. Just noticed that while testing I forgot to change the code back so it uses the SSE frame blender - so while it shouldn't fail because of that, it runs a bit slower than neccessary... I'll upload a fixed version immediately.

np: Sixtoo - Fear Of Flying (Antagonist Survival Kit)

krieger2005
28th July 2004, 21:49
Does this also happen if you just load the plugin (or keep it in your plugin directory) but don't use it?
yes

When i load a script i can scroll some frames but get after a random frames a avisynth access error.

Then again, something within AviSynth is a bit whack currently;
Mabye, i don't know. I use 255Alpha_200304.

you wouldn't happen to have my "old" BlendBob.avsi script in your plugin directory?
No, i have only the dll-File in my Plugin-Directory

Just noticed that while testing I forgot to change the code back so it uses the SSE frame blender - so while it shouldn't fail because of that, it runs a bit slower than neccessary...
I will try it anyway. Maybe something changed...

Leak
28th July 2004, 22:45
Originally posted by krieger2005
When i load a script i can scroll some frames but get after a random frames a avisynth access error.

Now that definitely *IS* strange, as just loading my plugin shouldn't do more than telling AviSynth that it contains the "BlendBob" function... that's one function call, and that's it... :confused:

Anyway, I just did a quick debug compile without any optimizations (except for "blend" as the target processor, but that's the VC++ 6.0 default) which also doesn't even try to use any of my inline assembler functions - if that still doesn't work even if you don't use BlendBob I'm really stumped...

http://desdemona.ssw.uni-linz.ac.at/AviSynth/BlendBob/BlendBob_AllDisabled.zip

np: Deadbeat - Kezia (Wild Life Documentaries)

krieger2005
28th July 2004, 23:02
I've tried now 1.1a and the version where all features are disabled. Still the same problem.

I thought now that maybe your plugin has a conflict (which? i don't know) with one of the other plugins in the plugin-directory...
I removed all dll-Files frmo Plugin-Directory and voila... no failure.... I will search with wich plugin it has a conflict...


warpsharp_2003_1103.cab (184kB): This is the plugin which cause the problem. i removed it and all (seems to be) is ok.

Thanks for your help

krieger

Leak
29th July 2004, 00:34
Originally posted by krieger2005
warpsharp_2003_1103.cab (184kB): This is the plugin which cause the problem. i removed it and all (seems to be) is ok.

Okay, so I found that file, dumped it's DLLs into my plugin dir, got the two MSVC runtime DLLs I was missing, dumped those into my system32 dir and - still nothing.

Reloading my script works as expected and I have it playing in the background for a minute already - I can't reproduce the problem. :(

np: Slicker - We All Had A Plan (We All Have A Plan)

niamh
29th July 2004, 01:34
Warpsharp is known to cause trouble, I wouldn't think it needs much help to crash vdub; it's on the blacklist of what not to put in your plugin directory :)

One (http://forum.doom9.org/showthread.php?s=&threadid=68947&highlight=vdubmod+crash) of the numerous threads about the issue

Mug Funky
29th July 2004, 16:29
do the old athlon 1400's have SSE?

my friend "spooky"'s one doesn't appear to (at least premiere pro doesn't run on it, citing SSE as the problem, and TMPGenc has the option greyed out in environmental settings)

but if it was solved by killing warpsharp i guess that's not the problem (but could still be a place to look for problems)

krieger2005
29th July 2004, 17:24
There are 2 SSE-Version: SSE1 and SSE2. Older Athlons have only SSE1.

I think there was the same discussion in the RemoveDirt-thread.

krieger2005

Leak
29th July 2004, 20:12
Originally posted by Mug Funky
but if it was solved by killing warpsharp i guess that's not the problem (but could still be a place to look for problems)

Well, I'm trusting what AviSynth's IScriptEnvironment::GetCPUFlags() function tells me; if there had been an instruction in the executed code that his CPU didn't support then he wouldn't have been able to get even one frame out of my plugin...

np: Meat Beat Manifesto - Spinning Round Dub (In Dub)

Leak
31st July 2004, 19:24
Okay, so here we go again:

BlendBob 1.2 (http://desdemona.ssw.uni-linz.ac.at/AviSynth/BlendBob/BlendBob_1.2.zip)

Main improvement this time is a general speedup by adding more optimized code, as well as a parameter named "forceCPU" to disable optimizations in case I've b0rked something while optimizing.

Also, I've fixed a bug that probably made my filter crash if your rainbowThresh wasn't more than two times the rainbowRadius, as otherwise I'd not allocate enough memory for the blur... :(

Next up: more optimizations, integrating KernelBob and working on the raw fields

np: Deadbeat - Portable Memory (The Final Cut) (Something Borrowed, Something Blue)

stickboy
2nd August 2004, 03:19
Aw, it works only in YV12? :(

Any plans for YUY2 support?

dbzgundam
2nd August 2004, 06:36
Is there any way I can turn off the actual deinterlacing and simply use the derainbowing feature?

I currently have an encode that has very nice results with telecide alone, so I'd rather not lose the slight detail with your filter. ;)

Not that it's bad, but I like to keep in as much as possible :p .

Leak
2nd August 2004, 09:10
Originally posted by stickboy
Aw, it works only in YV12? :(

Any plans for YUY2 support?

Maybe, but YUY2 with it's packed format is rather icky when compared with YV12, especially when it comes to manipulating it using MMX/SSE.

I guess I could convert the YUY2 to some planar, YV12-like format with twice the chroma info horizontally, work on that and transform it back in the end.

That should be almost as fast as working with YV12 - it'll be slower because there's twice the chroma, but it shouldn't be bad.

But it'll be some time until I do something like that, I'm currently having a go at optimizing KernelDeint, which is probably the biggest possible speed increase that's left...

np: Kings Of Convenience - Winning A Battle, Losing The War (Quiet Is The New Loud)

Leak
2nd August 2004, 09:11
Originally posted by dbzgundam
Is there any way I can turn off the actual deinterlacing and simply use the derainbowing feature?

I currently have an encode that has very nice results with telecide alone, so I'd rather not lose the slight detail with your filter. ;)

Not that it's bad, but I like to keep in as much as possible :p .

That's planned next, but first I'll optimize and integrate KernelDeint. It might take a week or two.

np: Kings Of Convenience - Winning A Battle, Losing The War (Quiet Is The New Loud)

DarkSolar
17th August 2004, 03:26
This filter works great especailly the de rainbow part. what I was wondering was if it would function properly after a standard telecide rather then bob, I say this because I tried to use blendbob after a IVTC filter but it caused ghosting.

Leak
17th August 2004, 20:10
Originally posted by DarkSolar
This filter works great especailly the de rainbow part. what I was wondering was if it would function properly after a standard telecide rather then bob, I say this because I tried to use blendbob after a IVTC filter but it caused ghosting.

Well, it won't really work after IVTC as it needs the information in the decimated frame to detect rainbows as well, but I'll add a mode similar to Telecide in the next version where it doesn't take a bobbed video stream but normal video and weaves fields instead of blending bobbed frames - it'll take a while though.

np: Yoko Kanno - Fish ~ Silent Cruise (Ghost In The Shell Stand Alone Complex OST 1)

Piper
18th August 2004, 14:55
@Leak - thanks for your efforts with this filter. I've been following this thread for a couple of days now and was able to spend some time with it last night. From what I've seen, it looks like a good general deinterlacer (using against analogue captures). Motion is nice and fluid and does a great job dealing with deinterlacing artifacts. :)

MasterYoshidino
19th August 2004, 03:10
been keeping an eye on this plugin ever since it was just a script and definately giving kudos. it did a better job than even IT() on some problem clips I have lying around. gj.

Lothar
20th August 2004, 18:02
I tested this new filter on anime ntsc material (cowboy bebop) and the result is really good, thanks :)

I've had only some problems on scenes where the camera slides: in those scenes telecide works better when in the rest of the anime BlendBob gives a far better result.
In those scenes the result gived by BlendBob is not fluent at all and the and adiacent frames have great difference in luma.

Am I using the wrong settings?
Is there a way to automatically select in which scenes avisynth has to use a filter instead of another one?

The code:

f1= kerneldeint(a1,order=0, sharp=true, threshold=10)
e1=separatefields(a1).trim(1,0).weave().kerneldeint( order=1, sharp=true, threshold=10)
g1=interleave(f1,e1).BlendBob(derainbow=1, rainbowThresh=25).decimate()

Thx for any help.

Leak
20th August 2004, 19:18
Originally posted by Lothar
I've had only some problems on scenes where the camera slides: in those scenes telecide works better when in the rest of the anime BlendBob gives a far better result.
In those scenes the result gived by BlendBob is not fluent at all and the and adiacent frames have great difference in luma.

Am I using the wrong settings?

Could you tell me the location of such a scene? I've got all 6 Cowboy Bebop R1-DVDs, so I can check it out when I get home on sunday - but still, with Witch Hunter Robin and Armitage III my filter worked flawlessly on pans.

Is there a way to automatically select in which scenes avisynth has to use a filter instead of another one?

Well, you could use ConditionalFilter for that, but I wouldn't know what to use as the criterion.

f1= kerneldeint(a1,order=0, sharp=true, threshold=10)
e1=separatefields(a1).trim(1,0).weave().kerneldeint( order=1, sharp=true, threshold=10)
g1=interleave(f1,e1).BlendBob(derainbow=1, rainbowThresh=25).decimate()

Doesn't look too different from what I use (even though a function for KernelBob is easier to use)...

np: Markus Guentner - Such A Shame (Audio Island)

Mug Funky
20th August 2004, 21:16
@ leak:

compleeeetely off topic, but how do you get the "now playing" thing on your sig going? (some pretty cool stuff too)

Lothar
20th August 2004, 21:49
Originally posted by Leak
Could you tell me the location of such a scene? I've got all 6 Cowboy Bebop R1-DVDs, so I can check it out when I get home on sunday - but still, with Witch Hunter Robin and Armitage III my filter worked flawlessly on pans.

The first scene in the first ep after the opening.

Well, you could use ConditionalFilter for that, but I wouldn't know what to use as the criterion.

Thx for the hint & for the help

Leak
21st August 2004, 00:30
Originally posted by Mug Funky
@ leak:

compleeeetely off topic, but how do you get the "now playing" thing on your sig going? (some pretty cool stuff too)

I guess you'll be completely disappointed, but I do that by typing it by hand... :D

np: Ricardo Villalobos - I Try To Live (Can I Live) (Alcachofa)

(also, it's not technically a sig if I type it in my posts, right? :p)

Mug Funky
23rd August 2004, 07:48
3 words for you:

too much time :)

well, that counts for me as well i guess.

ok, ok. back on topic now :)

niamh
23rd August 2004, 13:10
just a mildly useless post to tell you leak, that I fobbed the filter on one of my friends, who had a nightmare of a dvd(looked some dodgy vhs reencode) to encode, with shimmering, bobbing, rainbows and so on(on top of it, it's a hybrid)..........he was very impressed :) it did a great job (I saw a few samples). The only thing is that there were so many rainbows that the output looks sort of washed out now, but that's another issue anyway ;). So, one more converted to blendbob!

Piper
23rd August 2004, 14:15
I'm curious if any of you have experimented with different Bobs when using BlendBob? I have to admit,when I first saw this thread - I skipped some essential reading and jumped to the end of the thread for the final script and was left scratching my head wondering which Bob to use. :p

During my experimenting however I discovered that DGBOB(1) works very well (analogue captures) indeed. In fact I prefer it to KernelBob <--tried various parameters/versions. Has anyone else done any other comparisons? I'm just curious why KernelBob was picked initially.

Leak
23rd August 2004, 14:29
Originally posted by Piper
During my experimenting however I discovered that DGBOB(1) works very well (analogue captures) indeed. In fact I prefer it to KernelBob <--tried various parameters/versions. Has anyone else done any other comparisons? I'm just curious why KernelBob was picked initially.

Well, I mainly picked it because it was what worked best on my sources... :D

DGBob produces too much shimmering on anime sources for my tastes, but of course YMMquiteV on different sources. :)

Anyhow, I'm back to getting my optimized KernelDeint done and out the door and after that I'll change (or rather add to) BlendBob a function to use KernelDeint internally for comparison only and weave the closest fields instead of blending deinterlaced versions of them; in that case it won't make much of a difference which smart deinterlacer you use...

np: Underworld - Cups (Beaucoup Fish)