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 Development

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 23rd February 2018, 11:56   #3961  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,803
Quote:
Originally Posted by pinterf View Post
Have you tried the newer betas? 3.1.0.746
https://forum.doom9.org/showthread.php?t=168282
Support for AviSynth has been dropped after 306
Atak_Snajpera is offline  
Old 26th February 2018, 06:10   #3962  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Here's a strange one.
Code:
BlankClip
_aaa
return Last

function aaa(clip C) { 
    return C.Subtitle("HOW DID I GET HERE??", align=5)
}
It shouldn't work, but it does (note leading underscore on function call)
raffriff42 is offline  
Old 26th February 2018, 06:35   #3963  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Seems that empty dll name plus underscore plus aaa works here
EDIT: When a function is not coming from a dll, the plugin_base_name is empty, the internal secondary 'canon_name' is simply _functionname.
https://github.com/pinterf/AviSynthP...nager.cpp#L209

Last edited by pinterf; 26th February 2018 at 09:38.
pinterf is offline  
Old 27th February 2018, 16:39   #3964  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Looking at raffriff42's stuff (convert Tweak-like parameters for ColorYUV), plus because I have finally implemented ColorYUV for 32 bit float, I realized that gain, contrast and gramma parameter are not really convenient and intuitive.
So I have made a ColorYUV2 with the same parameter names but accepting the Tweak-like numbers instead.
My question is about the naming - I don't like this one with 2 suffix. AdjustYUV? YUVYUV? YUVYUVYUV?
Or should we add a new parameter to the existing ColorYUV list as a hint to treat the parameter ranges Tweak-like?
EDIT: ColorYUV2 is an existing one so is ruled out from the contest (StainlessS)

Last edited by pinterf; 27th February 2018 at 17:05. Reason: new fact
pinterf is offline  
Old 27th February 2018, 16:59   #3965  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
ColorYUV2(), Hmmm, https://forum.doom9.org/showthread.php?t=156774

https://forum.doom9.org/showthread.p...v2#post1378126

http://www.mediafire.com/file/875czv...l_20120529.zip
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 27th February 2018 at 17:02.
StainlessS is offline  
Old 27th February 2018, 18:22   #3966  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
For a name, I think maybe ColorYUVs (s for scaled).
In a similar way, I have made Levelsc where sc means scaled - I didn't want Levelss because someday StainLessS might want the name
raffriff42 is offline  
Old 27th February 2018, 20:08   #3967  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
LevelsS, fine with me.

Raff, did you see the ShowChannels post, ie #3944
Quote:
### show original & 3 channels (Y, U, V or R, G, B) in quad split
#@ function ShowChannels(clip C, bool "analyze", bool "uinvert", bool "chroffset")
Quote:
Presumably in honour of my plugin ShowChannels

ShowChannels:- https://forum.doom9.org/showthread.p...t=ShowChannels
EDIT: Perhaps Viewchannels().

EDIT: To below Raff post, Thanx, Raff, just wanted to ensure that you had seen that post.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 27th February 2018 at 20:18.
StainlessS is offline  
Old 27th February 2018, 20:09   #3968  |  Link
VS_Fan
Registered User
 
Join Date: Jan 2016
Posts: 98
TweakYUV
VS_Fan is offline  
Old 27th February 2018, 20:16   #3969  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
StainLessS, OK, I get your drift - I'm hijacking your filter name. Henceforth, my filter will be called ShowChannelsQuad.

