Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th September 2024, 21:50   #3001  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,823
@Dogway

When you have some time, would you please add to your scripts a "modern" version of finedehalo?

It still needs dehalo_alpha.avsi and mt_xxpand_multi.avsi.

Perhaps merging them and updating with latest AVS+ functions could make it a bit faster.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 27th September 2024, 07:24   #3002  |  Link
Lucky38
Registered User
 
Join Date: Mar 2024
Posts: 26
Question:

Why below call for 1080p gives 3-3,5k bitrate

SMDegrain(tr=3, thSAD=500, thSCD2 = 100,truemotion=false, rfilter=3, prefilter=1, search=5, contrasharp=false, LFR=true, DCTFlicker=true)

and below call for 2160p gives 15-16k bitrate

SMDegrain(tr=3, thSAD=500, thSCD2 = 100,truemotion=false, prefilter=1, UHDHalf=false, limit=255, search=5, contrasharp=false, LFR=true, DCTFlicker=true)


X265 config has exaclty the same settings. I know that 4k is 4 time 1080p but i have feeling that SMDegrain reduces grain less for 4k than for 1080p.
Lucky38 is offline   Reply With Quote
Old 27th September 2024, 18:25   #3003  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,209
4K naturally have more noise 'per sample' because it gets 4 times less photons per sample from same lit scene (via same aperture lens) and relative photon shot noise is 2 times larger. It also can cause worse motion estimation and higher SAD and lower denoising.
To shoot comparable 4K users need to set 4 times more light per scene (to keep same depth of field from lens) and use camera with same electrons per sample sensor capacity (or something like 4 times per frame reading and 'external accumulation') and externally it is looks like 4 time less ISO sensitivity rating. In that case the 4K digital footage expected to be only 4 times more in comparison with 1080 in data rate (sort of real scene data rate with zero noise).
DTL is offline   Reply With Quote
Old 28th September 2024, 10:02   #3004  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,823
Quote:
Originally Posted by DTL View Post
4K naturally have more noise 'per sample' because it gets 4 times less photons per sample from same lit scene (via same aperture lens) and relative photon shot noise is 2 times larger. It also can cause worse motion estimation and higher SAD and lower denoising.
Are you suggesting that we should denoise a UHD with the BD version or resizing it as prefilter is enough?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 28th September 2024, 19:14   #3005  |  Link
Lucky38
Registered User
 
Join Date: Mar 2024
Posts: 26
Quote:
Originally Posted by DTL View Post
4K naturally have more noise 'per sample' because it gets 4 times less photons per sample from same lit scene (via same aperture lens) and relative photon shot noise is 2 times larger. It also can cause worse motion estimation and higher SAD and lower denoising.
To shoot comparable 4K users need to set 4 times more light per scene (to keep same depth of field from lens) and use camera with same electrons per sample sensor capacity (or something like 4 times per frame reading and 'external accumulation') and externally it is looks like 4 time less ISO sensitivity rating. In that case the 4K digital footage expected to be only 4 times more in comparison with 1080 in data rate (sort of real scene data rate with zero noise).

so is there any suggestion how to properly handle UHD noise?
Lucky38 is offline   Reply With Quote
Old 29th September 2024, 09:44   #3006  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,209
Because it typically have more relative noise levels - increase 'denoising' settings like thSAD and tr and also may be double block size (it also may be useful for typically more soft UHD sources but may depend on source sharpness).
DTL is offline   Reply With Quote
Old 16th October 2024, 14:30   #3007  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,823
My script

SetMemoryMax()
SetCacheMode(0)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
LoadPlugin("D:\Eseguibili\Media\DGDecNV\DGDecodeNV.dll")
DGSource("M:\In\Mobile Suit Gundam - Il contrattacco di Char ~Dynit\contrattacco.dgi",ct=48,cb=48,cl=48,cr=48, dn_enable=3, dn_strength=0.1, dn_cstrength=0.05, dn_quality="best")
DebilinearResizeMT(1598,862,threads=1)
ConvertBits(16)
ConvertFormat(fmt_in="420",fmt_out="444",cs_out="",UVrecon=true)
libplacebo_Deband(iterations=5,temporal=true)
fmtc_bitdepth (bits=10,dmode=3)
Prefetch(2,6)


