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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th March 2014, 08:44   #741  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Quote:
Originally Posted by feisty2 View Post
are you planning on porting nnedi3 to high bit depth too?
No, other people took charge of it, I’ll leave it to them.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 23rd April 2014, 00:25   #742  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
One dude, how I can use below script with dither, for use high-bitdepth in his processing. Thanks.

Code:
ColorYUV( gain_y=-10, off_y=0, gamma_y=-8, cont_y=0,\
	  gain_u=4, off_u=0.0, gamma_U=-5, cont_u=0,\
	  gain_v=-4, off_v=0.0, gamma_v=-5, cont_v=0)
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 1st May 2014, 19:52   #743  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Overdrive80:

The code below should emulate ColorYUV in 16 bits:
Code:
Dither_convert_8_to_16 ()
Dither_lut16 (
\   yexpr=coloryuv_to_expr16 (-10, 0, -8, 0),
\   uexpr=coloryuv_to_expr16 (  4, 0,  0, 0),
\   vexpr=coloryuv_to_expr16 ( -4, 0,  0, 0),
\   y=3, u=3, v=3)
DitherPost ()

Function coloryuv_to_expr16 (float gain, float off, float gamma, float cont)
{
	pscale = 256.0
	vscale = 65536
	a = String ((gain + pscale) / pscale)
	c = String ((cont         ) / pscale)
	o = String (off)
	g = String (pscale / (gamma + pscale))
	v = String (vscale)
	h = String (vscale / 2)

	e = "x "+a+" * x "+h+" - "+c+" * + "+o+" + "+v+" / "+g+" ^ "+v+" *"

	return (e)
}
Set gamma_u and gamma_v to 0, they are ignored in the original ColorYUV.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 2nd May 2014, 02:43   #744  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
Thanks for your answer. ^^
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 10th May 2014, 13:33   #745  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by cretindesalpes View Post
No, other people took charge of it, I’ll leave it to them.
Who did?

Uh, seems the line cretindesalpes was quoting didn't come through. It was about someone porting nnedi3 to 16 bit.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 15th May 2014, 17:07   #746  |  Link
Popwax
Registered User
 
Join Date: May 2014
Posts: 5
I think patched dfttest-1.9.4 have a bug handling "plane" parameters from "nfile" or "nstring".
In "vi_src.width >> vi.GetPlaneWidthSubsampling (b);", maybe we should use "1<<b" instead of "b" here.
Popwax is offline   Reply With Quote
Old 17th May 2014, 08:53   #747  |  Link
Lenchik
Registered User
 
Join Date: Nov 2005
Location: Russia
Posts: 62
Is it possible to resize using a Sigmoidal Colorspace with Dither package?
Lenchik is offline   Reply With Quote
Old 20th May 2014, 10:54   #748  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Popwax:

Yes you’re right, there’s something like this to fix it. I’ll work on it when back home.

Lenchik:

Yes it’s possible, it’s just a LUT and its inverse to add. I will probably add sigmoid curves in a next release.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 30th May 2014, 20:56   #749  |  Link
Motenai Yoda
Registered User
 
Motenai Yoda's Avatar
 
Join Date: Jan 2010
Posts: 709
Sorry, but this is right?
Quote:
Function Dither_lut16_expr (string expr, bool gmsb)
{
# We use spaces to enclose " x" because we don't want operators
# like "max" or "exp" to have their "x" replaced…
repstr = (gmsb) ? " x 256 * y + " : " y 256 * x + "
expr = Dither_replace_string (" " + expr, " x", repstr)
part = Dither_expr_part (gmsb)
expr = expr + part

return (expr)
}
what's the meaning? doesn't use lsb as msb and viceversa?
__________________
powered by Google Translator
Motenai Yoda is offline   Reply With Quote
Old 30th May 2014, 22:47   #750  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Yes, it’s to cancel the swap between the LSB and MSB input clips in the mt_lutxy parameters when processing the LSB output. I don’t remember exactly why it was needed but I think it’s to simplify the handling of the y, u and v plane parameters.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 30th May 2014, 23:16   #751  |  Link
Motenai Yoda
Registered User
 
Motenai Yoda's Avatar
 
Join Date: Jan 2010
Posts: 709
I wrote a Lutxy12 and a Lutxy16_8, can someone test them?

PHP Code:
###############################
##########  Yoda_Lutxy12  ##########
###############################

