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. |
18th June 2021, 13:54 | #1101 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
scalef/scaleb should be as fast as ymax, ymin etc... anyway pinterf should give the right answer
anyway, I will try add new constants for full range ymaxf, yminf etc... and do PR
__________________
See My Avisynth Stuff |
18th June 2021, 14:02 | #1102 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,361
|
That would lead to lots of string if else's or ReplaceStr() to change ie. ymax to ymaxf. Wouldn't be easier an argument for it? I don't see how one would want to mix full scale with stretched constants.
Anyway, thanks for looking into it, this thing was affecting my code progress.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
18th June 2021, 19:05 | #1103 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
__________________
See My Avisynth Stuff |
18th June 2021, 19:08 | #1104 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,361
|
Thank you. I think that nonef was a good idea except for displacing the option to use FloatUV for 32-bit chroma processing. I'm currently rebasing all my scripts.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
19th June 2021, 19:22 | #1107 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
|
The new build works fine on XP x86, Ferenc, thanks!
About the fact that Visual Studio 2022 won't support v141_xp as target, well... I'm just gonna say that the disastrous day in which Avisynth won't work on XP anymore is gonna be the day in which I'll shut down forever the Windows XP Virtual Machine and I'll fire up the Sucksdown 10 one... :'( (or if by that time we'll have everything working on Linux, then I'll just stick with Fedora eheheheh) |
19th June 2021, 21:35 | #1108 | Link |
Registered User
Join Date: Mar 2018
Posts: 447
|
Test results: I think I was able to store a clip into frame properties, at least there was no error and the clip displays fine after that. This works:
Code:
clip = propSet(clip, "test", function[store_this](clip c) { return store_this } ) Code:
clip = propSet(clip, "test", function[store_this](clip c) { return store_this }, mode=1 ) Code:
return ScriptClip(clip, """ return propGetAny(clip, "test") """) and if I try to read a clip from an array with Code:
return ScriptClip(clip, """ return propGetAsArray(clip, "test")[0] """) So looks like there needs to be some additional support for reading the clip typed frame properties. Oh, and for some reason the plugins in x64 directory were actually 32bit versions. I just replaced them with my previous x64 versions. |
20th June 2021, 07:28 | #1109 | Link |
Acid fr0g
Join Date: May 2002
Location: Italy
Posts: 2,582
|
Or 11 directly.
Picture that I am currently using Windows 10 + WSLg with Debian. They introduced graphic and CUDA support too. In many instances it can get better scores than pure Linux.
__________________
@turment on Telegram |
20th June 2021, 18:54 | #1110 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Levels function isn't working in 16-bit. Output is completely black.
Code:
ConvertBits(16) #ConvertToRGB64(matrix="Rec601") ConvertToPlanarRGB(matrix="Rec601") Levels(0, 1/2.2, 255, 0, 255) ConvertToY(matrix="Rec601") ConvertToYUV420() |
21st June 2021, 09:39 | #1112 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
There is no automatic scaling. |
|
21st June 2021, 09:56 | #1114 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
I have to mention (not for you, Dogway, because you experienced a lot with Expr), using 8 bit constants are safe, they are internally treated as 32 bit floats so e.g. 16/255 does not become 0 inside. |
|
21st June 2021, 10:08 | #1115 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
Other optimizations exists, e.g. x Power of 2 is optimized to x*x (powers -1, 0, 1, 2, 3 and 4 are handled) |
|
21st June 2021, 10:24 | #1116 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
Code:
ColorBarsHD(pixel_type = "YUV444P16") Expr("65535","65535","65535") Expr("x ymax ymin - range_max / * ymin +") ConvertBits(8) ScriptClip(""" Subtitle(String(expr("x").AverageLuma())) """) I got it where you got 234. This happens only when you mix the 8 bit inputs with 16 bit ranges. (235 - 16) / 255 is not the same conversion factor as (60160 - 4096) / 65535 Calculations: 255.0f * (235.f - 16.f) / 255.f + 16.0f; Result = 235.0 255.0f * (60160.f - 4096.f) / 65535.f + 16.0f) Result = 234.1478 65535 * (60160.f - 4096.f) / 65535.f + 4096.0f; Result: 60160.0 Last edited by pinterf; 21st June 2021 at 12:01. |
|
21st June 2021, 11:38 | #1118 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
How did you get the constant of 80 for 10 bit ymin instead of 64? Min values must keep the *rule of 8_bit_min * 2^(N-8) where N is the bit depth. As for limited range maximum values there was a decision of keeping the same 8_bit_max * 2^(N-8) calculation, against the other choice of (8_bit_max + 1) * 2^(N-8) - 1. Limited range ConvertBits() conversions are simple bit-shifts (upwards) and round-then-bitshift (downwards) (note: Expr is always rounding and does not truncate before converting back to the integer domain) EDIT: see calculations in my previous answer (#1116) where I put it where your calculation went astray in my opinion. Last edited by pinterf; 21st June 2021 at 12:03. |
|
21st June 2021, 12:49 | #1119 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,361
|
Even if the ex_dlut() function might seem overdone to simply "fix" an issue in Expr() I will keep it to save some operations (ie. "ymax ymin - range_max /") and for reference.
You are referencing an old table which was wrong. You can look my table 4 posts later . Or simply check the updated function in ExTools 2.0 with float precision. It works on my tests but if you spot something wrong let me know. Over the development of Transforms Pack, where I need bit perfect conversions I noticed something was off and that led me to this conclusion. Your sample script is crafted to output the result you look for. A real world scenario is more like the following (no body uses fulls=true to be honest). Code:
ColorBarsHD(pixel_type = "YUV444P8") Expr("255","255","255") ConvertBits(16) Expr("x ymax ymin - range_max / * ymin +") ConvertBits(8) ScriptClip(""" Subtitle(String(expr("x").AverageLuma())) """) EDIT: To answer your #1116 EDIT. Yes, range_max is scaling in full stretch fashion whereas everything else does in bitshift, disparity that leads to that error. 255.0f * (60160.f - 4096.f) / 65280.f + 16.0f) Result = 235.0 65280 * (60160.f - 4096.f) / 65280.f + 4096.0f; Result: 60160.0
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread Last edited by Dogway; 21st June 2021 at 13:05. |
21st June 2021, 13:39 | #1120 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
Well, if people are not telling the conversion type if it should use full or limited range but still expect perfectly guessed results, I can't help with it. I'm somehow reluctant to support Avisynth Expr with new bad-habit workaround constants. |
|
|
|