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

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th February 2017, 21:13   #601  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by DJATOM View Post
pinterf
Native mode is broken: http://diff.pics/fJ6BMfn0glF4/1
Nice painting. What function/filter was used? Perhaps clip info, processor type (There are SSE4/SSE2 code paths, even C for non-mod16 leftovers)
pinterf is offline   Reply With Quote
Old 12th February 2017, 21:22   #602  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by real.finder View Post
I try it in VirtualBox with winxp but can't load it by loadplugin(), will get error 0x3e6

and something else, b1 and a48 don't supports yv411 and if anyone work with ntsc dv will need to convert color format just for this, so can we have yv411 supports too?
O.K. yv411 is supported, even in the merge luma=true sse2 speedups. Regarding XP: a special build works under XP for me but I had to omit boost library (there is a conditional directive for this), I don't know what else is affected if I switch it off. Functions mt_infix and mt_polish are giving error message. But I will wait a bit more, to have other issues for a hotfix.

Last edited by pinterf; 12th February 2017 at 21:35.
pinterf is offline   Reply With Quote
Old 12th February 2017, 22:23   #603  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
Quote:
Originally Posted by pinterf View Post
Nice painting. What function/filter was used? Perhaps clip info, processor type (There are SSE4/SSE2 code paths, even C for non-mod16 leftovers)
Sure, script:
Code:
v1=DGSource("I:\KEIJO_3\BDMV\STREAM\00001.dgi").ConvertBits(16)
v2=DGSource("I:\KEIJO_3\BDMV\STREAM\00000.dgi").ConvertBits(16)
mask=v1.masktools2_z_mt_edge("prewitt",u=3,v=3)
masktools2_z_mt_merge16(v1,v2,mask,true,false).ConvertToStacked()
Just random 2 videos, it doesn't matter.
Ah, I just renamed new dll to masktools2_z.dll for having old one. CPU - i5-4670k.
DJATOM is offline   Reply With Quote
Old 12th February 2017, 23:10   #604  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by DJATOM View Post
Sure, script:
Code:
v1=DGSource("I:\KEIJO_3\BDMV\STREAM\00001.dgi").ConvertBits(16)
v2=DGSource("I:\KEIJO_3\BDMV\STREAM\00000.dgi").ConvertBits(16)
mask=v1.masktools2_z_mt_edge("prewitt",u=3,v=3)
masktools2_z_mt_merge16(v1,v2,mask,true,false).ConvertToStacked()
Just random 2 videos, it doesn't matter.
Ah, I just renamed new dll to masktools2_z.dll for having old one. CPU - i5-4670k.
Ahh, mt_edge is not yet for 16 bits, I think. I didn't have time to write proper error messages for all 8 bit-only filters to reject 10+ bit clips. 8 bit processing on 16 bit data, nice
pinterf is offline   Reply With Quote
Old 13th February 2017, 22:35   #605  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by real.finder View Post

just wonder, the existing script that use 0-255 range (in lut or other) will work in more than 8 bit? or we will need to edit hundreds of .avsi?
I was thinking of the problem, let's see a sample expression, that streches the range 16-235 to 0-255 for luma, and 16-240 -> 0-255 for the chroma.

Code:
8 bit: new_x = (x  - 16) / 219 * 255, where 219 = 235-16
10 bit: new_x = (x  - 64) / 876 * 1023 where 876= 940-64
16 bit: new_x = (x  - 4096) / 56064 * 65535 where 56064 = 60160-4096
For an mt_lut/mt_lut16 the reverse polish expression is:
Code:
expr8 = "x 16 - 219 / 255 *"
expr10 = "x 64 - 876 / 1023 *"
expr16 = "x 4096 - 56064 / 65535 *"
Provided you have generic script, there are many ifs or conditional Evals.

New#1: With the next masktools version you can use a new #B (or #F) operator that autoscales a 8 bit value for the current bit depth

Code:
expr_luma =  "x 16 #B - 219 #B / 255 #F *"
expr_chroma =  "x 16 #B - 224 #B / 255 #F *"
New#2: You can use predefined constants in your expression script, the above sample can be written as:
Code:
expr_luma = "x ymin - ymax ymin - / range_max *"
expr_chroma = "x cmin - cmax cmin - / range_max *"
New constants I have implemented:
  • bitdepth: automatic silent parameter of the lut expression
  • range_half --> autoscaled 128 or 0.5 for float
  • range_max --> 255/1023/4095/16383/65535 or 1.0 for float
  • range_size --> 256/1024...65536
  • ymin, ymax, cmin, cmax --> 16/235 and 16/240 autoscaled.

And there are two autoscale operators:
#B Method: bit shifts (use this for YUV) e.g. "235 #B" -> always results in max luma
#F Method: full-span stretch e.g. x/255*65535 for 16 bit rgb)

other samples
Code:
expr = "x 40 #B +"
expr = "210 #B" # scale const 210!
expr = "x 16 #B - 219 #B / 255 #B *"
expr = "x ymin - ymax ymin - / range_max *"
expr = "x ymin - ymax ymin - / range_max * range_half 2 / +"
Opinions?

Last edited by pinterf; 13th February 2017 at 22:54. Reason: typo
pinterf is offline   Reply With Quote
Old 14th February 2017, 07:37   #606  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
pinterf, that seems good to me (but you should wait for others as I don't have many experiences with lut)

I see TheFluff said that vs expr is fast even in 8 bit, did you have look at expr?

and another thing, cretindesalpes did mt_xxpand_multi.avsi back then, can this be in masktools.dll? I think this will be faster than what cretindesalpes did in .avsi
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 17th February 2017, 09:55   #607  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
I'm in the middle of porting lut functions for high bit depth, and had to do the realtime calculation for them, which is default when lut tables are too big (but nevertheless implemented optional 16 bit lutxy for hardcore x64 users with plenty of RAM :-) )
Now I know what a JIT could help speedwise, because realtime computing is really not a speed champion. Obviously using JIT would be the next logical evolution step.
pinterf is offline   Reply With Quote
Old 18th February 2017, 15:07   #608  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
https://github.com/vapoursynth/vapou...exprfilter.cpp
TheFluff is offline   Reply With Quote
Old 18th February 2017, 23:43   #609  |  Link
blaze077
Registered User
 
Join Date: Jan 2016
Posts: 79
Thank you for the release, pinterf.
blaze077 is offline   Reply With Quote
Old 25th February 2017, 11:16   #610  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Just for all readers reference:
New masktools2a.48 successor (masktools2 pfmod) thread here
martin53 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 06:32.


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