Log in

View Full Version : Good sharpening method for Blu-Ray content


THX-UltraII
12th October 2012, 11:37
I m looking for something similar like the Darbee Darblet. Is that possible with some kind of sharpening filter/tool an a fast HTPC? I ve heard someone talk about Didee Finesharp but cannot find anything about this. Is this the one I m after or are there any others/better?

My setup:
MPC-HC/LAV Filters/madVR/SVP Frame Interpolation
W7x64
GTX460 with latest NVIDIA driver
Intel i7 2600K, 4gb mem.

Reel.Deel
12th October 2012, 11:48
FineSharp is located here. (http://forum.doom9.org/showthread.php?p=1569035#post1569035)

THX-UltraII
12th October 2012, 12:35
thanks. I ll post other questions in your official FineSharp thread.

Didée
12th October 2012, 12:46
Seems that is not quite comparable. FineSharp, as the name somehow suggets, deals mostly with enhancement of fine structures and edges. Darbee seems to implement something like a wide-range Unsharp-Mask with halo protection.

Didée
12th October 2012, 13:08
A year or some other back, I fiddled with a multi-scale sampled, (quasi-) median enhancer. Those results were more or less similar to what Darbee is achieving.

A (pretty naive and pretty slow) version is to simply use a wide-range median filter for sharpening.

# medianblur.dll
# repairSSE2.dll
# mt_masktools-25.dll

imagesource("D:\darbee_6_0_test.png").converttoyv12()

a = last
b = a.medianblur(12,8,8)
c = a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(b,1),1),1),1),1),1),1),1)
d = mt_lutxy(a,c,"x x y - abs 1.62 2 ^ / 1 1.62 / ^ 1.62 3 ^ * x y - x y - abs 1.62 + / * +",U=3,V=3)

interleave(a,d)

return(last)


http://thumbnails106.imagebam.com/21481/8fdead214807192.jpg (http://www.imagebam.com/image/8fdead214807192) ==> http://thumbnails106.imagebam.com/21481/8717f9214807176.jpg (http://www.imagebam.com/image/8717f9214807176)

(Open in tabs to flip back-n-forth.)

Guest
12th October 2012, 13:29
Looks pretty darn good to me! New thread? :)

Didée
12th October 2012, 14:21
Not yet. This is only a torchlight, in practice things shouldn't be done that simple. A particular problem is chroma handling, which must be done different. It would be needed to isolate a saturation layer, and work on that. When done directly like in this little script, nasty things will happen. Against a green background, a grey line will turn into purple, and such.
And for big framesizes like full-HD, a multiscale version is pretty much recommended. Doing a big-range median on full-HD is anything but funny, speed-wise.

Overdrive80
12th October 2012, 23:05
Wow, the result is impressive.

jinkazuya
13th October 2012, 08:23
Cool thread...Can't wait for you experts to release some awesome filters for sharpening.

THX-UltraII
30th October 2012, 13:29
Didee, you have some screenshots maybe that show what Finesharp does to HD content?

Didée
30th October 2012, 13:51
A case example was posted here:
http://forum.doom9.org/showthread.php?p=1568963#post1568963

THX-UltraII
30th October 2012, 14:55
The result looks subtle with no artifacts I can detect. The Darbee Darblet is way more aggresive but a lot of people praise the Darblet for the negative side effects which the Darblet does not seem to have.

Could you help me on my way how to make your script work? I use MPC-HC with madVR renderer and LAV audio and LAV video filter.

fvisagie
31st October 2012, 08:30
...
a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(b,1),1),1),1),1),1),1),1)
...


In case you're still pursuing this, it seems that repair mode 1 tends to introduce border artifacts. This is often visible at normal 100% video size, but can be seen clearly when zooming in the borders. Repair modes 4, 7-9, 13, 14 & 16-18 seem to behave better in this respect.

Kind regards,
Francois

THX-UltraII
31st October 2012, 10:19
can someone please please help me on my way with a step-by-step guide how to make this script work?

using mpc-hc with madVR renderer and lav audio and video filters.

fvisagie
31st October 2012, 10:35
can someone please please help me on my way with a step-by-step guide how to make this script work?

using mpc-hc with madVR renderer and lav audio and video filters.

If you're familiar with Avisynth this script should present no challenge, even I managed! :p If you're new to Avisynth, there's very little you need to know and it's covered here:

http://avisynth.org/mediawiki/Main_Page#New_to_AviSynth_-_start_here

Enjoy!

Didée
31st October 2012, 10:59
it seems that repair mode 1 tends to introduce border artifacts.
...
Repair modes 4, 7-9, 13, 14 & 16-18 seem to behave better in this respect.

Do you have an example where the script produces obvious edge artifacts from repair mode 1? I know that mode 1 can be a bit harsh to edges sometimes, but there are resons why to use it for a proof-of-concept implementation. The "repair(repair(..." chain is used for topological reconstruction. And only mode=1 can do it completely. The point is that a median filter will cut (or "round") the corners of objects, which in this context is an unwanted sideffect. The intention is to remove "small" detail (in respect to the median radius, which is relatively large here), but to NOT cut/round the corners of big continuous areas. Else, you get "glowing corners" on things like squares, fingertips, whatever, and it gets worse the thinner the removed strands are.

