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 27th July 2016, 14:47   #1061  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by cretindesalpes View Post
No, this is not a gamma function, and actually it makes the data going even further from the linear-light scale. The purpose is to amplify the scale of the dark parts relative the the other parts. So it acts like a luma-based multiplier on the SAD. With a slope s0 = 2.0, thSAD for the darkest parts is implicitly divided by 2. The c parameter indicates the length of the transition between the dark and normal SAD.

Here are some graphs to show how the curve looks for different s0 and c values:



Blue = original luma, green = mapped luma

Note that for high c or s0 values, the brightest parts have also their thSAD modified (in the other direction), because the slope of the curve near 1 tends to flatten.
the image no longer there, can someone upload it somewhere?

edit: got it form Dogway
__________________
See My Avisynth Stuff

Last edited by real.finder; 27th July 2016 at 18:23.
real.finder is offline   Reply With Quote
Old 3rd October 2016, 20:34   #1062  |  Link
TheSkiller
Registered User
 
Join Date: Dec 2007
Location: Germany
Posts: 632
Okay, this may be a dumb question, but how do I make Dither convert RGB32 or RGB24 to RGB48y?

If I try to use dither_convert_8_to_16() when the clip is RGB24 or RGB32 I get this error message:

"Avisynth open failure:
BlankClip: color_yuv only valid for YUV color spaces
dither.avsi, line 1045
dither.avsi, line 1052"
TheSkiller is offline   Reply With Quote
Old 5th October 2016, 07:50   #1063  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
Quote:
Originally Posted by TheSkiller View Post
Okay, this may be a dumb question, but how do I make Dither convert RGB32 or RGB24 to RGB48y?
Interleave(ShowRed("y8"), ShowGreen("y8"), ShowBlue("y8")).Dither_convert_8_to_16()
__________________
Say no to AviSynth 2.5.8 and DirectShowSource!
colours is offline   Reply With Quote
Old 14th October 2016, 11:41   #1064  |  Link
~ VEGETA ~
The cult of personality
 
~ VEGETA ~'s Avatar
 
Join Date: May 2013
Location: Planet Vegeta
Posts: 155
I want to discuss something with you, which is masking the details of the video out and leave only flat areas. I didn't do much tests and I am using vapoursynth now I didn't achieve flexibility yet.

My method is this: make an edge mask and make it strong so that it includes all edges and details. Since details are somehow similar to edges. Playing around with the mask (I guess it was sobel or something) makes better results, although I didn't know how to make it expand in VS at that time.

Now that I have the details, I just inverse the result to get the no-details areas, hence, flat ares. Now I can use smdegrain without fear.

I do mask the dark areas (using levels) to safely apply f3kdb the way I want, I almost never apply filters to the whole video. However, when I want to use gradfun3, I take extra care because sometimes its results are bad... like masking out the dark areas and the extremely bright ones, then apply it to that area.

As for add_grain or GrainFactory3, sometimes I like them but they are not suitable for normal anime and I haven't used them on actual encode.


What do you think of this way? what is your way?
~ VEGETA ~ is offline   Reply With Quote
Old 14th October 2016, 14:14   #1065  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by ~ VEGETA ~ View Post
My method is this: make an edge mask and make it strong so that it includes all edges and details. Since details are somehow similar to edges. Playing around with the mask (I guess it was sobel or something) makes better results, although I didn't know how to make it expand in VS at that time.
I wonder if there's any plugin that works like the activity masking from Daala and could be useful for your idea. Scroll down to "Activity Masking: Putting the P in PVQ":
https://people.xiph.org/~jm/daala/pvq_demo/
sneaker_ger is offline   Reply With Quote
Old 14th October 2016, 15:46   #1066  |  Link
~ VEGETA ~
The cult of personality
 
~ VEGETA ~'s Avatar
 
Join Date: May 2013
Location: Planet Vegeta
Posts: 155
Quote:
Originally Posted by sneaker_ger View Post
I wonder if there's any plugin that works like the activity masking from Daala and could be useful for your idea. Scroll down to "Activity Masking: Putting the P in PVQ":
https://people.xiph.org/~jm/daala/pvq_demo/
Seems interesting enough. What do you use to achieve what I posted?

thanks
~ VEGETA ~ is offline   Reply With Quote
Old 14th October 2016, 17:20   #1067  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
I never bothered with masking. I just filter everything.
sneaker_ger is offline   Reply With Quote
Old 14th October 2016, 18:55   #1068  |  Link
~ VEGETA ~
The cult of personality
 
~ VEGETA ~'s Avatar
 
Join Date: May 2013
Location: Planet Vegeta
Posts: 155
Quote:
Originally Posted by sneaker_ger View Post
I never bothered with masking. I just filter everything.
oh but what filters do you use?
~ VEGETA ~ is offline   Reply With Quote
Old 15th October 2016, 16:42   #1069  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by ~ VEGETA ~ View Post
I want to discuss something with you, which is masking the details of the video out and leave only flat areas. I didn't do much tests and I am using vapoursynth now I didn't achieve flexibility yet.

My method is this: make an edge mask and make it strong so that it includes all edges and details. Since details are somehow similar to edges. Playing around with the mask (I guess it was sobel or something) makes better results, although I didn't know how to make it expand in VS at that time.