I get

Script error: There is no function named 'nnedi3_rpow2'.
(D:/Programmi/Media/AviSynth+/plugins64/ResizersPack-12.1~Dogway.avsi, line 786)
(D:/Programmi/Media/AviSynth+/plugins64/ResizersPack-12.1~Dogway.avsi, line 787)
(D:/Programmi/Media/AviSynth+/plugins64/ResizersPack-12.1~Dogway.avsi, line 793)
(D:/Programmi/Media/AviSynth+/plugins64/TransformsPackMain-2.2.1~Dogway.avsi, line 962)
(D:/Programmi/Media/AviSynth+/plugins64/TransformsPackMain-2.2.1~Dogway.avsi, line 972)
(D:/Programmi/Media/AviSynth+/plugins64/TransformsPackMain-2.2.1~Dogway.avsi, line 973)
(D:/Programmi/Media/AviSynth+/plugins64/TransformsPackMain-2.2.1~Dogway.avsi, line 973)
(D:/Programmi/Media/AviSynth+/plugins64/TransformsPackMain-2.2.1~Dogway.avsi, line 1323)
(M:\In\Mobile Suit Gundam - Il contrattacco di Char ~Dynit\contrattacco.avs, line 15)


In the TransformsPackMain script:

### ConvertFormat()
###
### Dependencies: AviSynth+ 3.7.3 and over
### ExTools
### GradePack (for show=true or 'sigmoid' scaling)
### MasksPack (for show=true)
### ResizersPack (for show=true or UVRecon=true or NN scalers)
### KNLMeansCL (for UVRecon=true)
### nnedi3(CL) (for UVRecon=true)
### Optional resizer plugins (check links)


From ResizersPack:

# nnedi3resize()
#
# Wrapper for nnedi3wrap() for simplified ____resize() style arguments.
# Performant neural network based upscaler recommended for graphics or textureless images.
# It accepts arbitrary dimension values, not only limited to powers of 2
#
# Dependencies:
# see nnedi3wrap() below

# nnedi3wrap()
#
# Replacement wrapper for nnedi3(), nnedi3_rpow2() and NNEDI3CL() based on 'field' and 'gpuid' values.
# Adds "_rpow2" functionality and its arguments to NNEDI3CL().
# Maintains frame properties when nnedi3() or nnedi3_rpow2() is used.
# Decouples 'rfactor' into 'xfactor' and 'yfactor' and sets new reasonable defaults.
# Finally it automatically fixes center shift for both plugins, set cshift="none" to disable.
#
# Dependencies:
# ExTools
# NNEDI3CL (requires at least AVS+ v3.7.3)
# or
# nnedi3


It should work fine with NNEDI3CL and NNEDI3CL_rpow2 too, right?

Any idea?
__________________
@turment on Telegram

Last edited by tormento; 16th October 2024 at 14:40.
tormento is offline   Reply With Quote
Old 16th October 2024, 15:19   #3008  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,750
DeblockPack 2.8.avsi function oyster_Deringing was throwing error: I don't know what "UV" means.
Added missing line 468:
Code:
    UV          = color ? 3 : 2      # Emulgator 2024 10 16: Missing line added
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 16th October 2024 at 15:22.
Emulgator is offline   Reply With Quote
Old 16th October 2024, 16:09   #3009  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,823
Quote:
Originally Posted by Emulgator View Post
DeblockPack 2.8.avsi function oyster_Deringing was throwing error
You aren't answering me, are you?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 16th October 2024, 16:12   #3010  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,750
No, this was just a find to help all Dogway filter users, not connected to your script.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 18th October 2024, 13:17   #3011  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,823
I am fighting with a hard compromise between denoising and details loss.

Some animation studios, even when producing in digital, add some very fine digital noise to the final product.

These two clips come from a very recent anime.

The first one is about the details of the garnment of the girl, mostly the knitting close to the hairs and the hood.



The second one is where you can clearly see the digital noise lurking in the dark. You can see in light scenes too but here is more evident.



I have tried many many parameters to delete the noise, preserving the knitting, but it's really hard.

Any help is welcome.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 18th October 2024, 13:34   #3012  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 214
Quote:
Originally Posted by tormento View Post

