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. |
![]() |
#61 | Link | ||
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,378
|
Quote:
![]() Of course separate luma and chroma doubling (only doubling luma) has always been better in my tests but if it is low effort maybe a special case for the future when we can all run NNEDI3 256 Luma + Chroma doubling? Or does the math workout the same either way? Quote:
![]() |
||
![]() |
![]() |
![]() |
#62 | Link | ||
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#63 | Link | ||
Registered User
Join Date: Dec 2013
Posts: 753
|
Quote:
Quote:
It seems that this is also the reason I thought NEDI looked superior, and it may be the reason that improving chroma upscaling seemed to slightly improve the luma upscaling in some of those images. |
||
![]() |
![]() |
![]() |
#64 | Link | ||
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#65 | Link |
Registered User
Join Date: Dec 2013
Posts: 753
|
It seems that the current versions of the ChromaNEDI shaders only use the directional information very weakly, apparently this is still enough to outperform most other algorithms but it causes a loss of detail. I think I've been able to fix this using a few of the same tricks I used in the NEDI shaders (and then some). I'll post these improved versions and a couple of comparisons when I have time, they still require some fine-tuning.
Edit: Later I'll post a more detailed explanation of what I changed but first some comparisons between the new and old method: (Chroma only) New method Old method Bicubic With luma One thing I find worrying is that Bicubic seems to be shifted slightly to the left, I've been unable to confirm if this is correct. For my implementation I assumed that the chroma channel corresponded to the average of each 2x2 block. Last edited by Shiandow; 10th June 2014 at 20:05. Reason: Added examples |
![]() |
![]() |
![]() |
#66 | Link | |
Registered User
Join Date: May 2009
Posts: 212
|
Quote:
[High-frequency details] New method > Bicubic >> Old method [Low-frequency details] Bicubic > New method > Old method This time I use the Sony Fit 11A's 11.6" 1920x1080 to view these samples. This monitor's backlit is QD-LED --- so richer colors than most LCD monitors, and more similar to a good TV set. But it has ridiculous high gamma value by factory default setting. The object / skin-tone colors also look weird (too vivid) if its RGB LUT settings are not adjusted in the display driver. Anyway it looks impressive with your new method's sample on this monitor. The little dinosaur's head looks more pop/stereo. The girl's hair colors are also distinguishable one by one even on such small-sized FHD panel. |
|
![]() |
![]() |
![]() |
#67 | Link | |
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
Quote:
chroma placement image |
|
![]() |
![]() |
![]() |
#68 | Link | |
Registered User
Join Date: Dec 2013
Posts: 753
|
Quote:
Edit: Well luckily that was somewhat easy to fix, and the resulting image is definitely better. Last edited by Shiandow; 12th June 2014 at 11:39. |
|
![]() |
![]() |
![]() |
#69 | Link | |
Kid for Today
Join Date: Aug 2004
Posts: 3,477
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#70 | Link |
Registered User
Join Date: Dec 2013
Posts: 753
|
Allright, I think the improved chroma shaders are now more or less ready. The new shaders only use a 2nd order interpolation instead of a 4th order, the linear equation that you needed to solve for a 4th order interpolation has the annoying property that it becomes unstable if you get close to an edge, which means that you either have a lot of artefacts or you can only use the directional information very weakly. The new shaders also use a more stable method for solving these equations which also reduces artefacts. I've also added a smarter way of limiting the resulting coefficients, which forces the chroma intensity to stay the same and prevents it from interpolating too strongly in one direction.
I'll add the new shaders to the first post. By the way, the only purpose of the third shader is to shift the chroma channel half a pixel upwards; it would probably be better to do this simultaneously with scaling. |
![]() |
![]() |
![]() |
#72 | Link | |
Registered User
Join Date: Dec 2013
Posts: 753
|
Quote:
Code:
// $MinimumShaderProfile: ps_3_0 sampler s0 : register(s0); float4 p0 : register(c0); #define width (p0[0]) #define height (p0[1]) #define px (1.0 / (p0[0])) #define py (1.0 / (p0[1])) #define sqr(x) (dot(x,x)) #define I (float2x2(1,0,0,1)) //Conjugate residual float2 solve(float2x2 A,float2 b) { float2 x = 1/2.0; float2 r = b - mul(A,x); float2 p = r; float2 Ar = mul(A,r); float2 Ap = Ar; for (int k = 0;k < 3; k++){ float a = min(100,dot(r,Ar)/dot(Ap,Ap)); x = x + a*p; float2 rk = r; float2 Ark = Ar; r = r - a*Ap; Ar = mul(A,r); float b = dot(r,Ar)/dot(rk,Ark); p = r + b*p; Ap = Ar + b*Ap; } return x; } float4 toRGB(float4 s1) { s1.yz -= 0.5; if(width < 1120 && height < 630) return float3(s1.x+1.402*s1.z, dot(s1, float3(1, -.202008/.587, -.419198/.587)), s1.x+1.772*s1.y).rgbb;// SD Y'CbCr to RGB output return float3(s1.x+1.5748*s1.z, dot(s1, float3(1, -.1674679/.894, -.4185031/.894)), s1.x+1.8556*s1.y).rgbb;// HD Y'CbCr to RGB output } #define Col(xy) (tex2D(s0,tex+float2(px,py)*(xy)).yz-0.5) #define Get(xy) (tex2D(s0,tex+float2(px,py)*(xy)).x+0.25) #define Get4(xy) (float2(Get(xy+dir[0]),Get(xy+dir[1]))) float4 main(float2 tex : TEXCOORD0) : COLOR { float4 c0 = tex2D(s0,tex); float2 dir[2] = {{-1,0},{1,0}}; float2 wind[4] = {{-1,0},{1,0},{0,1},{0,-1}}; float2 pos[2] = {{0,0},{1,0}}; float w = 2; float2x2 R = w*mul(float2x1(Get4(0)),float1x2(Get4(0))); float2 r = w*Get(0)*Get4(0); float4x2 C = {Get4(wind[0]),Get4(wind[1]),Get4(wind[2]),Get4(wind[3])}; float4 y = {Get(wind[0]),Get(wind[1]),Get(wind[2]),Get(wind[3])}; R += mul(transpose(C),C); r += mul(y,C); //Normalize coefficients float n = 16; R/= n; r /= n; //Solve equations float2 a = solve(R+0.000001*I,r); //Limit the coefiicents of a float2 b = float2(a[0]+a[1]-1,a[0]-a[1]); b[0] = clamp(b[0],-.02,.02); //Clamp intensity b[1] = clamp(b[1],-1,1); //Clamp "directedness" a = .5 + float2(.5,.5)*b[0] + float2(.5,-.5)*b[1]; c0.a = dot(c0.gb,1); c0.gb = 0.5+mul(a,float2x2(Col(pos[0]),Col(pos[1]))); return toRGB(c0); } Last edited by Shiandow; 12th June 2014 at 15:03. Reason: It shifted things in the wrong direction, it should be fixed now. |
|
![]() |
![]() |
![]() |
#73 | Link |
Registered User
Join Date: Apr 2014
Posts: 48
|
Running the chroma shaders in MPC-HC in pre-resize in order, the first two blur the image, and with the third one the image looks blown out and grainy. With the YbCbCr file, basically the same problem. Chroma set to NN.
Clearly not working here. GTX 660, newest Madvr, nightly MPC-HC, Windows 8.1.1. From the samples shown however, this looks like a great middle-ground between Chroma Jinc and NNEDI3, which for DVD and lower quality content I just cant combine with Luma NNEDI3 16N with both double and quad enabled on this 660 and i7 870. Wish NNEDI3 ran on DirectCompute. Last edited by FireFreak111; 12th June 2014 at 15:07. |
![]() |
![]() |
![]() |
#78 | Link |
Registered User
Join Date: Apr 2014
Posts: 48
|
Sorry for the full size images, photobuckets linking is messed when trying to use a full size image.
There is a distinct blur when using these shaders, it doesn't appear to be working correctly. Nearest Neighbour: ![]() Chroma-NEDI ![]() |
![]() |
![]() |
![]() |
Tags |
chromanedi, nedi, shader, superres, upscaling |
Thread Tools | Search this Thread |
Display Modes | |
|
|