Now that I have the details, I just inverse the result to get the no-details areas, hence, flat ares. Now I can use smdegrain without fear.

I do mask the dark areas (using levels) to safely apply f3kdb the way I want, I almost never apply filters to the whole video. However, when I want to use gradfun3, I take extra care because sometimes its results are bad... like masking out the dark areas and the extremely bright ones, then apply it to that area.

As for add_grain or GrainFactory3, sometimes I like them but they are not suitable for normal anime and I haven't used them on actual encode.


What do you think of this way? what is your way?
details = mt_makediff(last, last.removegrain(20).removegrain(20).removegrain(20))
last.removegrain(20).removegrain(20).removegrain(20)
#blah blah blah to flat components
last.mt_adddiff(details)
feisty2 is offline   Reply With Quote
Old 14th February 2017, 05:57   #1070  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
How do I convert a video from 12 bit to 8 bit with X264? Do I need to use Dither Tools to avoid banding?
__________________
By law and justice!

GMJCZP's Arsenal
GMJCZP is offline   Reply With Quote
Old 14th February 2017, 13:09   #1071  |  Link
kgrabs
Registered User
 
Join Date: Jan 2017
Posts: 28
Quote:
Originally Posted by GMJCZP View Post
How do I convert a video from 12 bit to 8 bit with X264? Do I need to use Dither Tools to avoid banding?
With --input-depth 12 in the command line, x264 will use Sierra-2-4A error diffusion to dither to the target depth.

Otherwise, with 12 bit interleaved format, this should be mostly identical to ditherpost defaults (ordered dither):

Code:
f3kdb(0,0,0,0,0,0, keep_tv_range=true, dither_algo=2, input_mode=2, input_depth=12, output_mode=0, output_depth=8)

Last edited by kgrabs; 25th February 2017 at 09:40. Reason: incorrect info
kgrabs is offline   Reply With Quote
Old 14th February 2017, 14:19   #1072  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by kgrabs View Post
With --input-depth 12 in the command line, x264 will use Floyd Steinberg error diffusion to dither to the target depth.

Otherwise, with 12 bit interleaved format, this should be mostly identical to ditherpost defaults (ordered dither):

Code:
f3kdb(0,0,0,0,0,0, keep_tv_range=true, dither_algo=2, input_mode=2, input_depth=12, output_mode=0, output_depth=8)
or

f3kdb_dither(mode=0, stacked=false, input_depth=12)
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 14th February 2017, 18:33   #1073  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
Thank you very mucho to both.

I am getting a distorted image with many colors when using both formulas with f3kdb.

I do not work neither version 1.5.1 nor f3kdb-rev410.
With the f3kdb-rev410 32 bit version does not deserve the function f3kdb_dither (mode = 0, stacked = false, input_depth = 12).
__________________
By law and justice!

GMJCZP's Arsenal
GMJCZP is offline   Reply With Quote
Old 14th February 2017, 20:26   #1074  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by GMJCZP View Post
Thank you very mucho to both.

I am getting a distorted image with many colors when using both formulas with f3kdb.

I do not work neither version 1.5.1 nor f3kdb-rev410.
With the f3kdb-rev410 32 bit version does not deserve the function f3kdb_dither (mode = 0, stacked = false, input_depth = 12).
what avs you use? and by what source filter and it's version?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 15th February 2017, 02:58   #1075  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
Avisynth sET avisynth_20150220; ffms2-2.23.1-msvc.

Edit: I already tried with Avisynth 2.6.0 RC3 (AviSynth_150419) and same result.
__________________
By law and justice!

GMJCZP's Arsenal

Last edited by GMJCZP; 15th February 2017 at 03:17.
GMJCZP is offline   Reply With Quote
Old 15th February 2017, 07:42   #1076  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by GMJCZP View Post
Avisynth sET avisynth_20150220; ffms2-2.23.1-msvc.

Edit: I already tried with Avisynth 2.6.0 RC3 (AviSynth_150419) and same result.
the output in your case is always 8 bit, you must use avs+, and avs+ already has bits converter too
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 15th February 2017, 21:17   #1077  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
Quote:
Originally Posted by real.finder View Post
the output in your case is always 8 bit, you must use avs+, and avs+ already has bits converter too
I understand. The alternative is pass directly the source in x264 with the option --input-depth 12 and make and lossless x264 8 bit output for future modifications.
__________________
By law and justice!

GMJCZP's Arsenal

Last edited by GMJCZP; 15th February 2017 at 21:22.
GMJCZP is offline   Reply With Quote
Old 15th February 2017, 21:32   #1078  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by kgrabs View Post
With --input-depth 12 in the command line, x264 will use Floyd Steinberg error diffusion to dither to the target depth.
x264's dithering is based on Sierra-2-4A.
sneaker_ger is offline   Reply With Quote
Old 15th February 2017, 21:33   #1079  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
How strange, in Simplex264 I put --input-depth 12 and I get the video with the strange colors.
__________________
By law and justice!

GMJCZP's Arsenal
GMJCZP is offline   Reply With Quote
Old 15th February 2017, 21:46   #1080  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
What exactly is your script and the command Simplex264 uses? If AviSynth outputs 8 bit and you tell x264 the input is 12 bit that's gotta result in disaster, naturally.
sneaker_ger is offline   Reply With Quote
Reply

Tags
color banding, deblocking, noise reduction

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 00:29.


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