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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st February 2014, 15:08   #1  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,383
Any resizers with anti-ringing?

Are there any plugins / filters for AVIsynth that have anti-ringing capability for resizing like madVR has? I know ResampleHQ has linear light capability, but no mention of anti-ringing. I searched around some but didn't find any mention of any.
Stereodude is offline   Reply With Quote
Old 1st February 2014, 15:13   #2  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,538
dither_resize16nr or nnedi3/eedi3
feisty2 is offline   Reply With Quote
Old 1st February 2014, 15:32   #3  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,538
or you can use any other resizer you want like this "xxxresize ().repair (gaussresize (p=100),mode=1)" which is basically the same as dither_resize16nr script

Last edited by feisty2; 1st February 2014 at 15:48.
feisty2 is offline   Reply With Quote
Old 1st February 2014, 15:47   #4  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,383
Quote:
Originally Posted by feisty2 View Post
dither_resize16nr or nnedi3/eedi3
Okay, thanks I'll check out dither_resize16nr since I want to downscale and AFAIK nnedi3/eedi3 can't.
Stereodude is offline   Reply With Quote
Old 1st February 2014, 16:10   #5  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,538
Quote:
Originally Posted by Stereodude View Post
Okay, thanks I'll check out dither_resize16nr since I want to downscale and AFAIK nnedi3/eedi3 can't.
no, downscaling ringing is almost invisible, so using dither_resize16nr instead of dither_resize16 will only cause blur and other problems but gives you no good, it's only recommended to use non ringing resizer for upscaling
feisty2 is offline   Reply With Quote
Old 1st February 2014, 16:52   #6  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,383
Quote:
Originally Posted by feisty2 View Post
no, downscaling ringing is almost invisible, so using dither_resize16nr instead of dither_resize16 will only cause blur and other problems but gives you no good, it's only recommended to use non ringing resizer for upscaling
Oh... Good to know.

I was using this:
Code:
ResampleHQ(1280,720, "YV12", "TV.709", "TV.709", false, 0, 0, -0, -0 ,"CatmullRom")
flash3kyuu_deband(range=15, grainY=32, grainC=32, sample_mode=2, dither_algo=3, mt=false)
I think this is more or less the same thing using the dither package though I don't think Dither_resize16 scales in linear light...
Code:
Dither_convert_8_to_16()
Dither_resize16(1280, 720, 0, 0, -0, -0, kernel="bicubic", a1=0, a2=.5)
GradFun3(smode=1,lsb_in=true,lsb=true,debug=0)
DitherPost()
Or should I deband the source prior to scaling it since the final dither is the last step either way?
Stereodude is offline   Reply With Quote
Old 1st February 2014, 17:03   #7  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,820
Perhaps this can also help with filter selection.
Sharc is offline   Reply With Quote
Old 1st February 2014, 17:33   #8  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,383
Quote:
Originally Posted by Sharc View Post
Perhaps this can also help with filter selection.
That was interesting. I hadn't seen it before.
Stereodude is offline   Reply With Quote
Old 2nd February 2014, 04:35   #9  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,538
yeah, you can achieve gamma aware resizing by using "Dither_y_gamma_to_linear" and "Dither_y_linear_to_gamma", dither_resize16 is not gamma aware

Last edited by feisty2; 2nd February 2014 at 05:14.
feisty2 is offline   Reply With Quote
Old 2nd February 2014, 13:56   #10  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,383
Quote:
Originally Posted by feisty2 View Post
yeah, you can achieve gamma aware resizing by using "Dither_y_gamma_to_linear" and "Dither_y_linear_to_gamma", dither_resize16 is not gamma aware
If I'm resizing in 16 bits do I need a linear light resizer?
Stereodude is offline   Reply With Quote
Old 2nd February 2014, 14:11   #11  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,538
Quote:
Originally Posted by Stereodude View Post
If I'm resizing in 16 bits do I need a linear light resizer?
you can use gamma aware resizing but it may give you ringing and aliasing for some unknown reasons
Code:
# 1920x1080 stacked 16bit input here #
dither_convert_yuv_to_rgb (lsb_in=true,output="rgb48y")
Dither_y_gamma_to_linear (curve="709")
dither_resize16 (1280,720)
Dither_y_linear_to_gamma (curve="709")
Dither_convert_rgb_to_yuv (SelectEvery (3, 0),SelectEvery (3, 1),SelectEvery (3, 2),lsb=true)
now your video is downscaled to 720p with gamma aware process