Synthetic testcase:

http://thumbnails102.imagebam.com/21788/b7973e217874048.jpg (http://www.imagebam.com/image/b7973e217874048)

different color combination:
http://thumbnails104.imagebam.com/21788/4cef5b217874043.jpg (http://www.imagebam.com/image/4cef5b217874043)

In this example, the correct thing to do is: to do *nothing*. This is achieved only by mode=1, because only this mode can "extend" areas using the full neighborhood. All other modes fail.

Didée
31st October 2012, 11:02
@THX_UltraII

Which script are you talking about in fact? About "FineSharp", or about the script posted in this very thread here?

Those are two completely different beasts ...

THX-UltraII
31st October 2012, 12:15
@THX_UltraII

Which script are you talking about in fact? About "FineSharp", or about the script posted in this very thread here?

Those are two completely different beasts ...Dont know if you can advise me which script to use but want a script that makes 1080P Blu-Ray content sharper without visible artifacts from seating distance.

CPU/GPU is no problem here (I7 2600K oced@5Ghz + GTX460 oced)

Didée
31st October 2012, 12:46
CPU/GPU is no problem here (I7 2600K oced@5Ghz + GTX460 oced)
It wouldn't be difficult to produce a small script for which your CPU is 10-times or 20-times too slow to process it in realtime. :p

THX-UltraII
31st October 2012, 13:27
It wouldn't be difficult to produce a small script for which your CPU is 10-times or 20-times too slow to process it in realtime. :p

:)
Come on Didee, serious now :thanks:

fvisagie
31st October 2012, 14:01
As far as I can tell it depends to some extent on the blur level (no surprise for you I guess!) as well as the source. The effect shows up as an incorrectly coloured band inside the border. It's more noticeable where adjacent light and dark bands approach the border at right angles, e.g. a horizontal light-coloured stick crossing the vertical border against a dark background.

Some examples from the clip I posted at http://forum.doom9.org/showthread.php?t=166334 as well as the test image you used above. Once the image opens, click on it for a full-size view:
Fly radiusy 12 mode 1 (http://www.mediafire.com/view/?593ck5uyuu3vq3g)
Fly radiusy 64 mode 1 (http://www.mediafire.com/view/?ols623z8y4s5ris)
Fly radiusy 64 mode 4 (http://www.mediafire.com/view/?hgfkqzut0p3w8po)
Spider radiusy 12 mode 1 (http://www.mediafire.com/view/?jh5fhvsredtk1kt)
Spider radiusy 64 mode 1 (http://www.mediafire.com/view/?xwlrrfpbyt8kakd)
Spider radiusy 64 mode 4 (http://www.mediafire.com/view/?6klfywg0oxrw23e)

But you use the word 'obvious' which is probably the key here! At normal blur levels these effects aren't that intrusive.

Didée
31st October 2012, 14:52
Well, okay, but that seems merely like a border issue. Aaaahh ... I realise that I misunderstood you! I thought it was about edges of objects, but obviously you meant the borders of the video frame. :)

Disclosure: Some filters don't process the pixels at the very image borders, simply leaving them untouched. Removegrain/Repair ARE of this type, and that's exactly why the borders come out like they are. For that reason, it would be needed to first add some border-padding to the source, then process, then crop back again.

BTW, for radius=64, you would need to modify the "repair(repair(..." chain. The number of repairs must (should) correspond to the radius of the median filter. When leaving the chain at 8 repairs, but cranking the radius up to 64, then the result is not correct. The mentioned corner-issue, corners will not be sufficiently restored. Granted, in many situations you'll hardly see any difference ... but when some flat, squarish objects happen to come into view -- a window, a TV set, a pice of paper, a big truck -- then it becomes important that median-radius and number-of-repairs match together.

fvisagie
31st October 2012, 17:41
I realise that I misunderstood you!

No problem, it's quite refreshing to be the one misunderstood for a change ;).

For that reason, it would be needed to first add some border-padding to the source, then process, then crop back again.

What kind of padding are you referring to? Simple black padding I have no problem with, but if you mean copying or mirroring existing border content, _please_ supply a script fragment?

BTW, for radius=64, you would need to modify the "repair(repair(..." chain. The number of repairs must (should) correspond to the radius of the median filter.

Now you're talking, this is exciting news! :) Unless it's a simple 12:8 linear relationship between radius and number of repairs as in the script you posted, please elaborate on how to establish a suitable number of repairs for radius=64, or any other number?

fvisagie
3rd November 2012, 07:19
b = a.medianblur(12,8,8)
c = a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(b,1),1),1),1),1),1),1),1)
d = mt_lutxy(a,c,"x x y - abs 1.62 2 ^ / 1 1.62 / ^ 1.62 3 ^ * x y - x y - abs 1.62 + / * +",U=3,V=3)

Where can I read up more about what's happening here?
b = ... creates some blurring,
c = ... creates some different kind of blurring,
and then suddenly some magic happens at
d = ...?