function Yoda_Lutxy12(clip srcclip src2string "expr"string "yexpr",
string "uexpr"string "vexpr"int "y"int "u"int "v")
{   
    
#needed coz if x is (n*256) -8 < x < n*256 it can't be rounded to n*256 with lsb only.
    
src_quant src.Yoda_Lutxy12_aux(y=yu=uv=vuptrue)
    
src2_quant src2.Yoda_Lutxy12_aux(y=yu=uv=vupfalse)

    
s1_msb src_quant.Dither_get_msb()
    
s1_lsb src_quant.Dither_get_lsb()
    
s2_msb src2_quant.Dither_get_msb()
    
s2_lsb src2_quant.Dither_get_lsb()

    
ss_lsb mt_adddiff(s1_lsbs2_lsby=yu=uv=v)
    
    
clip_msb Yoda_Lutxy12_get(s1_msbs2_msbss_lsbexpr,
    \ 
yexpruexprvexpryuvTrue)

    
clip_lsb Yoda_Lutxy12_get(s1_msbs2_msbss_lsbexpr,
    \ 
yexpruexprvexpryuvFalse)
    
    
stackvertical(clip_msbclip_lsb)

    
#handling chroma planes if y,u or v are 2 or 4
    
(Defined (y)) ? (== 2) ? MergeLuma(src) :
    \(
== 4) ? MergeLuma(src2) : last last

    
(Defined (u)) ? (Defined (v)) ? (== && == 2) ? MergeChroma(src) :
    \(
== 2) ? ytouv(last.utoy(),src.vtoy()) :
    \(
== 2) ? ytouv(src.utoy(),last.vtoy()) : last :
    \(
== 2) ? ytouv(src.utoy(),last.vtoy()) : last :
    \(
Defined (v) && == 2) ? ytouv(last.utoy(),src.vtoy()) : last

    
(Defined (u)) ? (Defined (v)) ? (== && == 4) ? MergeChroma(src2) :
    \(
== 4) ? ytouv(last.utoy(),src2.vtoy()) :
    \(
== 4) ? ytouv(src2.utoy(),last.vtoy()) : last :
    \(
== 4) ? ytouv(src2.utoy(),last.vtoy()) : last :
    \(
Defined (v) && == 4) ? ytouv(last.utoy(),src2.vtoy()) : last
}


function 
Yoda_Lutxy12_aux(clip srcint "y"int "u"int "v"bool "up")
{
    
expr = (up) ? "x 247 > 0 x 16 / round 16 * ?" "x 247 > 0 x 16 / round 128 + ?"
    
src_lsb=src.Dither_get_lsb()
    
lsb_l=src_lsb.Mt_lut(expry=u=uv=v)
    
lsb_r=src_lsb.Mt_lut("x 247 > 129 128 ?"y=u=uv=v)
    
msb_l=src.Dither_get_msb().mt_adddiff(lsb_ry=u=uv=v)
    
stackvertical(msb_l,lsb_l)
}

Function 
Yoda_Lutxy12_get (clip "s1_msb"clip "s2_msb"clip "ss_lsb",
\    
string "expr"string "yexpr"string "uexpr"string "vexpr",
\    
int "y"int "u"int "v"bool "gmsb")
{    
    
expr  = Default (expr,  "x")
    
yexpr = Default (yexprexpr)
    
uexpr = Default (uexprexpr)
    
vexpr = Default (vexprexpr)
    
gmsb = Default(gmsbFalse)

    
expr  Yoda_lut12_expr (expr,  gmsb)
    
yexpr Yoda_lut12_expr (yexprgmsb)
    
uexpr Yoda_lut12_expr (uexprgmsb)
    
vexpr Yoda_lut12_expr (vexprgmsb)

    
= (Defined (y) && 0) ? (gmsb) ? 256 256 y
    u 
= (Defined (u) && 0) ? (gmsb) ? 256 256 u
    v 
= (Defined (v) && 0) ? (gmsb) ? 256 256 v

    mt_lutxyz 
(s1_msbs2_msbss_lsbexpr=expryexpr=yexpr,
    \ 
uexpr=uexprvexpr=vexpry=yu=uv=v)
}

Function 
Yoda_lut12_expr (string exprbool gmsb)
{
    
repstr1 " x 256 * z z 16 % - + "
    
repstr2 " y 256 * z 16 % 16 * + " 
    
    
expr Dither_replace_string (" " expr" x"repstr1)
    
expr Dither_replace_string (" " expr" y"repstr2)
    
part Dither_expr_part (gmsb)
    
expr expr part

    
return (expr)
}

#################################
##########  Yoda_Lutxy16_8  ##########
#################################

