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. |
19th January 2015, 21:38 | #41 | Link | ||
Registered User
Join Date: Nov 2009
Posts: 2,361
|
Yes, I tested yesterday and found out, also tested Dither_resize16() and luckily cretindesalpes got that covered (matches results from Resize8() ), so my panic level decreased.
It just feels odd that a "restoration" program degrades an image in some form, and nobody cares. Same with nnedi Quote:
Quote:
Not saying it's wrong just that it feels I'm missing something. I will look onto this better tomorrow. edit: I think I got it, src_left is not applied before or after, just at the same time as the resizing, it's hard to grasp but I think I figured it out. Last edited by Dogway; 19th January 2015 at 21:42. |
||
19th January 2015, 21:57 | #42 | Link | |
Registered User
Join Date: Dec 2007
Location: Germany
Posts: 632
|
Quote:
Code:
ImageSource("PM5544_with_non-PAL_signals.png") ConvertToYV16() Dither_convert_8_to_16() Dither_Resize16(Width*32, 576, kernel="Spline36") Ditherpost(mode=-1) ConvertToRGB() Spline36Resize(Width/32, height) Crop(240,460,-240,-30) PointResize(Width*2, Height*2) #for better visibility Subtitle("Dither_Resize16") |
|
31st July 2015, 22:34 | #46 | Link |
Registered User
Join Date: Oct 2014
Posts: 476
|
About the resize chroma problem, is there a way to write a script to get Resize8 to catch all calls to Spline36resize? Since I have tons of scripts that use Spline36resize.
And is the replacement of Lanczos with Spline36 here: Code:
kernel = Default(kernel, yup ? "Lanczos4" : "Spline36") kernel_c = Default(kernel_c, cup ? "Lanczos" : "Spline36") Last edited by kuchikirukia; 31st July 2015 at 23:21. |
31st July 2015, 23:01 | #47 | Link |
The image enthusyast
Join Date: Mar 2015
Location: Brazil
Posts: 270
|
My dear friend, how are you thinking about convert YCbCr 4:2:0 to YCbCr 4:4:4? As I know, YCbCr subsampling makes a lot of pixels have only Y value. So how recover the miss information?
__________________
Searching for great solutions |
31st July 2015, 23:43 | #48 | Link |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Did you even bother to read the thread? They scale the luma plane by a factor of two (guess some prefer to use Spline36Resize for that) and they adjust the offset of the chroma with respect to the luma.
Nb, when there is subsampling it means that several pixels share the same chroma, and not that some don't have chroma. |
3rd August 2015, 18:39 | #49 | Link |
The image enthusyast
Join Date: Mar 2015
Location: Brazil
Posts: 270
|
Wilbert, thank you so much for you correct me about subsampling, but I guess you didn't get me completely! if I subsample from YUV 444 to YUV 420, for example, I will lost so much chroma information, so will be praticaly impossible I recover that. Considering that subsample generates artifacts, in better case, the interpolation to YUV 444 will maintain that, without creates more (What didn't occur with Spline36). So, even you try convert to YUV 444, probably you will never have a true 444.
__________________
Searching for great solutions |
3rd August 2015, 22:17 | #50 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
YUV 420 at 1920x1080 means Y is 1920x1080, but U,V are 960x540. You are downscaling Y to match U, V Y - 960x540 U - 960x540 V - 960x540 That is 4:4:4 Similarly , if you had UHD 4:2:0, you can downscale to 1080 4:4:4 Nothing is "true 4:4:4" unless it's CG , or oversampled by a large margin. Even high end expensive cameras that shoot 4:4:4 don't really have 4:4:4 resolution when measured on zone plates. Effective resolution is lost due to processing, debayering. Only if you oversample and downscale, can you get true 4:4:4 Last edited by poisondeathray; 3rd August 2015 at 22:21. |
|
4th August 2015, 05:47 | #51 | Link | |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Quote:
|
|
11th August 2015, 10:00 | #54 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
This very simple script :
Code:
r = blankclip(width=8,height=8,pixel_type="YV24",color_yuv=$FF0000).ConvertToYV12(ChromaOutPlacement="MPEG2") g = blankclip(width=8,height=8,pixel_type="YV24",color_yuv=$00FF00).ConvertToYV12(ChromaOutPlacement="MPEG2") stackhorizontal(r,g) o=stackvertical(last,last.fliphorizontal()) X0=Width(o) Y0=Height(o) a=nnedi3_rpow2(o,rfactor=32,cshift="spline36resize",csresize=false) X1=Width(a) Y1=Height(a) shift=0.25*(1.0-(Float(X0)/Float(X1))) Y = ConvertToY8(o).Spline36Resize(X1, Y1) U = UToY8(o).Spline36Resize(X1/2,Y1/2, src_left=shift) V = VToY8(o).Spline36Resize(X1/2,Y1/2, src_left=shift) b = YToUV(U, V, Y) c=Spline36Resize(o,X1,Y1) interleave(b,c,a) I've tried to imagine the resizing somehow a resampling, i've the following guess. If Out>In and Out/In is an integer n, you'll have each n pixels of the output identical to the input, and so finaly everythings ends up again in the good place. If In>Out and In/Out is an integer n, you'll have each n pixel of the input wich is the ouput, and so finaly everythings ends up again in the good place. So, my guess is : If the ration Out/In (or In/Out) is an integer, the adjustment is 0. If f(x) is the value of the chroma adjustement, i think we have a periodic function with a period of 1, with f(n)=0 if n is integer, with probably its peak value at f(0.5). I think the formula is not so obvious as it's been described. Edit : You can also see the issue with decreasing : Code:
r = blankclip(width=128,height=128,pixel_type="YV24",color_yuv=$FF0000).ConvertToYV12(ChromaOutPlacement="MPEG2") g = blankclip(width=128,height=128,pixel_type="YV24",color_yuv=$00FF00).ConvertToYV12(ChromaOutPlacement="MPEG2") stackhorizontal(r,g) o=stackvertical(last,last.fliphorizontal()) X0=Width(o) Y0=Height(o) a=Spline36Resize(o,16,16) X1=Width(a) Y1=Height(a) shift=0.25*(1.0-(Float(X0)/Float(X1))) Y = ConvertToY8(o).Spline36Resize(X1, Y1) U = UToY8(o).Spline36Resize(X1/2,Y1/2, src_left=shift) V = VToY8(o).Spline36Resize(X1/2,Y1/2, src_left=shift) b = YToUV(U, V, Y) c=PointResize(o,16,16) interleave(b,a,c) PointResize(512,512) I was often saying unless i'm doing something wrond, and i was. My mistake was this : Code:
r = blankclip(width=128,height=128,pixel_type="YV24",color_yuv=$FF0000).ConvertToYV12(ChromaOutPlacement="MPEG2") g = blankclip(width=128,height=128,pixel_type="YV24",color_yuv=$00FF00).ConvertToYV12(ChromaOutPlacement="MPEG2") stackhorizontal(r,g) o=stackvertical(last,last.fliphorizontal()) Code:
r = blankclip(width=128,height=128,pixel_type="YV24",color_yuv=$FF0000) g = blankclip(width=128,height=128,pixel_type="YV24",color_yuv=$00FF00) stackhorizontal(r,g) o=stackvertical(last,last.fliphorizontal()).ConvertToYV12(ChromaOutPlacement="MPEG2") All my applogies, and thanks for all the informations on this thread. Last edited by jpsdr; 12th August 2015 at 09:48. |
20th August 2019, 06:39 | #55 | Link |
Registered User
Join Date: Jan 2019
Location: Antarctica
Posts: 74
|
1080p 4:2:0 to 720p 4:4:4 shifting
Sorry for reviving a old thread.
Hello, I wanted to simply ask if this is still the route to use for a similar script but with changes as the script I use can't use ConvertToY8, results are to be encoded to HEVC 10 bit and 12 bit. Code:
Avisynth+ x86 ly = GradFun3mod(thr=0.35, yuv444=true, resizer="DebilinearM", lsb_in=true, lsb=true) lc = nnedi3_resize16(1280*2, 720*2,lsb_in=true,lsb=true,kernel_d="Spline64",kernel_u="Spline64",src_top=0.0,src_left=0.50) lu = lc.UtoY() lv = lc.VtoY() YtoUV(lu,lv,ly) AviSynth+ x64 ly = GradFun3mod(thr=0.35, yuv444=true, resizer="DebilinearMTM", lsb_in=true, lsb=true) lc = nnedi3_resize16(1280*2, 720*2,lsb_in=true,lsb=true,kernel_d="Spline64",kernel_u="Spline64",src_top=0.0,src_left=0.50) lu = lc.UtoY() lv = lc.VtoY() YtoUV(lu,lv,ly) I've posted elsewhere with these examples including to the above person (jpsdr and real.finder) and no correction was given concerning the script. For the curious they were at https://forum.doom9.org/showthread.p...89#post1879189 and https://forum.doom9.org/showthread.p...64#post1879764 Just want to be certain as I maybe mistaking it for another resizer that said something that shifting was no longer necessary to do. Uncertain if it was speaking on just a simple resize without the above luma+chroma. Examples from using the above script (x86 version) - Progressive 23.976 fps. Order left to right: source | 0.50 | 0.25 | 0.0 And any other information that may help me understand would be appreciate if you don't mind. Last edited by dREV; 20th August 2019 at 06:39. Reason: sorry for reviving a old thread |
Thread Tools | Search this Thread |
Display Modes | |
|
|