Other than merely looking at the end result, is there some way of visualising or understanding the role of that RPN expression?

Thanks in advance.

fvisagie
3rd November 2012, 21:05
After some Googling I think I've got the gist of it now.
b = a.medianblur(12,8,8)
...
d = mt_lutxy(a,c,"x x y - abs 1.62 2 ^ / 1 1.62 / ^ 1.62 3 ^ * x y - x y - abs 1.62 + / * +",U=3,V=3)

is unsharping, with 12,8,8 controlling the radii and 1.62 controlling the strength (?), and
c = a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(b,1),1),1),1),1),1),1),1)

does topological reconstruction (of the unsharp mask) in-between.

This has already taken me far, thanks and great work, Didée.

Is there any potential advantage to motion-compensating either or both of unsharping and topological reconstruction? I guess temporal noise could somewhat influence either, but when one includes e.g. TemporalDegrain() - which does MC - later in the script anyway, is there any benefit to doing MC at this point? If so, how would one go about it?

starlight2
4th November 2012, 09:26
Hello Didee ', I look only 1080p on my projector jvc.
To date, what you think is the best filter to improve the clarity and three-dimensionality of the image?
thanks

THX-UltraII
5th November 2012, 20:26
Hello Didee ', I look only 1080p on my projector jvc.
To date, what you think is the best filter to improve the clarity and three-dimensionality of the image?
thanks
+1 for this question (also using a JVC projector with 1080p material)

Didée
6th November 2012, 00:14
what you think is the best filter to improve the clarity and three-dimensionality of the image?
You're really asking the B-word?

Well, the very best filter probably is: NOP(). It is a very fast filter, and it does create absolutely no artifacts, never ever.

Also, I'm not quite sure how to improve the three-dimensionalty of a two-dimensional video. If you have a modern TV set, try the "2D-->3D" button on the remote. For PC-playback, try VLC. It has features to project the video onto a cube or onto a sphere. Looks pretty thre-dimensional.

Sorry for the funny answers, but .... it wasn't me who started posing funny questions. :)

THX-UltraII
6th November 2012, 02:20
where can we find nop?

Reel.Deel
6th November 2012, 02:32
NOP stands for No Operation. In other words, no processing is taking place, at all.

*edit*
Since there is no "best" filter, the answer was sarcastic. That question cannot be answered objectively. The "best" filter for a particular source might be the "worst" for another.

digitech
6th November 2012, 04:09
You're really asking the B-word?

Well, the very best filter probably is: NOP(). It is a very fast filter, and it does create absolutely no artifacts, never ever.

Also, I'm not quite sure how to improve the three-dimensionalty of a two-dimensional video. If you have a modern TV set, try the "2D-->3D" button on the remote. For PC-playback, try VLC. It has features to project the video onto a cube or onto a sphere. Looks pretty thre-dimensional.

Sorry for the funny answers, but .... it wasn't me who started posing funny questions. :)

The most sarcastic answer i have ever read on my entire life, with details and everthing, maybe one or two are going to start looking for what's all the hype about NOP(). Lol.

starlight2
6th November 2012, 22:47
Didee, I accept your answer well ironic.:p
But now I propose again the question.
I have a JVC projector and I only watch movies in 1080p, use MPC + ffdshow with the classic unsharp mask at 25-30 and I feel good.
I know limitedsharpenfaster, lsfmod, finesharp, but do not know which is better. Others?
I wanted to ask if you could kindly tell me and post (maybe the string), the filter sharp you think is the most 'powerful, maybe what you use most often.
P.S. I wanted to understand the three-dimensional-------->> detail.

Thank you very much for your time.

starlight2
9th November 2012, 18:42
nothing?

Didée
9th November 2012, 20:49
No, nothing. And that is the usual answer when the question is "which is the one thing that I can use everytime for everything."

fvisagie
13th August 2015, 10:15
Not yet. This is only a torchlight, in practice things shouldn't be done that simple. A particular problem is chroma handling, which must be done different. It would be needed to isolate a saturation layer, and work on that. When done directly like in this little script, nasty things will happen. Against a green background, a grey line will turn into purple, and such.
And for big framesizes like full-HD, a multiscale version is pretty much recommended. Doing a big-range median on full-HD is anything but funny, speed-wise.

Results with your proof of concept (http://forum.doom9.org/showthread.php?p=1595531#post1595531) are certainly impressive. As you said at the time, it had some limitations, but I'd like to evaluate what it's capable of once those are addressed. Before I start struggling re-inventing wheels, have you done any further work on it in the meantime?

LigH
22nd August 2015, 18:26
As far as I heard, Didée has more or less retired from video editing, especially script development; but I won't put him in pension before he told us himself. :p

creaothceann
22nd August 2015, 20:55
His last post was 2013-12-20. (http://forum.doom9.org/showthread.php?p=1658667#post1658667)

fvisagie
23rd August 2015, 08:46
As far as I heard, Didée has more or less retired from video editing

Lack of activity both here and on the Gleitz forum indicated so, but that's depressing confirmation; he's sorely missed. Wishing him all the best.