I have tried many many parameters to delete the noise, preserving the knitting, but it's really hard.

Any help is welcome.
Use 2x-LD-Anime-Compact
Should clean it up very nicely. 2x_AniScale2S_Compact_i8_60K should work, too.
takla is offline   Reply With Quote
Old 18th October 2024, 13:48   #3013  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,503
Quote:
Should clean it up very nicely.
nope,.. https://imgsli.com/MzA4NzI1
I would start with something like mcdegrainsharp and then try to filter flat areas differently using some masking.
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 18th October 2024 at 13:54.
Selur is offline   Reply With Quote
Old 18th October 2024, 14:20   #3014  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,823
Quote:
Originally Posted by Selur View Post
I would start with something like mcdegrainsharp and then try to filter flat areas differently using some masking.
I don't want to put so much effort to manually select filter range and apply different filters to them manually.

I'd like to use a much more replicable and automated process.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 18th October 2024, 14:21   #3015  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,823
Quote:
Originally Posted by takla View Post
Should clean it up very nicely. 2x_AniScale2S_Compact_i8_60K should work, too.
It completely destroys knittings.

And I doubt it could performe nicely on my 1660 Super too.

What GPU do you have and how many fps can you achieve?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 19th October 2024, 00:41   #3016  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 214
Quote:
Originally Posted by tormento View Post
It completely destroys knittings.
Mhh yeah it does.

Quote:
Originally Posted by Selur View Post
Thank you for posting that comparison. I'd be surprised if there was any solution without trade-offs here. (Without manually masking scenes, ofcourse)

Quote:
Originally Posted by tormento View Post
What GPU do you have and how many fps can you achieve?
I don't remember the exact FPS. But I think it was almost realtime, depending on the resolution, on my Radeon RX 6950 XT. Relative performance has my GPU 3 to 4 times faster. BUT if you can find the filter with cuda, that gap should be smaller.

Last edited by takla; 19th October 2024 at 00:51.
takla is offline   Reply With Quote
Old 19th October 2024, 10:55   #3017  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,823
Quote:
Originally Posted by takla View Post
Thank you for posting that comparison. I'd be surprised if there was any solution without trade-offs here. (Without manually masking scenes, ofcourse)
BM3D did the trick.

Very short script indeed.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 19th October 2024, 21:25   #3018  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,503
@tormento: Have you tried using simple fft3dfilter? (https://imgsli.com/MzA5NDk4)
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 19th October 2024, 22:28   #3019  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,823
Quote:
Originally Posted by Selur View Post
@tormento: Have you tried using simple fft3dfilter? (https://imgsli.com/MzA5NDk4)
Send your script, please.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 20th October 2024, 07:08   #3020  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,503
I just called FFT3DFilter with the default parameters. (you can tweak the setting for stronger denoising and add deband to add some noise in places that otherwise will might cause banding when encoding with 8bit)
Code:
ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("F:\Hybrid\64bit\Avisynth\avisynthPlugins\LoadDll.dll")
LoadPlugin("F:\Hybrid\64bit\Avisynth\avisynthPlugins\FFT3DFilter.dll")
LoadDLL("F:\Hybrid\64bit\Avisynth\avisynthPlugins\libfftw3f-3.dll")
LoadPlugin("F:\Hybrid\64bit\Avisynth\avisynthPlugins\LSMASHSource.dll")
Import("F:\Hybrid\64bit\Avisynth\avisynthPlugins\mtmodes.avsi")
# loading source: C:\Users\Selur\Desktop\Girl_01_14828-14882.mkv
# color sampling YV12@8, matrix: bt709, scantyp: progressive, luminance scale: limited
LWLibavVideoSource("C:\Users\Selur\Desktop\Girl_01_14828-14882.mkv",cache=false,format="YUV420P8", prefer_hw=0,repeat=true)
# current resolution: 1920x1080
FFT3DFilter(interlaced=false)
# Converting from 8 to 10bit for encoder
ConvertBits(10)
# setting output fps to 23.976fps
AssumeFPS(24000,1001)
PreFetch(16)
#  output: color sampling YV12@10, matrix: bt709, scantyp: progressive, luminance scale: limited
return last
Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Reply

Tags
avisynth, dogway, filters, hbd, packs

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:33.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.