function Yoda_Lutxy16_8(clip srcclip src2string "expr"string "yexpr",
string "uexpr"string "vexpr"int "y"int "u"int "v")
{
    
s_lsb src.Dither_get_lsb()
    
s_msb src.Dither_get_msb()
    
s2_c src2.Dither_convert_8_to_16()
    
    
clip_msb Yoda_Lutxy16_8_get(s_msbsrc2s_lsbexpr,
    \ 
yexpruexprvexpryuvTrue)
    
clip_lsb Yoda_Lutxy16_8_get(s_msbsrc2s_lsbexpr,
    \ 
yexpruexprvexpryuvFalse)
    
    
stackvertical(clip_msbclip_lsb)

    
#handling chroma planes if y,u or v are 2 or 4
    
(Defined (y)) ? (== 2) ? MergeLuma(src) :
    \(
== 4) ? MergeLuma(src2) : last last

    
(Defined (u)) ? (Defined (v)) ? (== && == 2) ? MergeChroma(src) :
    \(
== 2) ? ytouv(last.utoy(),src.vtoy()) :
    \(
== 2) ? ytouv(src.utoy(),last.vtoy()) : last :
    \(
== 2) ? ytouv(src.utoy(),last.vtoy()) : last :
    \(
Defined (v) && == 2) ? ytouv(last.utoy(),src.vtoy()) : last

    
(Defined (u)) ? (Defined (v)) ? (== && == 4) ? MergeChroma(src2) :
    \(
== 4) ? ytouv(last.utoy(),src2.vtoy()) :
    \(
== 4) ? ytouv(src2.utoy(),last.vtoy()) : last :
    \(
== 4) ? ytouv(src2.utoy(),last.vtoy()) : last :
    \(
Defined (v) && == 4) ? ytouv(last.utoy(),src2.vtoy()) : last


Function 
Yoda_Lutxy16_8_get (clip "s1_msb"clip "src2"clip "s1_lsb",
\    
string "expr"string "yexpr"string "uexpr"string "vexpr",
\    
int "y"int "u"int "v"bool "gmsb")
{    
    
expr  = Default (expr,  "x")
    
yexpr = Default (yexprexpr)
    
uexpr = Default (uexprexpr)
    
vexpr = Default (vexprexpr)
    
gmsb = Default(gmsbFalse)

    
expr  Yoda_lut16_8_expr (expr,  gmsb)
    
yexpr Yoda_lut16_8_expr (yexprgmsb)
    
uexpr Yoda_lut16_8_expr (uexprgmsb)
    
vexpr Yoda_lut16_8_expr (vexprgmsb)

    
= (Defined (y) && 0) ? (gmsb) ? 256 256 y
    u 
= (Defined (u) && 0) ? (gmsb) ? 256 256 u
    v 
= (Defined (v) && 0) ? (gmsb) ? 256 256 v

    mt_lutxyz 
(s1_msbsrc2s1_lsbexpr=expryexpr=yexpr,
    \ 
uexpr=uexprvexpr=vexpry=yu=uv=v)
    
}

Function 
Yoda_lut16_8_expr (string exprbool gmsb)
{
    
repstr1 " x 256 * z + "
    
repstr2 " y 256 * "
    
expr Dither_replace_string (" " expr" x"repstr1)
    
expr Dither_replace_string (" " expr" y"repstr2)
    
part Dither_expr_part (gmsb)
    
expr expr part

    
return (expr)

removed all ">>" "<<" stuff to make them faster.
__________________
powered by Google Translator

Last edited by Motenai Yoda; 6th June 2014 at 01:50. Reason: add Lutxy12_aux
Motenai Yoda is offline   Reply With Quote
Old 3rd June 2014, 22:58   #752  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Dither 1.26.0:
  • Modded versions of dfttest and MVTools2 aren’t bundled with Dither anymore. Get them separately (at the same location).
  • Added sigmoid curves to Dither_y_gamma_to_linear and Dither_y_linear_to_gamma.
  • Added Dither_sigmoid_direct and Dither_sigmoid_inverse functions.
  • Added the sigmoid parameter to Dither_srgb_display.
  • Dither_y_gamma_to_linear and Dither_y_linear_to_gamma now process data contained in the chroma planes when u or v are set to 3, instead of just copying them.
— * —

Motenai Yoda:

Thanks. I’ll check it later.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 9th June 2014, 08:39   #753  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 940
Quote:
Originally Posted by cretindesalpes View Post
Dither 1.26.0
Quote:
Originally Posted by cretindesalpes View Post
dither-1.26.1
<strike>Is the update a minor thing? I hadn't even noticed it changed versions until I had to update my laptop (low priority udpates).</strike>

EDIT: Ah, the small change doesn't affect my normal work environment.

Here's what the changelog says in the doc for those who are interested:
Quote:
v1.26.1, 2014.06.05

Fixed a wrong saturation in Dither_sub16 on the last pixels of a clip whose width is not mod-8.
__________________
Win10 (x64) build 19041
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)

Last edited by Sparktank; 9th June 2014 at 08:43. Reason: found changelog
Sparktank is offline   Reply With Quote
Old 30th June 2014, 20:57   #754  |  Link
Motenai Yoda
Registered User
 
Motenai Yoda's Avatar
 
Join Date: Jan 2010
Posts: 709
@cretindesalpes can u optimize luts by set uexpr and vexpr?

if expr is set then even with u=1, v=1 or chroma="copy", uexpr and vexpr will be calculated (at least with 06_taro's mod).

ie
yexpr = (Defined (y) && (y != 3)) ? "x" : yexpr
uexpr = (Defined (u) && (u == 3)) ? uexpr : "x"
vexpr = (Defined (v) && (v == 3)) ? vexpr : "x"
__________________
powered by Google Translator

Last edited by Motenai Yoda; 30th June 2014 at 21:04.
Motenai Yoda is offline   Reply With Quote
Old 1st July 2014, 05:47   #755  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
Calculating uexpr and vexpr is effectively free since it only happens during initialisation unless you're using Dither_lut16/etc. in ScriptClip (or other runtime filtering scenarios).

In that case, what you should be doing is to figure out how to avoid runtime filtering instead of performing what would be a microoptimisation for normal people doing normal filtering.

Edit: Someone reminded me that tp7's Masktoolsv2 fork doesn't generate unnecessary LUTs, which may be more relevant than what I wrote above.

Last edited by colours; 1st July 2014 at 22:23.
colours is offline   Reply With Quote
Old 2nd July 2014, 04:25   #756  |  Link
Motenai Yoda
Registered User
 
Motenai Yoda's Avatar
 
Join Date: Jan 2010
Posts: 709
Quote:
Originally Posted by colours View Post
Calculating uexpr and vexpr is effectively free since it only happens during initialisation unless you're using Dither_lut16/etc. in ScriptClip (or other runtime filtering scenarios).
yep but for some of my scripts it takes up to 30 mins to initialize (without any ScriptClip).


Quote:
Originally Posted by colours View Post
Edit: Someone reminded me that tp7's Masktoolsv2 fork doesn't generate unnecessary LUTs, which may be more relevant than what I wrote above.
I definitively will try it!
That guy is making a lot of interesting stuff.
__________________
powered by Google Translator
Motenai Yoda is offline   Reply With Quote
Old 3rd July 2014, 15:31   #757  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,582
Quote:
Originally Posted by Motenai Yoda View Post
I definitively will try it!
That guy is making a lot of interesting stuff.
Any compiled build around to test?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 3rd July 2014, 17:33   #758  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by tormento View Post
Any compiled build around to test?
Check under the GitHub release section; also for future reference this is the discussion thread: http://forum.doom9.org/showthread.php?t=169832
Reel.Deel is offline   Reply With Quote
Old 4th August 2014, 18:51   #759  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Just thought I'de point out that FFTW library used by eg FFT3DFilter as fftw3.dll and dftTest as libfftw3f-3.dll (same dll, just different name)
has been updated twice since the one included in dither tools. Last update March 16 2014, v3.3.4. http://www.fftw.org/
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 4th August 2014 at 19:05.
StainlessS is offline   Reply With Quote
Old 17th August 2014, 02:03   #760  |  Link
TheProfileth
Leader of Dual-Duality
 
TheProfileth's Avatar
 
Join Date: Aug 2010
Location: America
Posts: 134
I would like to report a bug regarding Dither_median16 when I use dither_median16 if I set rt=0 and setting rx=1 and ry =1 then the output seems to be broken like it is all black except for about one line, however if I set rx and ry to something higher than 1 and leave rt set to 0 it outputs as expected, the same happens if you simply set rt=1 while rx=1 and ry=1. The weird thing about this behavior is that you can only exhibit it by using the default settings of the function which specifically say
Quote:
Dither_median16 (
clip src,
int rx (1),
int ry (1),
int rt (0),

int ql (undefined),
int qh (undefined),
int y,
int u,
int v
)
I used this to repeatedly recreate the problem
Quote:
Dither_convert_8_to_16
Dither_median16()
ditherpost(mode=-1)
__________________
I'm Mr.Fixit and I feel good, fixin all the sources in the neighborhood
My New filter is in the works, and will be out soon

Last edited by TheProfileth; 17th August 2014 at 02:05.
TheProfileth is offline   Reply With Quote
Reply

Tags
color banding, deblocking, noise reduction


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 20:25.


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