Last edited by raffriff42; 28th February 2018 at 00:24. Reason: edit
raffriff42 is offline  
Old 27th February 2018, 22:55   #3970  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
adding a new parameter to the existing ColorYUV list is better option in my opinion
__________________
See My Avisynth Stuff
real.finder is offline  
Old 28th February 2018, 13:08   #3971  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by raffriff42 View Post
I have been working on some AVS+ enhancement routines for months without promoting it.
http://avisynth.nl/images/Utils-r41.avsi
Some comments and clarifications.
- I have just checked, displaying YUV444P16 (Y416) now works with the latest (v41106) VdFilterMod.
- in AnalyzeFmt: "Note stats labeled "99%" actually 99.6% (255/256)"
This is true only for 8 bits.
For bit depths over 8 the resolution is finer, because pixel population is gathered into an array of 1024/4096...65536 entries. For float the population is also counted: using 65536 levels.
- float fullscale max is 1.0
(note: in the near future (I've already done some preparations) chroma in 32 bit float will go to -0.5..0.5 instead of current early decided 0..1.0. It'll solve the possible problems about "what is neutral grey chroma in float for a 0..1.0 range".
- when converting to float, we stretch 0..255, 0..1023.. 0..65535 into the 0..1 range. The conversion factor is not simply 2^N, but 2^N - 1.
pinterf is offline  
Old 28th February 2018, 13:09   #3972  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by real.finder View Post
adding a new parameter to the existing ColorYUV list is better option in my opinion
Yes, let's not duplicate the very same function. f2c=true will do it.
pinterf is offline  
Old 28th February 2018, 15:36   #3973  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
pinterf, I appreciate the clarifications. I've noticed unexpected chroma output when converting float32 TV<->PC and now I see why.


Regarding ColorYUV, gamma has an issue - gamma is calculated between 0-255 instead of 16-235.

Here are some screenshots which (by the way) demo some Utils-r41 filters:


(linear response for comparison)


(note elevated black and white levels)



(black and white correctly unchanged)


Code:
Import(p + "Utils-r41.avsi")
s="""
BlankClip(pixel_type="YV12")
Grayramp(height=80, zigs=true)
ToPC
ColorYUV(gamma_y=f2c(1.5))
ToTV
HistogramTurn
"""
r=Eval(s)
ShowSnippet(s, r, size=24)
raffriff42 is offline  
Old 1st March 2018, 05:11   #3974  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
RGB48 & RGB64 : IsInterleaved property = false
(IsPlanar = false also)
raffriff42 is offline  
Old 1st March 2018, 06:54   #3975  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Thanks, that gamma thing found, classic avs is ok, for couriousity I'll check when it disappeared.

EDIT:
nothing has been disappeared.

The biggest difference I found is that in AVS+ the "PC->TV" and "TV->PC" conversion happens at the end of the gain-contrast-offset-gamma conversion, while classic Avisynth is doing that the the beginning of the process.

There is no correction before applying gamma in either versions. Assumes PC range.
This is why it worked for you with an input having PC levels.

Now when you want to have proper black levels you have to do similar like this:
ColorYUV(levels="TV->PC").ColorYUV(....,gamma_y=-40).ColorYUV(levels="PC->TV")
Which is obviously not a nice solution.

In theory, the ColorYUV function (after modification) would know that it should apply gamma on TV level.
We surely know that input is PC or TV range when levels="TV->PC" or "PC->TV" is given.
When none of the above levels parameters exist, coring=true would also indicate that the clip is TV range.

Probably levels="TV" (a newly allowed value for "levels") would help clarifying if none of the above mentioned options are set. (Why cannot we have frame properties in avs?)

Last edited by pinterf; 1st March 2018 at 11:03. Reason: new findings
pinterf is offline  
Old 1st March 2018, 19:54   #3976  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
New build. So many things has been changed, now I really need feedback.

Download Avisynth+ r2636

EDIT: 2632 link replaced

Code:
20180302 r2636
--------------
  - Fix: Blur/Sharpen crashed when YUY2.width<8, RGB32.width<4, RGB64.width<2 (StainlessS)
  - Fix: ColorYUV: don't apply TV range gamma for opt="coring" when explicit "PC->TV" is given
  - Fix: ColorbarsHD: 32bit float properly zero(0.5)-centered chroma

20180301 r2632
--------------
  - Fix: IsInterleaved returned false for RGB48 and RGB64 (raffriff42)
  - Fix: SubTitle for Planar RGB/RGBA: wrong text colors (raffriff42)
  - Fix: Packed->Planar RGB conversion failed on SSE2-only computers (SSSE3 instruction used)
  - Enhanced: Blur, Sharpen
    AVX2 for 8-16 bit planar colorspaces (>1.35x speed on i7-7770)
    SSE2 for 32 bit float formats (>1.5x speed on i7-7770)
  - Fix: Resizers for 32 bit float rare random garbage on right pixels (simd code NaN issue)
  - Enhanced: Completely rewritten 16bit and float resizers, much faster (and not only with AVX2)
  - Enhanced: 8 bit resizers: AVX2 support
  - Enhanced: Speed up converting from RGB24/RGB48 to Planar RGB(A) - SSSE3, approx. doubled fps
  - New: ConvertFPS supports 10-32 bits, planar RGB(A), YUV(A)
  - New script function: int BitSetCount(int[, int, int, ...])
    Function accepts one or more integer parameters
    Returns the number of bits set to 1 in the number or the total number of '1' bits in the supplied integers.
  - Cherry-picking from StainlessS' great RT_xxxx collection/and raffriff42 utils
  - Modded script function: Hex(int , int "width"=0)
    - New "width" parameter
    - result is in uppercase
    Width is 0 to 8, the _minimum_ width of the returned string. (8 hex digit is the max of Avisynth32 bit integer)
    When width is 0 or not supplied then string length is a minimum needed.
    Function now returns hex string in uppercase, instead of lowercase.
    Example: Hex(255,4) returns "00FF".
  - Modded script function: HexValue(String, "pos"=1)
    - new pos parameter
    Returns an int conversion of the supplied hexadecimal string.
    Conversion will cease at the first non legal number base digit, without producing an error
    Added optional pos arg default=1, start position in string of the HexString, 1 denotes the string beginning.
    Will return 0 if error in 'pos' ie if pos is less than 1 or greater than string length.
  - Modded script function: ReplaceStr(String, String, String[, Boolean "sig"=false])
    - New parameter: sig for case insensitive search (Default false: exact search)
      The uppercase/lowercase rules come from the current active code page of the OS.
  - New script functions: TrimLeft, TrimRight, TrimAll for removing beginning/trailing whitespaces from a string.
    Whitespaces: Tab (9), space (32), nbsp (160)
  - New in ColorYUV:
    New parameter: bool f2c="false".
    When f2c=true, the function accepts the Tweak-like parameters for gain, gamma and contrast
    E.g. use 0/0.5/1.0/1.5/2.0/3.0 instead of -256/-128/0/128/256/512 
  - New/Fixed in ColorYUV:
    Parameter "levels" accepts "TV". (can be "TV->PC", "PC->TV", "PC->TV.Y")
    Now gamma calculation is TV-range aware when either
    - levels is "TV->PC" or
    - coring = true or
    - levels is "TV" (new - no level conversion but gamma will know proper handling)
    Previously gamma was properly calculated only for PC range.
  - New in ColorYUV: 
    32 bit float support. 
    - 32 bit float uses the Expr filter (8-16 bits is LUT-based). The expression is dynamically assembled for each plane, internal precision is float.
    - One can specify bits=32 when showyuv=true -> test clip in YUV420PS format
    For 32 bit clips "loose min" and "loose_max" (omitting the extreme 1/256 population from dark and bright pixels) statistics are computed 
    by splitting the 0..1 into 65536 uniform ranges.
 - Modded: remove "scale" parameter from ConvertBits.
   It was introduced at the very beginning of the 10+bit development, for 32bit float conversion - never used
 - Enhanced: VfW: exporting Y416 (YUV444P16) to SSE2.
 - 8-16 bit YUV chroma to 32 bit float: keep middle chroma level (e.g. 128 in 8 bits) at 0.5.
   Calculate chroma as (x-128)/255.0 + 0.5 and not x/255.0 (Note: 32 bit float chroma center will be 0.0 in the future)
 - New: Histogram parameter "keepsource"=true (raffriff42) 
   keepsource = false returns only the Histogram w/o the original picture.
   Affects "classic", "levels" and "color", "color2", ignored (n/a) for the other modes
 - New: Histogram type "color" to accept 10-32bit input and "bits"=8,9,..12 display range
 - New: Histogram parameter "markers"=true
   When markers = false:
   For "classic": no "half" level line and no invalid luma zone coloring
   For "levels":  no "half" dotted line, no coloring (neither for YUV nor for RGB)
   Ignored for the others at the moment.

Last edited by pinterf; 2nd March 2018 at 10:49. Reason: New version
pinterf is offline  
Old 1st March 2018, 20:24   #3977  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
ColorYUV(levels="TV->PC").ColorYUV(....,gamma_y=-40).ColorYUV(levels="PC->TV")
Which is obviously not a nice solution.
I used to always do like that.

Quote:
- New/Fixed in ColorYUV:
Parameter "levels" accepts "TV". (can be "TV->PC", "PC->TV", "PC->TV.Y")
Now gamma calculation is TV-range aware when either
- levels is "TV->PC" or
- coring = true or
- levels is "TV" (new - no level conversion but gamma will know proper handling)
Previously gamma was properly calculated only for PC range.
Long time needed.

Lots of lovely new toys, thanx muchly
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline  
Old 1st March 2018, 22:16   #3978  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,746
Quote:
Originally Posted by StainlessS View Post
muchly
Does that exist at all?
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 1st March 2018, 22:36   #3979  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Does that exist at all?
Muchly:- http://www.yourdictionary.com/muchly

Quote:
adverb
Muchly is defined as a very informal way to say very much.
An example of muchly is when you really want something.
Quote:
Informal very much: used mainly in the humorous phrase thanks muchly
Quote:
Usage notes
Often regarded as a misconstruction of adverbial much.
From The Concise Oxford Dictionary, Ninth Edition, 1995. [EDIT: Before the avalanche of weird new words added to dictionaries]
Quote:
Muchly: Adverb. jocular [Middle English from muchel].
Gandalf might have used it muchly, then again, he might not have.

EDIT: And yet this one got by unmentioned,
Quote:
thanx muchly
EDIT: Ref below post (for LigH).
Methinks: (dated or humorous) it seems to me. [EDIT: Methinks that Bill Shakespeare probably oft used both Muchly and Methinks, and also Oft]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 2nd March 2018 at 10:33.
StainlessS is offline  
Old 1st March 2018, 22:49   #3980  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Methinks you are right
pinterf is offline  
Closed Thread

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 10:22.


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