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. |
20th July 2014, 20:16 | #1 | Link |
Registered User
Join Date: Dec 2011
Posts: 354
|
nnedi3 shift
I'm upscaling a dvd to 720p, I needed yv24 colorspace for further part of my script.
I'm using this script Code:
#Source ColorMatrix("Rec.601->Rec.709",clamp=0) y=ConvertToY8().nnedi3_rpow2(2).Dither_convert_8_to_16().dither_resize16(1280,720,kernel="bilinear",invks=true).Ditherpost() u=UToY8().nnedi3_rpow2(4).Dither_convert_8_to_16().dither_resize16(1280,720,kernel="bilinear",invks=true).Ditherpost() v=VToY8().nnedi3_rpow2(4).Dither_convert_8_to_16().dither_resize16(1280,720,kernel="bilinear",invks=true).Ditherpost() YToUV(u,v,y) Last edited by bxyhxyh; 21st July 2014 at 04:16. |
21st July 2014, 02:43 | #2 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
Add the center shift argument to nnedi3_rpow2, and no chroma shift correction will be needed:
Code:
nnedi3_rpow2(2, cshift="Spline16Resize") - I tested your script sans dither calls, for simplicity - I tested at 4x enlargement to exaggerate the artifacts. The output looks great; this is a good idea! - nnedi3_rpow2 does not accept Y8, only YV12, YUY2 and RGB24 - at least for me. Code:
## source = YV12 y=nnedi3_rpow2(4, cshift="Spline16Resize") u=UToY8.ConvertToYV12 \ .nnedi3_rpow2(8, cshift="Spline16Resize") v=VToY8.ConvertToYV12 \ .nnedi3_rpow2(8, cshift="Spline16Resize") YToUV(u, v, y) ## output=YV24 Last edited by raffriff42; 22nd July 2014 at 13:08. |
21st July 2014, 03:05 | #3 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,671
|
The updated nnedi3 accepts the additional planar colorspaces. Also, VToY() is probably better than VToY8.ConvertToYV12.
|
21st July 2014, 07:16 | #5 | Link | ||
Registered User
Join Date: Mar 2014
Posts: 308
|
Quote:
Quote:
Also, nnedi3_resize16 is a thing and it probably already handles converting from 4:2:0 to 4:4:4 using nnedi3 for upscaling correctly. |
||
21st July 2014, 10:50 | #6 | Link |
Registered User
Join Date: Dec 2011
Posts: 354
|
I've changed my script to this
Code:
y=converttoy8().nnedi3_rpow2(2,cshift="spline16resize").dither_convert_8_to_16().dither_resize16(1280,720,kernel="bilinear",invks=true).ditherpost() u=utoy8().nnedi3_rpow2(4,cshift="spline16resize").dither_convert_8_to_16().dither_resize16(1280,720,0.25,kernel="bilinear",invks=true).ditherpost() v=vtoy8().nnedi3_rpow2(4,cshift="spline16resize").dither_convert_8_to_16().dither_resize16(1280,720,0.25,kernel="bilinear",invks=true).ditherpost() YToUV(u,v,y) |
21st July 2014, 15:14 | #8 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,671
|
I forgot that nnedi3_resize16 does colorspace conversion. For learning purposes I compared nnedi3_resize16(1280,720, output="YV24") against a manual conversion. The following seems to produce the closest output between the 2.
Code:
Y = ConvertToY8().nnedi3_rpow2(2).Dither_convert_8_to_16().Dither_resize16(1280,720, src_left=-0.5, src_top=-0.5).Ditherpost(mode=6) U = UToY8().nnedi3_rpow2(4).Dither_convert_8_to_16().Dither_resize16(1280,720, src_left= 0.5, src_top=-0.5).Ditherpost(mode=6) V = VToY8().nnedi3_rpow2(4).Dither_convert_8_to_16().Dither_resize16(1280,720, src_left= 0.5, src_top=-0.5).Ditherpost(mode=6) YToUV(U, V, Y) |
Tags |
chromashift, nnedi3 |
Thread Tools | Search this Thread |
Display Modes | |
|
|