Skip to content

Commit

Permalink
QTGMC() - Update. Click for log
Browse files Browse the repository at this point in the history
- Update to latest ExTools
- Added 'fulls' to ConvertBits()
- Replaced blurs with ex_GaussianBlur()
- Some Expr optimizations
- Add back deleted Precise arg, typo
- Add back UV=3 to tmax and tmin, typo
- Removed bomt var
- Removed keep_tv_range limiter
- 32-bit support is still not working (WIP)
  • Loading branch information
Dogway committed Sep 9, 2021
1 parent 6591cd0 commit 9868258
Showing 1 changed file with 242 additions and 309 deletions.
Loading

13 comments on commit 9868258

@realfinder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep_tv_range was added because https://forum.doom9.org/showthread.php?p=1915639&highlight=keep_tv_range#post1915639 so why remove it?

bomt var is there since mvtools mt is not perfect "when internal multithreading is used (avstp + mt=true), inconsistencies will still occur by design." as said here https://github.com/pinterf/mvtools/releases/tag/2.7.44 so people can set mvtools mt to false with "Global set_plugins_threads = 1" in the top of encode script or https://forum.doom9.org/showthread.php?p=1921381&highlight=Global+set_plugins_threads#post1921381

@Dogway
Copy link
Owner Author

@Dogway Dogway commented on 9868258 Sep 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the links, I will try to find out where the levels get mangled and fix it in place if possible or add limiter embedded to an expression at the end. In any case I want to cut the arg because there are too many. On long term I plan to implement gamut compression with an RGB roundtrip so YUV lives in RGB space.

mt=true is ignored if you don't have avstp in your path. If you have it I assume you want to use it. gispos refused to add a header option for all scripts so it makes matters worse.

@realfinder
Copy link
Contributor

@realfinder realfinder commented on 9868258 Sep 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to cut the arg because there are too many

then I did remove one of them #21
you can also combine EdiThreads and FftThreads in one "Threads" also make mvtools use it as "Threads=1" = "mt=false" for mvtools, also make it same as

Threads = Default( Threads, sh_GetUserGlobalIMTint(true))

@realfinder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESearchP can also be removed, https://github.com/realfinder/AVS-Stuff/issues?q=is%3Aissue+author%3Aerazortt+qtgmc either by change how the "placebo, very slow and slow" Presets works or add new Presets as "Eplacebo , Every slow and Eslow" or better names

@realfinder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also what the point of having both fulls and TV_range?! I think one of them should be removed

also if you readd keep_tv_range, then it's better to name it as "keep_in_range" here why Asd-g/AviSynthPlus-Scripts#2 (comment)

@realfinder
Copy link
Contributor

@realfinder realfinder commented on 9868258 Sep 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and for even more "cut the arg" then "String "device_type", int "device_id"" can be one string KNLM_params same as https://github.com/realfinder/AVS-Stuff/blob/5a07ecf2fbb455bcddaca8708e62f4d3b17d73c6/avs%202.5%20and%20up/dfttestMC_and_MC_things.avsi#L34 so the use will be like QTGMC( KNLM_params = ",device_id=1" ) or QTGMC( KNLM_params = """,device_type="gpu", device_id=1""" )

@Dogway
Copy link
Owner Author

@Dogway Dogway commented on 9868258 Sep 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the advices, I will have a look after I upload ExTools, hopefully today.
I would have to revise but does sh_GetUserGlobalIMTint() falls back to 1 if it fails to detect threads?

About 'fulls' and 'tv_range' is a topic of contemption, while developing TransformsPack that reasoning didn't work for me so I made the look up table.
8-bit 16-bit
235 -> 60160.,60395.
255 -> 65280.,65535.

As you can see TV range white and PC range white differs depending on bit scale.
If you know what you do, you can use ConvertBits(16, fulls=true) and propagate fulls=true to your calls and you will gain 1 byte extra of precision. Unless I'm explained better this is what works for me.

@realfinder
Copy link
Contributor

@realfinder realfinder commented on 9868258 Sep 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if sh_GetUserGlobalIMTint fails to detect threads and setzero=false it will give Undefined() and it will give "0" with setzero=true

I do suggest use fmtc_bitdepth instead of ConvertBits, fmtc_bitdepth can read frame properties and has more options for dither and also the output of it's "int to float" and "float to int" correct

@Dogway
Copy link
Owner Author

@Dogway Dogway commented on 9868258 Sep 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated: 819d3bd
The chroma issue was because it's being sharpened in backblend1, sharpening chroma is never a good idea, I can try to do some saturation recovery and/or chroma reconstruction (for "sharpness") at a later point.
I also tweaked defaults a little so now this is more than just performance optimizations, I followed some zorr findings but I will try to run my own and promote those to QTGMC and SMDegrain.
fmtc_bitdepth, I rarely dither for internal operations, I will have a deeper look to it when I get into the nitty gritty in TransformPack.

@realfinder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmtc_bitdepth, I rarely dither for internal operations,

I just note that you use no dither for n16 and n16d! this make using n16 and n16d useless because the plugin already did no dither without them anyway, the point of n16 and n16d is to get higher quality 8bit (no banding) in first place!

@Dogway
Copy link
Owner Author

@Dogway Dogway commented on 9868258 Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean, prefilter in 16-bit prior to MAnalyse? Sounds good to me, but it isn't dithering what prevents banding but filtering in HBD (ie. bilateral, etc), if later you round to 8-bit that's just fine for MAnalyse (and enough to prevent prefiltering banding).
If you make a PR I will merge it.

@realfinder
Copy link
Contributor

@realfinder realfinder commented on 9868258 Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean

dnwindow = (NoiseProcess != 0) && n16d ? dnwindow.ConvertBits(bi,dither=-1,fulls=fs) : dnwindow
and
degrain1 = (TR1 > 0) ? n16 ? degrain1.ConvertBits(8,dither=-1,fulls=fs) : degrain1 : degrain1
and
stable = (TR2 > 0) ? n16 ? stable.ConvertBits(8,dither=-1,fulls=fs) : stable : stable

and if you add float 32bit, an error message need if user set n16d to true

edit: or better even with 16bit like this Assert(!(n16d && sbpc >= 16), "QTGMC: n16d should not be used with 16bit or better clip")

@Dogway
Copy link
Owner Author

@Dogway Dogway commented on 9868258 Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would try to avoid asserts if possible because it interrupts user experience. Just add a ternary.
To be honest I would have removed the n16 settings because I don't see the point, if you want HBD quality you just use an HBD input.

If you see value make a PR so I can merge it, I only need ConvertBits(8,dither=-1,fulls=fs) for MAnalyse if input is HBD and n16 is not being enabled.

Please sign in to comment.