Last edited by feisty2; 2nd February 2014 at 14:14.
feisty2 is offline   Reply With Quote
Old 2nd February 2014, 18:07   #12  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,383
Quote:
Originally Posted by feisty2 View Post
you can use gamma aware resizing but it may give you ringing and aliasing for some unknown reasons
Interesting... I have noticed the aliasing with ResampleHQ. Especially when going from FHD to DVD. I didn't attribute it to gamma aware resizing though.
Stereodude is offline   Reply With Quote
Old 3rd February 2014, 15:22   #13  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 621
With gamma-aware resizing, ringing occurs on the dark part of a contrasted dark/light edge. The ringing exists without gamma awareness too, but it becomes more visible when resizing in a linear colorspace. The reason is exactly the same as for the preservation of stars in a night sky. Averaging pixels of different intensities in a gamma-compensated colorspace tends to darken the result.

On the other hand, the ringing is attenuated in the light part.

Anyway, the correct way to resize a YCbCr picture in linear light is to convert it first in RGB, then to RGB by linearizing each component. Then resize and do the inverse transform. Check this.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r22 for Vapoursynth | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 4th February 2014, 03:29   #14  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,383
Quote:
Originally Posted by cretindesalpes View Post
Anyway, the correct way to resize a YCbCr picture in linear light is to convert it first in RGB, then to RGB by linearizing each component. Then resize and do the inverse transform. Check this.
So it this correct then?
Code:
Dither_convert_8_to_16()
GradFun3(radius=15, smode=1, lsb_in=true, lsb=true, debug=0)
dither_convert_yuv_to_rgb (lsb_in=true, output="rgb48y")
Dither_y_gamma_to_linear (curve="709", tv_range_in=false, tv_range_out=false, u=1, v=1)
Dither_resize16(1280, 720, 2, 2, -6, -2, kernel="bicubic", a1=0, a2=.5, u=1, v=1)
Dither_y_linear_to_gamma (curve="709", tv_range_in=false, tv_range_out=false, u=1, v=1)
Dither_convert_rgb_to_yuv (SelectEvery (3, 0), SelectEvery (3, 1), SelectEvery (3, 2), lsb=true)
DitherPost(mode=0)
Why do I want tv_range_in = false?
Stereodude is offline   Reply With Quote
Old 4th February 2014, 07:39   #15  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 768
Because the clip has been converted to RGB, as a result it's in full range.
HolyWu is offline   Reply With Quote
Old 4th February 2014, 09:40   #16  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,538
oh, my omission, sure u should set "tv_range_in=false, tv_range_out=false"
coz it works on RGB mode which means full range
feisty2 is offline   Reply With Quote
Old 4th February 2014, 15:28   #17  |  Link
TheSkiller
Registered User
 
Join Date: Dec 2007
Location: Germany
Posts: 634
This raises a question...
Which curve is the correct one to use in linear <-> gamma conversions if we're working with stacked RGB originating from standard 8 bit YCbCr (like YV12)?
I noticed you guys use curve="709" while in cretindesalpes' example there is no curve specified which means it defaults to "sRGB".
TheSkiller is offline   Reply With Quote
Old 4th February 2014, 16:17   #18  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,538
the transfer characteristics (curves) for dvd and hdtv are both bt709, and bt2020 for uhdtv
feisty2 is offline   Reply With Quote
Old 4th February 2014, 16:25   #19  |  Link
TheSkiller
Registered User
 
Join Date: Dec 2007
Location: Germany
Posts: 634
Well, yes, I know. But after we convert YV12 to RGB... doesn't that change the transfer curve to sRGB?
I thought 601 and 709 (and BT.2020) exist only in YCbCr land, not RGB.

By the way, the transfer characteristics for DVD are definitely not 709 but 601 like pretty much all SD sources.

Last edited by TheSkiller; 4th February 2014 at 16:31.
TheSkiller is offline   Reply With Quote
Old 4th February 2014, 16:35   #20  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,538
Quote:
Originally Posted by TheSkiller View Post
Well, yes, I know. But after we convert YV12 to RGB... doesn't that change the transfer curve to sRGB?
I thought 601 and 709 (and BT.2020) exist only in YCbCr land, not RGB.

By the way, the transfer characteristics for DVD are definitely not 709 but 601 like pretty much all SD sources.
bt601 and bt709 are exactly the same curve, transfer characteristic and matrix are 2 different things!
feisty2 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:40.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.