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. |
12th April 2012, 13:01 | #461 | Link |
Registered User
Join Date: Jul 2008
Posts: 131
|
Code:
DGSource("D:\magnum\title00.dgi",fieldop=0) crop(0, 4, 0, -4) LanczosResize(640,480) tr = 6 # Temporal radius super = MSuper (pel=2) multi_vec = MAnalyse (super, multi=true, delta=tr) MDegrainN (super, multi_vec, tr, thSAD=400, thSAD2=150) Because I see in the examples overlap is used in MAnalyse, when using MDegrain2/3 |
12th April 2012, 21:13 | #462 | Link | |
soy sauce buyer
Join Date: Mar 2010
Location: United Kingdom
Posts: 164
|
Quote:
Code:
Dither_resize16(dest_width, dest_height, kernel="Spline64") \ .MergeChroma(Dither_resize16(dest_width, dest_height, kernel="Bicubic", a1=0.75, a2=0.25)) |
|
13th April 2012, 08:57 | #463 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
cybersharky:
No, the temporal radius has nothing to do with the overlap. However, omitting the overlap (default is 0) may cause blocking-like artifacts.[/QUOTE] Lenchik / 06_taro: Thank you for the suggestions. Actually I prefer keeping the resizer function "simple", and use scripting for the non-linear parts and plane recombination. Anyway I will add a built-in function for colorspace conversions (including simple chroma subsampling conversions) probably in combination with resizing, because scripting these things is quite complicated and not very efficient. In your example you could use the plane filters to avoid unnecessary computations that will be thrown out: Code:
Dither_resize16(dest_width, dest_height, kernel="Spline64", u=1, v=1) \ .MergeChroma(Dither_resize16(dest_width, dest_height, kernel="Bicubic", y=1, a1=0.75, a2=0.25))
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
14th April 2012, 00:29 | #464 | Link |
soy sauce buyer
Join Date: Mar 2010
Location: United Kingdom
Posts: 164
|
Agree with keeping the resizer "simple". And applying such a filter on 8-bit clip and adding the diff is usually enough in terms of visual effect. But if the aimed output clip is 16-bit, would it result in some artefacts in LSB, such as mosquito around edges for deringing? And although such artefacts in LSB shouldn't be noticeable after dithered to 8-bit, I'm worried if they may reduce the efficiency of compression.
|
14th April 2012, 07:25 | #465 | Link |
Registered User
Join Date: Nov 2005
Location: Russia
Posts: 62
|
Same questions as 06_taro's but for aiming output in 10 bit to 10 bit x264 build.
|
14th April 2012, 12:26 | #466 | Link | |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Quote:
Below is a quick attempt. I adopted a slightly different approach than just adding the 8-bit difference. Code:
# Gradient amt_l = 0.25 amt_c = 0.125 BlankClip (length=1, width=640, height=480, pixel_type="YV12", color_yuv=$000000) KillAudio () base = last x = "x 0.5 - 32768 * "+String(amt_c)+" * 32768 + 0 65535 clip " y = "y 0.5 - 32768 * "+String(amt_c)+" * 32768 + 0 65535 clip " z = "x y + 1 - 32768 * "+String(amt_l)+" * 32768 + 0 65535 clip " msb = base.mt_lutspa (mode="relative", yexpr=z+"8 >>u 255 &u", uexpr=x+"8 >>u 255 &u", vexpr=y+"8 >>u 255 &u", y=3, u=3, v=3) lsb = base.mt_lutspa (mode="relative", yexpr=z+" 255 &u", uexpr=x+" 255 &u", vexpr=y+" 255 &u", y=3, u=3, v=3) # Text txt = msb txt = txt.Subtitle ("This is a test.\n\n--\\||//@=#§", align=5, lsp=1, text_color=$E0E020, halo_color=$202020) txt = txt.Subtitle ("\nTest with light ringing.", align=5, lsp=1, text_color=$848484, halo_color=$808080) msk = mt_lutxy (msb, txt, "x y != 255 0 ?", y=3, u=3, v=3) lsb = mt_merge (lsb, base, msk, y=3, u=3, v=3) msb = txt StackVertical (msb, lsb) # Rings. Source: http://www.imagemagick.org/Usage/img_photos/rings_lg_orig.png rings = ImageSource ("rings_lg_orig.png").Trim (0, -1) rings = rings.ConvertToYV12 ().Crop (0, 0, 0, base.Height ()).Dither_convert_8_to_16 () StackHorizontal (last, rings) # Resize dw = Width() * 2 dh = Height()/2 * 2 main = Dither_resize16 (dw, dh, kernel="Spline64" ) nrng = Dither_resize16 (dw, dh, kernel="Gauss", a1=100) m8 = main.DitherPost (mode=-1) n8 = nrng.DitherPost (mode=-1) f8 = m8.Repair (n8, 1) k8 = mt_lutxy (m8, f8, "x y != 255 0 ?", y=3, u=3, v=3) f16 = f8.Dither_convert_8_to_16 () f16 = nrng.Dither_limit_dif16 (f16, thr=0.5) Dither_merge16_8 (main, f16, k8, y=3, u=3, v=3) # Display main.Subtitle ("Spline64") + last.Subtitle ("nrSpline64") DitherPost (mode=6) last \ + mt_lut (expr="x 16 &u 17 x 15 &u - 1 x 15 &u + ? 14 *", u=-128, v=-128) \ + k8.GreyScale ().Subtitle ("Ringmask")
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
|
29th April 2012, 16:04 | #467 | Link |
Registered User
Join Date: Oct 2009
Posts: 212
|
Hey cretindesalpes. Since I'm using a lot of your functions from Dither package, I decided to incorporate Dither_resize16 in my general workflow. Now I want to produce the same output as ResampleHQ, meaning gamma aware resizing, and I wanted to check if I got it correctly:
Dither_convert_8_to_16 () Dither_y_gamma_to_linear() Dither_resize16(w, h, kernel="blackman", taps=5) - I'm using Blackman as my resizer for Bluray sources where I resize down to 720p. Dither_y_linear_to_gamma() Ditherpost(mode=-1,ampo=0,ampn=0) As you can see my sources are YV12. Is this ok? |
29th April 2012, 17:54 | #468 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Code:
Dither_convert_yuv_to_rgb (matrix="709", output="rgb48y") Dither_y_gamma_to_linear (curve="709", u=1, v=1) Dither_resize16 (w, h, kernel="blackman", taps=5, u=1, v=1) Dither_y_linear_to_gamma (curve="709", u=1, v=1) Dither_convert_rgb_to_yuv ( \ SelectEvery (3, 0), SelectEvery (3, 1), SelectEvery (3, 2), \ matrix="709", mode=-1)
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
29th April 2012, 18:43 | #469 | Link | |
Registered User
Join Date: Oct 2009
Posts: 212
|
Quote:
Code:
Dither_convert_yuv_to_rgb (matrix="709", output="rgb48y") Dither_y_gamma_to_linear (curve="709", u=1, v=1) Dither_resize16 (w, h, kernel="blackman", taps=5, u=1, v=1) Dither_y_linear_to_gamma (curve="601", u=1, v=1) Dither_convert_rgb_to_yuv ( \ SelectEvery (3, 0), SelectEvery (3, 1), SelectEvery (3, 2), \ matrix="601", mode=-1) Last edited by SilaSurfer; 29th April 2012 at 18:51. |
|
29th April 2012, 21:13 | #470 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Yes for Dither_convert_rgb_to_yuv(), but keep "709" in Dither_y_linear_to_gamma(). This is the same transfer characteristic anyway. I just should add an alias for convenient use.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
1st May 2012, 15:18 | #472 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Dither 1.16.0:
——— Edit ——— SilaSurfer: Code:
# Equivalent to mt_convolution (horizontal="1 5 -1 7 -1 5 1", vertical="1", u=3, v=3) for stack16 clips w = Width () h = Height () / 2 Dither_resize16 (w, h, kernelh="impulse 1 5 -1 7 -1 5 1", fh=-1, center=false)
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding Last edited by cretindesalpes; 1st May 2012 at 18:06. Reason: Oops height / 2 of course |
1st May 2012, 17:24 | #474 | Link | |
Registered User
Join Date: Oct 2009
Posts: 212
|
Quote:
|
|
1st May 2012, 17:42 | #475 | Link |
Registered User
Join Date: Oct 2009
Posts: 212
|
Code:
Dither_convert_8_to_16 () Dither_resize16 (1280, 720, kernel="impulse -1 6 -1", \ fh=-1, fv=-1, cnorm=true, center=false) DitherPost (mode=-1) Code:
Dither_convert_8_to_16 () Dither_resize16 (Width (), Height () / 2, kernel="impulse -1 6 -1", \ fh=-1, fv=-1, cnorm=true, center=false, y=3, u=2, v=2) DitherPost () Last edited by SilaSurfer; 1st May 2012 at 19:51. |
1st May 2012, 19:37 | #476 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,733
|
Out of interest: have you had any chance to look at the improvements made to MVTools v2 by the SVP team?
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
2nd May 2012, 09:42 | #477 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Not yet. But I'll have a look when possible.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
2nd May 2012, 11:12 | #478 | Link | |
Registered User
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 805
|
Quote:
|
|
2nd May 2012, 13:58 | #479 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
It’s not for resizing, it’s for gamma correction (to do things correctly).
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
Tags |
color banding, deblocking, noise reduction |
|
|