Thread: Avisynth+
View Single Post
Old 2nd June 2016, 02:59   #1687  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by bilditup1 View Post
OK. I am using QTGMC atm without issue. Let's see if it holds. Hopefully we'll be able to remove these disclaimers and prevent this kind of confusion
Indeed, hopefully more people will help out in testing and validating filters. This list was meant to be community-driven but so far only a few people have actually contributed.
Quote:
Originally Posted by bilditup1 View Post
Off-topic I know, but how does this work? I found this snippet at the wiki:

Code:
Dither_convert_8_to_16 ()
Dither_resize16 (1280, 720)
Dither_convert_yuv_to_rgb (matrix="601", output="rgb48y", lsb_in=true)
r = SelectEvery (3, 0)
g = SelectEvery (3, 1)
b = SelectEvery (3, 2)
Dither_convert_rgb_to_yuv (r, g, b, matrix="709", lsb=false, mode=0)
For HD to SD conversion, should I just get rid of the resize, and switch the matrix parameters in the third and seventh lines? I don't understand what I'm looking at, specifically the SelectEvery() lines.
That script is on the wiki upscales SD to HD content, you want to downscale so use this instead:

Code:
Dither_convert_8_to_16 ()
Dither_resize16 (640, 480, csp="YV24") # change to the desired dimensions
Dither_convert_yuv_to_rgb (matrix="709", output="rgb48y", lsb_in=true) # convert to RGB using the 709 color matrix commonly used in HD content
r = SelectEvery (3, 0)
g = SelectEvery (3, 1)
b = SelectEvery (3, 2)
Dither_convert_rgb_to_yuv (r, g, b, matrix="601", lsb=false, mode=0, output="YV12") # convert to YUV using the 601 color matrix commonly used in SD content
First the YUV clip is scaled from HD to SD. Then it gets converted to RGB and finally back to YUV with the appropriate matrix for SD. The SelectEvery() is used to process 48-bit RGB clips, from the docs:
Quote:
48-bit RGB. The components R, G and B are conveyed on three YV12 or Y8 (if supported) stack16 clips interleaved on a frame basis.
I added csp="YV24" to Dither_resize16 to avoid any unnecessary resizing on the chroma planes. Finally, the output will be 8-bit YV12 if you want 16-bit just set lsb=true, if you want another colorspace just change the output parameter.
Reel.Deel is offline